2014-12-02 Richard Biener <rguenther@suse.de>
* match.pd: When combining divisions exclude the degenerate
case involving INT_MIN from overflow handling.
* gcc.dg/torture/
20141202-1.c: New testcase.
From-SVN: r218269
+2014-12-02 Richard Biener <rguenther@suse.de>
+
+ * match.pd: When combining divisions exclude the degenerate
+ case involving INT_MIN from overflow handling.
+
2014-12-02 Wilco Dijkstra <wilco.dijkstra@arm.com>
* ira-costs.c (scan_one_insn): Improve spill cost adjustment.
2014-12-02 Wilco Dijkstra <wilco.dijkstra@arm.com>
* ira-costs.c (scan_one_insn): Improve spill cost adjustment.
}
(if (!overflow_p)
(div @0 { wide_int_to_tree (type, mul); }))
}
(if (!overflow_p)
(div @0 { wide_int_to_tree (type, mul); }))
+ (if (overflow_p
+ && (TYPE_UNSIGNED (type)
+ || mul != wi::min_value (TYPE_PRECISION (type), SIGNED)))
{ build_zero_cst (type); }))))
/* Optimize A / A to 1.0 if we don't care about
{ build_zero_cst (type); }))))
/* Optimize A / A to 1.0 if we don't care about
+2014-12-02 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/torture/20141202-1.c: New testcase.
+
2014-12-02 H.J. Lu <hongjiu.lu@intel.com>
PR ipa/63814
2014-12-02 H.J. Lu <hongjiu.lu@intel.com>
PR ipa/63814
--- /dev/null
+/* { dg-do run } */
+
+extern void abort (void);
+
+int foo (int x)
+{
+ return (x / 2) / ((-__INT_MAX__ - 1) / -2);
+}
+
+int main()
+{
+ if (foo (- __INT_MAX__ - 1) != -1)
+ abort ();
+ return 0;
+}