This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/61657] Undefined behavior in loop-iv.c


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

--- Comment #10 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Author: trippels
Date: Fri Aug 21 16:44:30 2015
New Revision: 227075

URL: https://gcc.gnu.org/viewcvs?rev=227075&root=gcc&view=rev
Log:
Fix PR61657 (undefined behavior in loop-iv.c)

bootstrap-ubsan shows:
 loop-iv.c:2626:14: runtime error: signed integer overflow: 9223372036854775806
- -9223372036854775808 cannot be represented in type 'long int'

Fixed by moving the variables in question from signed to unsigned.

        PR rtl-optimization/61657
        * loop-iv.c (iv_number_of_iterations): Declare up and down as
        unsigned. Remove superflous uint64_t cast.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/loop-iv.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]