aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-06-10 23:47:45 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2002-06-10 23:47:45 +0200
commit156755acc094b11f5f26644888536feb519c5036 (patch)
tree18ee2adc18aa0ef20dd92587a364f5917f84fe87 /gcc
parent5d056e9be5ad2b652f1f76dc4e31621a16e541d6 (diff)
downloadgcc-156755acc094b11f5f26644888536feb519c5036.zip
gcc-156755acc094b11f5f26644888536feb519c5036.tar.gz
gcc-156755acc094b11f5f26644888536feb519c5036.tar.bz2
re PR rtl-optimization/6842 (internal compiler error using MMX intrinsics with optimization)
PR optimization/6842 * combine.c (combine_simplify_rtx) [SUBREG]: Don't ICE if VOIDmode operand subreg cannot be simplified. * gcc.dg/20020531-1.c: New test. From-SVN: r54462
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/combine.c7
-rw-r--r--gcc/testsuite/ChangeLog2
-rw-r--r--gcc/testsuite/gcc.dg/20020531-1.c21
4 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ba8541b..fd4663b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2002-06-10 Jakub Jelinek <jakub@redhat.com>
+ PR optimization/6842
+ * combine.c (combine_simplify_rtx) [SUBREG]: Don't ICE if VOIDmode
+ operand subreg cannot be simplified.
+
+2002-06-10 Jakub Jelinek <jakub@redhat.com>
+
* varasm.c (const_hash): Handle FDESC_EXPR like ADDR_EXPR.
(compare_constant): Likewise.
(output_addressed_constants): Likewise.
diff --git a/gcc/combine.c b/gcc/combine.c
index 11de1c7..0005e2a 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -3866,7 +3866,12 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
/* simplify_subreg can't use gen_lowpart_for_combine. */
if (CONSTANT_P (SUBREG_REG (x))
- && subreg_lowpart_offset (mode, op0_mode) == SUBREG_BYTE (x))
+ && subreg_lowpart_offset (mode, op0_mode) == SUBREG_BYTE (x)
+ /* Don't call gen_lowpart_for_combine if the inner mode
+ is VOIDmode and we cannot simplify it, as SUBREG without
+ inner mode is invalid. */
+ && (GET_MODE (SUBREG_REG (x)) != VOIDmode
+ || gen_lowpart_common (mode, SUBREG_REG (x))))
return gen_lowpart_for_combine (mode, SUBREG_REG (x));
if (GET_MODE_CLASS (GET_MODE (SUBREG_REG (x))) == MODE_CC)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f90d62d..a0a0de5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -4,6 +4,8 @@
* g++.dg/opt/vt1.C: New test.
+ * gcc.dg/20020531-1.c: New test.
+
2002-06-07 Roger Sayle <roger@eyesopen.com>
* gcc.dg/20020607-2.c: New test case.
diff --git a/gcc/testsuite/gcc.dg/20020531-1.c b/gcc/testsuite/gcc.dg/20020531-1.c
new file mode 100644
index 0000000..397e2a2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20020531-1.c
@@ -0,0 +1,21 @@
+/* PR optimization/6842
+ This testcase caused ICE when trying to optimize V8QI subreg of VOIDmode
+ CONST_DOUBLE. */
+/* { dg-do compile { target i?86-*-* } } */
+/* { dg-options "-O2 -mmmx" } */
+
+typedef int __v8qi __attribute__ ((__mode__ (__V8QI__)));
+extern void abort (void);
+extern void exit (int);
+
+void foo (void)
+{
+ unsigned long long a = 0x0102030405060708LL;
+ unsigned long long b = 0x1020304050607080LL;
+ unsigned long long c;
+
+ c = (unsigned long long) __builtin_ia32_paddusb ((__v8qi) a, (__v8qi) b);
+ __builtin_ia32_emms ();
+ if (c != 0x1122334455667788)
+ abort ();
+}