[Bug middle-end/81814] [5/6/7 Regression] Incorrect behaviour at -O0 (conditional operator)

aldyh at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 13 17:06:00 GMT 2017


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

--- Comment #15 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Author: aldyh
Date: Wed Sep 13 17:06:20 2017
New Revision: 252467

URL: https://gcc.gnu.org/viewcvs?rev=252467&root=gcc&view=rev
Log:
        PR middle-end/81814
        * fold-const.c (operand_equal_for_comparison_p): Remove code that used
        to mimic what shorten_compare did.  Change the return type to bool.
        (fold_cond_expr_with_comparison): Update call to
        operand_equal_for_comparison_p.
        (fold_ternary_loc): Likewise.

        * gcc.dg/torture/pr81814.c: New test.

Added:
    branches/range-gen2/gcc/testsuite/gcc.dg/torture/pr81814.c
Modified:
    branches/range-gen2/gcc/ChangeLog
    branches/range-gen2/gcc/fold-const.c
    branches/range-gen2/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list