* fold-const.c (operand_equal_p): Add code matching empty
constructors.
* gcc.dg/tree-ssa/operand-equal-1.c: Verify that empty constructors
are matched.
From-SVN: r229147
+2015-10-11 Jan Hubicka <hubicka@ucw.cz>
+
+ * fold-const.c (operand_equal_p): Add code matching empty
+ constructors.
+
2015-10-21 Eric Botcazou <ebotcazou@adacore.com>
* tree.def (CEIL_DIV_EXPR, FLOOR_DIV_EXPR, ROUND_DIV_EXPR): Tweak
return operand_equal_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg1, 0),
flags | OEP_ADDRESS_OF
| OEP_CONSTANT_ADDRESS_OF);
+ case CONSTRUCTOR:
+ /* In GIMPLE empty constructors are allowed in initializers of
+ aggregates. */
+ return (!vec_safe_length (CONSTRUCTOR_ELTS (arg0))
+ && !vec_safe_length (CONSTRUCTOR_ELTS (arg1)));
default:
break;
}
+2015-10-11 Jan Hubicka <hubicka@ucw.cz>
+
+ * gcc.dg/tree-ssa/operand-equal-1.c: Verify that empty constructors
+ are matched.
+
2015-10-21 Richard Sandiford <richard.sandiford@arm.com>
* gcc.dg/lto/20110201-1_0.c: Restrict to sqrt_insn targets.
2015-10-21 Marek Polacek <polacek@redhat.com>
+
PR c/68024
* gcc.dg/pr68024.c: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+struct a {int a,b;};
+struct a ret(int val)
+{
+ return val? (struct a){} : (struct a){};
+}
+/* { dg-final { scan-tree-dump-not "if " "pre"} } */