aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-08-21 15:27:56 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-08-21 15:27:56 +0200
commit1125164cd32576b05e6c078077d78736fa0d63e3 (patch)
tree53f59061ef5b672943a8efb5c4d2d4046a85a6b7 /gcc
parent3c0c8f9dff5c2fd1e71fcbc5c05a65a33caa0303 (diff)
downloadgcc-1125164cd32576b05e6c078077d78736fa0d63e3.zip
gcc-1125164cd32576b05e6c078077d78736fa0d63e3.tar.gz
gcc-1125164cd32576b05e6c078077d78736fa0d63e3.tar.bz2
simplify-rtx.c (simplify_immed_subreg): Only clear up to elem_bitsize bits, not max_bitsize.
* simplify-rtx.c (simplify_immed_subreg) <case CONST_DOUBLE>: Only clear up to elem_bitsize bits, not max_bitsize. * gcc.target/i386/sse-4.c: New test. From-SVN: r103318
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/simplify-rtx.c2
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-4.c10
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1329cf2..90e30ae 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-21 Jakub Jelinek <jakub@redhat.com>
+
+ * simplify-rtx.c (simplify_immed_subreg) <case CONST_DOUBLE>: Only clear
+ up to elem_bitsize bits, not max_bitsize.
+
2005-08-21 Sebastian Pop <pop@cri.ensmp.fr>
PR tree-optimization/23433
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index ca9d9da..8a2faae 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -3605,7 +3605,7 @@ simplify_immed_subreg (enum machine_mode outermode, rtx op,
}
/* It shouldn't matter what's done here, so fill it with
zero. */
- for (; i < max_bitsize; i += value_bit)
+ for (; i < elem_bitsize; i += value_bit)
*vp++ = 0;
}
else
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f248940..310c782 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2005-08-21 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.target/i386/sse-4.c: New test.
+
2005-08-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR testsuite/23239
diff --git a/gcc/testsuite/gcc.target/i386/sse-4.c b/gcc/testsuite/gcc.target/i386/sse-4.c
new file mode 100644
index 0000000..394ad9d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse-4.c
@@ -0,0 +1,10 @@
+/* This testcase caused a buffer overflow in simplify_immed_subreg. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2" } */
+
+#include <emmintrin.h>
+
+__m128i foo (__m128i x)
+{
+ return _mm_min_epu8 (x, _mm_set1_epi8 (10));
+}