[flang-commits] [flang] [Flang] Extracting internal constants from scalar literals (PR #73829)

Mats Petersson via flang-commits flang-commits at lists.llvm.org
Mon Jun 17 11:58:12 PDT 2024


Leporacanthicus wrote:

> The test program
> 
> ```
> subroutine s(x)
>   print *, x
>   x = x + 1.
> end
> 
> call s(1.)
> call s(1.)
> end
> ```
> 
> will print `1.` twice successfully with default compilation options to five Fortran compilers today, and crash with a segfault with three. this seems like the wrong thing to do for code portability.

Yes, this is simpler variation on my simple assigned goto example that you said was "non-conforming", and I expect this one falls in the same category. It would probably be good to detect and warn for this - and I would expect at least some compilers do that. 

https://github.com/llvm/llvm-project/pull/73829


More information about the flang-commits mailing list