This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/81814] [5/6/7/8 Regression] Incorrect behaviour at -O0 (conditional operator)
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 Aug 2017 14:33:45 +0000
- Subject: [Bug middle-end/81814] [5/6/7/8 Regression] Incorrect behaviour at -O0 (conditional operator)
- Auto-submitted: auto-generated
- References: <bug-81814-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81814
--- Comment #13 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Thu Aug 17 14:33:13 2017
New Revision: 251152
URL: https://gcc.gnu.org/viewcvs?rev=251152&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:
trunk/gcc/testsuite/gcc.dg/torture/pr81814.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog