2014-08-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/62175
* tree-ssa-loop-niter.c (expand_simple_operations): Do not
expand possibly trapping operations.
* g++.dg/torture/pr62175.C: New testcase.
From-SVN: r214492
+2014-08-26 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/62175
+ * tree-ssa-loop-niter.c (expand_simple_operations): Do not
+ expand possibly trapping operations.
+
2014-08-26 David Malcolm <dmalcolm@redhat.com>
* config/rs6000/rs6000.c (class swap_web_entry): Strengthen field
+2014-08-26 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/62175
+ * g++.dg/torture/pr62175.C: New testcase.
+
2014-08-25 Bernd Schmidt <bernds@codesourcery.com>
* gcc.c-torture/execute/execute.exp: Replace with slightly adapted
--- /dev/null
+// { dg-do compile }
+// { dg-additional-options "-ftrapv" }
+
+struct B {
+ B(int = 0);
+};
+int c;
+int *d;
+struct G {
+ G();
+ int numProcs_;
+};
+int fn1();
+B fn2() {
+ if (c)
+ return 0;
+ return B();
+}
+
+long &fn3(long &p1, long &p2) {
+ if (p2 < p1)
+ return p2;
+ return p1;
+}
+
+void fn4(long p1) {
+ long a = fn1();
+ fn2();
+ int b = fn3(p1, a);
+ for (int i; i < b; ++i)
+ d[0] = 0;
+ for (; a < p1; ++a)
+ d[a] = 0;
+}
+
+G::G() { fn4(numProcs_ + 1); }
case PLUS_EXPR:
case MINUS_EXPR:
+ if (TYPE_OVERFLOW_TRAPS (TREE_TYPE (expr)))
+ return expr;
+ /* Fallthru. */
case POINTER_PLUS_EXPR:
/* And increments and decrements by a constant are simple. */
e1 = gimple_assign_rhs2 (stmt);