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 tree-optimization/80281] [5/6/7 Regression] Wrong constant folding


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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Apr  4 09:06:04 2017
New Revision: 246674

URL: https://gcc.gnu.org/viewcvs?rev=246674&root=gcc&view=rev
Log:
2017-04-04  Richard Biener  <rguenther@suse.de>

        PR middle-end/80281
        * match.pd (A + (-B) -> A - B): Make sure to preserve unsigned
        arithmetic done for the negate or the plus.  Simplify.
        (A - (-B) -> A + B): Likewise.
        * fold-const.c (split_tree): Make sure to not negate pointers.

        * gcc.dg/torture/pr80281.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr80281.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/match.pd
    trunk/gcc/testsuite/ChangeLog

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