2018-02-28 Richard Biener <rguenther@suse.de>
PR middle-end/84607
* genmatch.c (capture_info::walk_match): Do not mark
captured expressions without operands as expr_p given
they act more like predicates and should be subject to
"lost tail" side-effect preserving.
* gcc.dg/pr84607.c: New testcase.
From-SVN: r258061
+2018-02-28 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/84607
+ * genmatch.c (capture_info::walk_match): Do not mark
+ captured expressions without operands as expr_p given
+ they act more like predicates and should be subject to
+ "lost tail" side-effect preserving.
+
2018-02-28 Alexandre Oliva <aoliva@redhat.com>
PR rtl-optimization/81611
if (c->what
&& (e = dyn_cast <expr *> (c->what)))
{
- info[where].expr_p = true;
+ /* Zero-operand expression captures like ADDR_EXPR@0 are
+ similar as predicates -- if they are not mentioned in
+ the result we have to force them to have no side-effects. */
+ if (e->ops.length () != 0)
+ info[where].expr_p = true;
info[where].force_single_use |= e->force_single_use;
}
}
+2018-02-28 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/84607
+ * gcc.dg/pr84607.c: New testcase.
+
2018-02-28 Nathan Sidwell <nathan@acm.org>
PR c++/84602
--- /dev/null
+/* { dg-do run } */
+
+extern void exit(int);
+extern void abort(void);
+int a[10];
+int foo()
+{
+ exit (0);
+ return 0;
+}
+int main()
+{
+ if (&a[foo()])
+ abort ();
+ return 0;
+}