* c-typeck.c (build_conditional_expr): Remove C_MAYBE_CONST_EXPR
from folded operands before wrapping another around the
conditional expression.
testsuite:
* gcc.c-torture/compile/pr53418-1.c,
gcc.c-torture/compile/pr53418-2.c: New tests.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@187726
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-05-21 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/53418
+ * c-typeck.c (build_conditional_expr): Remove C_MAYBE_CONST_EXPR
+ from folded operands before wrapping another around the
+ conditional expression.
+
2012-05-21 Dave Boutcher <daveboutcher@gmail.com>
Patrick Marlier <patrick.marlier@gmail.com>
ret = fold_build3_loc (colon_loc, COND_EXPR, result_type, ifexp, op1, op2);
else
{
+ if (int_operands)
+ {
+ op1 = remove_c_maybe_const_expr (op1);
+ op2 = remove_c_maybe_const_expr (op2);
+ }
ret = build3 (COND_EXPR, result_type, ifexp, op1, op2);
if (int_operands)
ret = note_integer_operands (ret);
+2012-05-21 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/53418
+ * gcc.c-torture/compile/pr53418-1.c,
+ gcc.c-torture/compile/pr53418-2.c: New tests.
+
2012-05-21 Patrick Marlier <patrick.marlier@gmail.com>
* gcc.dg/tm/indirect-2.c: New test.
--- /dev/null
+void
+f (void)
+{
+ int i = (0 ? 1 : 0U / 0);
+}
--- /dev/null
+void
+f (void)
+{
+ int i = (1 ? 0U / 0 : 1);
+}