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 middle-end/79818] [7 Regression] wrong code with -fwrapv and -Os/-O1/-O2/-O3


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

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
We have ++c on signed char, which gcc turns into c=c+1, still on signed char,
where overflow is undefined behavior. The problem is long before the
transformation of the comparison. If ++c means c=(signed char)((int)c+1), it
should be lowered to that, or to an unsigned char addition.

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