[Bug tree-optimization/66828] [5/6 Regression] gcc/tree-ssa-math-opts.c:2182:38: runtime error: left shift of 72057594037927936 by 8 places cannot be represented in type 'long int'

thopre01 at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 14 02:03:00 GMT 2015


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

--- Comment #2 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> ---
The C standard says nothing about the cumulative effect of several shift so I'm
guessing that the real issue is probably that the type is signed. Quoting C99
section 6.5.8 paragraph 4:

"If E1 has a signed type and nonnegative value, and E1 × 2E2 is representable
in the result type, then that is the resulting value; otherwise, the behavior
is undefined."

Which is the case for the last iteration.


More information about the Gcc-bugs mailing list