Gentoo Archives: gentoo-commits

From: "Ryan Hill (dirtyepic)" <dirtyepic@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/4.5.2/gentoo: 24_all_4.5.2_pr43653_clang_ICE.patch README.history
Date: Thu, 24 Feb 2011 04:08:50
Message-Id: 20110224040838.6D80220054@flycatcher.gentoo.org
1 dirtyepic 11/02/24 04:08:38
2
3 Modified: README.history
4 Added: 24_all_4.5.2_pr43653_clang_ICE.patch
5 Log:
6 Add patch for bug #322419.
7
8 Revision Changes Path
9 1.11 src/patchsets/gcc/4.5.2/gentoo/README.history
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.5.2/gentoo/README.history?rev=1.11&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.5.2/gentoo/README.history?rev=1.11&content-type=text/plain
13 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.5.2/gentoo/README.history?r1=1.10&r2=1.11
14
15 Index: README.history
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.5.2/gentoo/README.history,v
18 retrieving revision 1.10
19 retrieving revision 1.11
20 diff -u -r1.10 -r1.11
21 --- README.history 13 Feb 2011 11:40:15 -0000 1.10
22 +++ README.history 24 Feb 2011 04:08:38 -0000 1.11
23 @@ -1,3 +1,6 @@
24 +1.2 pending
25 + + 24_all_4.5.2_pr43653_clang_ICE.patch
26 +
27 1.1 13.02.2011
28 + 22_all_4.6_pr45094_arm-dword-move.patch
29 + 23_all_4.6_pr45886_ARM_PCS_VFP.patch
30
31
32
33 1.1 src/patchsets/gcc/4.5.2/gentoo/24_all_4.5.2_pr43653_clang_ICE.patch
34
35 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.5.2/gentoo/24_all_4.5.2_pr43653_clang_ICE.patch?rev=1.1&view=markup
36 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.5.2/gentoo/24_all_4.5.2_pr43653_clang_ICE.patch?rev=1.1&content-type=text/plain
37
38 Index: 24_all_4.5.2_pr43653_clang_ICE.patch
39 ===================================================================
40 Unrecognizable insn with -O1 -ftree-vectorize
41
42 http://gcc.gnu.org/PR43653
43 https://bugs.gentoo.org/322419
44
45 --- gcc/config/i386/i386.c
46 +++ gcc/config/i386/i386.c
47 @@ -25137,7 +25137,8 @@
48 {
49 /* QImode spills from non-QI registers require
50 intermediate register on 32bit targets. */
51 - if (!in_p && mode == QImode && !TARGET_64BIT
52 + if (!TARGET_64BIT
53 + && !in_p && mode == QImode
54 && (rclass == GENERAL_REGS
55 || rclass == LEGACY_REGS
56 || rclass == INDEX_REGS))
57 @@ -25157,6 +25158,45 @@
58 return Q_REGS;
59 }
60
61 + /* This condition handles corner case where an expression involving
62 + pointers gets vectorized. We're trying to use the address of a
63 + stack slot as a vector initializer.
64 +
65 + (set (reg:V2DI 74 [ vect_cst_.2 ])
66 + (vec_duplicate:V2DI (reg/f:DI 20 frame)))
67 +
68 + Eventually frame gets turned into sp+offset like this:
69 +
70 + (set (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74])
71 + (vec_duplicate:V2DI (plus:DI (reg/f:DI 7 sp)
72 + (const_int 392 [0x188]))))
73 +
74 + That later gets turned into:
75 +
76 + (set (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74])
77 + (vec_duplicate:V2DI (plus:DI (reg/f:DI 7 sp)
78 + (mem/u/c/i:DI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0 S8 A64]))))
79 +
80 + We'll have the following reload recorded:
81 +
82 + Reload 0: reload_in (DI) =
83 + (plus:DI (reg/f:DI 7 sp)
84 + (mem/u/c/i:DI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0 S8 A64]))
85 + reload_out (V2DI) = (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74])
86 + SSE_REGS, RELOAD_OTHER (opnum = 0), can't combine
87 + reload_in_reg: (plus:DI (reg/f:DI 7 sp) (const_int 392 [0x188]))
88 + reload_out_reg: (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74])
89 + reload_reg_rtx: (reg:V2DI 22 xmm1)
90 +
91 + Which isn't going to work since SSE instructions can't handle scalar
92 + additions. Returning GENERAL_REGS forces the addition into integer
93 + register and reload can handle subsequent reloads without problems. */
94 +
95 + if (in_p && GET_CODE (x) == PLUS
96 + && SSE_CLASS_P (rclass)
97 + && SCALAR_INT_MODE_P (mode))
98 + return GENERAL_REGS;
99 +
100 return NO_REGS;
101 }
102
103 --- gcc/testsuite/gcc.target/i386/pr43653.c
104 +++ gcc/testsuite/gcc.target/i386/pr43653.c
105 @@ -0,0 +1,14 @@
106 +/* { dg-do compile } */
107 +/* { dg-options "-O1 -ftree-vectorize -msse" } */
108 +
109 +typedef struct {} S;
110 +
111 +void *foo()
112 +{
113 + S a[64], *p[64];
114 + int i;
115 +
116 + for (i = 0; i < 64; i++)
117 + p[i] = &a[i];
118 + return p[0];
119 +}