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

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Jun 17 12:04:30 PDT 2024


klausler 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.

Conforming or not, code that is reasonably portable today should also work with f18 with default options without source changes.  This case is kind of on the edge.

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


More information about the flang-commits mailing list