[Bug fortran/86945] BUG with optimisation of select case statement in gfortran v8.x

anlauf at gmx dot de gcc-bugzilla@gcc.gnu.org
Wed Aug 15 20:53:00 GMT 2018


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

--- Comment #4 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Harald Anlauf from comment #3)
> Self contained alternative testcase:
> With -Og, -O1 and higher:
> 
>  id=           1
>  ierr1, OK =            0 T
>  ierr2, OK =            1 F

The magic option is -fwrapv / -fno-wrapv.

With -Og -fwrapv:

 ierr1, OK =            0 T
 ierr2, OK =            0 T

With -Og -fno-wrapv:

 ierr1, OK =            0 T
 ierr2, OK =            1 F

Middle-end bug.


More information about the Gcc-bugs mailing list