[Bug fortran/96613] SIGFPE on min1() with -ffpe-trap=invalid switch

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Aug 16 21:52:37 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96613

--- Comment #4 from kargl at gcc dot gnu.org ---
(In reply to anlauf from comment #3)
> Created attachment 49066 [details]
> WIP patch
> 
> The underlying issue is visible in the tree-dump, see also comment#1 by
> Steve.
> Changing the type and kind of the temporary to a common argument one instead
> of the result, the issue is fixed.  Playing around a little bit, one finds
> that
> even the GNU extension to MIN/MAX, allowing different argument kinds, is
> fishy.
> 
> The attached patch appears regtesting fine, but the coverage of the
> borderline
> cases is insufficient yet.
> 
> I'm not sure I got the GIMPLE magic right everywhere, so the patch may need
> extended testing before submitting.

Hi Harald,

I started to think about doing a similar patch as you have done.
Then, after looking at F2018 where it states that MIN1() = INT(MIN()),
I thought that this might be a good candidate for frontend fix.  
Similar to thomas's frontend optimizations except except the 
transformation is always done.  That is, we should be able to do
substitutions based on Table 16.3 before we even get to backend.


More information about the Gcc-bugs mailing list