codes run well with gfortran but report segfault with pgfort

 ind = (/(j,j=0,size(ind)-1)/)
   n = COUNT(BTEST(bc_type, i))
   n_velBCcells(i) = n
   IF (n /= 0) velBCcells(1:n,i) = PACK(ind,BTEST(bc_type,i))

The above code runs well when compiled by gfortran. Now, I use pgfortran to compile it and one segfault(Signalled SIGSEGV) was reported when executing the line:

IF (n /= 0) velBCcells(1:n,i) = PACK(ind,BTEST(bc_type,i))

I printed the n, i here out, they are all within the range. I failed to find any bug here. Does any body has similar experience or have any idea about why this happens? I think it may be caused by the change of compiler.

Your advice is warmly welcomed and will be appreciated.

Hi Chinacxt,

This might be the same as a known issue, TPR#18937 that will be fixed in the 12.10 release. If you can, please send a reproducing example to PGI Customer Support ( and we can confirm if it’s the same issue. Though, 12.10 should be available in the next few days so you can wait and try 12.10.


Hi, mkcolg,
Thanks for your information. My current license is PGI Accelerator Server Academic Version, 2-user, can I upgrade my compiler free after 12.10 is released? If it will be released in only a few days, I can wait.
BTW, I cannot provide full codes for customer support since I am not allowed to do so.

Hi Chinacxt,

Send a note to Your subscription ended in August which means that you are not entitled to 12.10. However, since it just expired and 12.10 will most likely fix your issue, we can ask them to extend your subscription by a few months.

Note while not necessary, maintaining a subscription is very helpful. In particular if you are doing any accelerator (GPU) work, this segment is undergoing rapid development and a subscription will keep you up to date.

  • Mat

Thanks mkcolg, I need to report to my boss~