aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-06-04 17:38:36 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-06-04 17:38:36 +0200
commit407bcba7b77ef3097651aa3a72b7f14b0fe5dfa2 (patch)
treeac894aaca24019bda80ff39fe911ab94a0e90066 /gcc
parent0defd7866392143e217750bc2b34be3ef0d6b57b (diff)
downloadgcc-407bcba7b77ef3097651aa3a72b7f14b0fe5dfa2.zip
gcc-407bcba7b77ef3097651aa3a72b7f14b0fe5dfa2.tar.gz
gcc-407bcba7b77ef3097651aa3a72b7f14b0fe5dfa2.tar.bz2
re PR target/49281 (lea_general_4 is wrong)
PR target/49281 * config/i386/i386.md (*lea_general_4): Require INTVAL (operands[3]) to be strictly smaller than 1 << shiftcount. * gcc.c-torture/execute/pr49281.c: New test. From-SVN: r174641
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/i386.md2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr49281.c25
4 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3306765..926e1b8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/49281
+ * config/i386/i386.md (*lea_general_4): Require INTVAL (operands[3])
+ to be strictly smaller than 1 << shiftcount.
+
2011-06-04 Jan Hubicka <jh@suse.cz>
PR tree-optimize/48929
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 739580c..9702473 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -6419,7 +6419,7 @@
|| optimize_function_for_size_p (cfun))
&& ((unsigned HOST_WIDE_INT) INTVAL (operands[2])) - 1 < 3
&& ((unsigned HOST_WIDE_INT) INTVAL (operands[3])
- <= ((unsigned HOST_WIDE_INT) 1 << INTVAL (operands[2])))"
+ < ((unsigned HOST_WIDE_INT) 1 << INTVAL (operands[2])))"
"#"
"&& reload_completed"
[(const_int 0)]
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 05efca0..483bffc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/49281
+ * gcc.c-torture/execute/pr49281.c: New test.
+
2011-06-04 Jan Hubicka <jh@suse.cz>
PR tree-optimize/48929
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr49281.c b/gcc/testsuite/gcc.c-torture/execute/pr49281.c
new file mode 100644
index 0000000..75f5314
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr49281.c
@@ -0,0 +1,25 @@
+/* PR target/49281 */
+
+extern void abort (void);
+
+__attribute__((noinline, noclone)) int
+foo (int x)
+{
+ return (x << 2) | 4;
+}
+
+__attribute__((noinline, noclone)) int
+bar (int x)
+{
+ return (x << 2) | 3;
+}
+
+int
+main ()
+{
+ if (foo (43) != 172 || foo (1) != 4 || foo (2) != 12)
+ abort ();
+ if (bar (43) != 175 || bar (1) != 7 || bar (2) != 11)
+ abort ();
+ return 0;
+}