re PR middle-end/81814 (Incorrect behaviour at -O0 (conditional operator))
authorMarek Polacek <polacek@redhat.com>
Thu, 17 Aug 2017 14:33:13 +0000 (14:33 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 17 Aug 2017 14:33:13 +0000 (14:33 +0000)
commite67bbd5da485d131c174d9a65669d3cb78057a8d
tree2bb315814e48b34f5839a38ff5724c92b008680a
parent909e448f672250610dd93204be3f9abe42748311
re PR middle-end/81814 (Incorrect behaviour at -O0 (conditional operator))

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.

From-SVN: r251152
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr81814.c [new file with mode: 0644]