+2005-07-25 James A. Morrison <phython@gcc.gnu.org>
+
+ PR rtl-optimization/23047
+ * simplify-rtx.c (simplify_const_relational_operation): Respect
+ flag_wrapv for comparisons with ABS.
+
2005-07-27 James A. Morrison <phython@gcc.gnu.org>
PR tree-optimization/22493
case LT:
/* Optimize abs(x) < 0.0. */
- if (trueop1 == CONST0_RTX (mode) && !HONOR_SNANS (mode))
+ if (trueop1 == CONST0_RTX (mode)
+ && !HONOR_SNANS (mode)
+ && !(flag_wrapv && INTEGRAL_MODE_P (mode)))
{
tem = GET_CODE (trueop0) == FLOAT_EXTEND ? XEXP (trueop0, 0)
: trueop0;
case GE:
/* Optimize abs(x) >= 0.0. */
- if (trueop1 == CONST0_RTX (mode) && !HONOR_NANS (mode))
+ if (trueop1 == CONST0_RTX (mode)
+ && !HONOR_NANS (mode)
+ && !(flag_wrapv && INTEGRAL_MODE_P (mode)))
{
tem = GET_CODE (trueop0) == FLOAT_EXTEND ? XEXP (trueop0, 0)
: trueop0;
2005-07-27 James A. Morrison <phython@gcc.gnu.org>
- PR rtl-optimization/22493
+ PR rtl-optimization/23047
+ * gcc.c-torture/execute/pr23047.c: New test.
+ * gcc.c-torture/execute/pr23047.x: New.
+
+2005-07-27 James A. Morrison <phython@gcc.gnu.org>
+
+ PR tree-optimization/22493
* gcc.c-torture/execute/pr22493-1.c: New test.
* gcc.c-torture/execute/pr22493-1.x: New.
* gcc.c-torture/execute/vrp-1.c: New test.
--- /dev/null
+#include <limits.h>
+extern void abort ();
+extern void exit (int);
+void f(int i)
+{
+ i = i > 0 ? i : -i;
+ if (i<0)
+ return;
+ abort ();
+}
+
+int main(int argc, char *argv[])
+{
+ f(INT_MIN);
+ exit (0);
+}
--- /dev/null
+set additional_flags "-fwrapv"
+return 0