[Bug tree-optimization/90213] UBSAN: signed integer overflow: -5621332293356458048 * 8 cannot be represented in type 'long int'

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 24 12:22:00 GMT 2019


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-04-24
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The code even says

                  /* TODO: This code seems wrong, multiply then check
                     to see if it fits.  */
                  offset *= tree_to_uhwi (unit_size);
                  offset *= BITS_PER_UNIT;

it might be as simple as moving the multiplication above the to_shwi
check.


More information about the Gcc-bugs mailing list