]> git.pld-linux.org Git - packages/gcc.git/blame - gcc32-pr6842.patch
- proper ep09 address
[packages/gcc.git] / gcc32-pr6842.patch
CommitLineData
5384b728 12002-05-31 Jakub Jelinek <jakub@redhat.com>
2
3 PR optimization/6842
4 * combine.c (combine_simplify_rtx) [SUBREG]: Don't ICE if VOIDmode
5 operand subreg cannot be simplified.
6
7 * gcc.dg/20020531-1.c: New test.
8
9--- gcc/testsuite/gcc.dg/20020531-1.c.jj Fri May 31 17:15:15 2002
10+++ gcc/testsuite/gcc.dg/20020531-1.c Fri May 31 17:13:50 2002
11@@ -0,0 +1,21 @@
12+/* PR optimization/6842
13+ This testcase caused ICE when trying to optimize V8QI subreg of VOIDmode
14+ CONST_DOUBLE. */
15+/* { dg-do compile { target i?86-*-* } } */
16+/* { dg-options "-O2 -mmmx" } */
17+
18+typedef int __v8qi __attribute__ ((__mode__ (__V8QI__)));
19+extern void abort (void);
20+extern void exit (int);
21+
22+void foo (void)
23+{
24+ unsigned long long a = 0x0102030405060708LL;
25+ unsigned long long b = 0x1020304050607080LL;
26+ unsigned long long c;
27+
28+ c = (unsigned long long) __builtin_ia32_paddusb ((__v8qi) a, (__v8qi) b);
29+ __builtin_ia32_emms ();
30+ if (c != 0x1122334455667788)
31+ abort ();
32+}
33--- gcc/combine.c.jj Thu May 23 10:22:59 2002
34+++ gcc/combine.c Fri May 31 17:05:09 2002
35@@ -3863,7 +3863,12 @@ combine_simplify_rtx (x, op0_mode, last,
36
37 /* simplify_subreg can't use gen_lowpart_for_combine. */
38 if (CONSTANT_P (SUBREG_REG (x))
39- && subreg_lowpart_offset (mode, op0_mode) == SUBREG_BYTE (x))
40+ && subreg_lowpart_offset (mode, op0_mode) == SUBREG_BYTE (x)
41+ /* Don't call gen_lowpart_for_combine if the inner mode
42+ is VOIDmode and we cannot simplify it, as SUBREG without
43+ inner mode is invalid. */
44+ && (GET_MODE (SUBREG_REG (x)) != VOIDmode
45+ || gen_lowpart_common (mode, SUBREG_REG (x))))
46 return gen_lowpart_for_combine (mode, SUBREG_REG (x));
47
48 if (GET_MODE_CLASS (GET_MODE (SUBREG_REG (x))) == MODE_CC)
This page took 0.124002 seconds and 4 git commands to generate.