Commit 1567db2f by Jan Hubicka Committed by Jan Hubicka

fold-const.c (operand_equal_p): Add code matching empty constructors.

	* 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
parent c26065cc
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> 2015-10-21 Eric Botcazou <ebotcazou@adacore.com>
* tree.def (CEIL_DIV_EXPR, FLOOR_DIV_EXPR, ROUND_DIV_EXPR): Tweak * tree.def (CEIL_DIV_EXPR, FLOOR_DIV_EXPR, ROUND_DIV_EXPR): Tweak
...@@ -2891,6 +2891,11 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) ...@@ -2891,6 +2891,11 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
return operand_equal_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg1, 0), return operand_equal_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg1, 0),
flags | OEP_ADDRESS_OF flags | OEP_ADDRESS_OF
| OEP_CONSTANT_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: default:
break; 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> 2015-10-21 Richard Sandiford <richard.sandiford@arm.com>
* gcc.dg/lto/20110201-1_0.c: Restrict to sqrt_insn targets. * gcc.dg/lto/20110201-1_0.c: Restrict to sqrt_insn targets.
...@@ -21,6 +26,7 @@ ...@@ -21,6 +26,7 @@
2015-10-21 Marek Polacek <polacek@redhat.com> 2015-10-21 Marek Polacek <polacek@redhat.com>
PR c/68024 PR c/68024
* gcc.dg/pr68024.c: New test. * gcc.dg/pr68024.c: New test.
......
/* { 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"} } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment