summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-03 14:58:05 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-03 14:58:05 +0000
commit2a66066b0ac637be190eb1dbcf6fb6579238907a (patch)
tree64a3bc1b5d70f4e37f19ec8171b5d5fafd91e377
parent9fac35cf9b7895c9aaddba530014428393058385 (diff)
downloadppe42-gcc-2a66066b0ac637be190eb1dbcf6fb6579238907a.tar.gz
ppe42-gcc-2a66066b0ac637be190eb1dbcf6fb6579238907a.zip
gcc:
2006-01-03 Paolo Bonzini <bonzini@gnu.org> PR rtl-optimization/25578 * combine.c (combine_simplify_rtx, force_to_mode): Don't pass a parameter to simplify_shift_const if changing ASHIFTRT to LSHIFTRT. gcc/testsuite: 2006-01-03 Paolo Bonzini <bonzini@gnu.org> PR rtl-optimization/25578 * gcc.c-torture/execute/20060102-1.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109281 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/combine.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20060102-1.c16
4 files changed, 31 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1e9a27b0c38..b0aa2ab92b5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-03 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/25578
+ * combine.c (combine_simplify_rtx, force_to_mode): Don't
+ pass a parameter to simplify_shift_const if changing ASHIFTRT
+ to LSHIFTRT.
+
2006-01-03 Adrian Straetling <straetling@de.ibm.com>
* gcc/builtins.c (get_builtin_sync_mem): New function.
diff --git a/gcc/combine.c b/gcc/combine.c
index 29ee191cba7..ab91989534e 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1,6 +1,6 @@
/* Optimize by combining instructions for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GCC.
@@ -4321,7 +4321,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest)
if (GET_CODE (temp) == ASHIFTRT
&& GET_CODE (XEXP (temp, 1)) == CONST_INT
&& INTVAL (XEXP (temp, 1)) == GET_MODE_BITSIZE (mode) - 1)
- return simplify_shift_const (temp, LSHIFTRT, mode, XEXP (temp, 0),
+ return simplify_shift_const (NULL_RTX, LSHIFTRT, mode, XEXP (temp, 0),
INTVAL (XEXP (temp, 1)));
/* If X has only a single bit that might be nonzero, say, bit I, convert
@@ -7103,7 +7103,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask,
if ((mask & ~nonzero) == 0)
{
- x = simplify_shift_const (x, LSHIFTRT, GET_MODE (x),
+ x = simplify_shift_const (NULL_RTX, LSHIFTRT, GET_MODE (x),
XEXP (x, 0), INTVAL (XEXP (x, 1)));
if (GET_CODE (x) != ASHIFTRT)
return force_to_mode (x, mode, mask, next_select);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4199859bed9..ec5497d1d77 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-03 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/25578
+ * gcc.c-torture/execute/20060102-1.c: New testcase.
+
2006-01-03 Richard Guenther <rguenther@suse.de>
PR c/25183
diff --git a/gcc/testsuite/gcc.c-torture/execute/20060102-1.c b/gcc/testsuite/gcc.c-torture/execute/20060102-1.c
new file mode 100644
index 00000000000..def13009270
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20060102-1.c
@@ -0,0 +1,16 @@
+extern void abort ();
+
+int f(int x)
+{
+ return (x >> 31) ? -1 : 1;
+}
+
+int main (int argc)
+{
+ /* Test that the function above returns different values for
+ different signs. */
+ if (f(argc) == f(-argc))
+ abort ();
+ return 0;
+}
+
OpenPOWER on IntegriCloud