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/56917] -ftrapv detects a overflow wrongly.


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

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Thu Dec  4 19:20:12 2014
New Revision: 218395

URL: https://gcc.gnu.org/viewcvs?rev=218395&root=gcc&view=rev
Log:
    PR middle-end/56917
    * fold-const.c (fold_unary_loc): Perform the negation in A's type
    when transforming ~ (A - 1) or ~ (A + -1) to -A.

    * c-c++-common/ubsan/pr56917.c: New test.

Added:
    trunk/gcc/testsuite/c-c++-common/ubsan/pr56917.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog


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