This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/40470] unable to find a register to spill in class ‘SSE_FIRST_REG’



------- Comment #6 from hjl dot tools at gmail dot com  2009-06-17 20:34 -------
(In reply to comment #4)
> Another testcase:
> 
> [hjl@gnu-6 gcc]$ cat /tmp/pr40470-3.c
> #include <nmmintrin.h>
> __m128i load (char *);
> char *
> foo (char *p1, char *p2,
>      int bmsk, __m128i mask1, __m128i mask2)
> {
>   int len = 0;
>   __m128i frag1, frag2;
>   int  cmp_s;
>   if( !p2[0]) return p1;
>   if( !p1[0] ) return NULL;
>   frag2 = load (p2); 
>   frag1 = load (p1);
>   frag2 = _mm_blendv_epi8(frag2, mask2, mask1);
>   frag1 = _mm_blendv_epi8(frag1, mask1, mask2);
>   cmp_s = _mm_cmpistrs(frag2, frag1, 0x0c);
>   if( cmp_s )
>     __asm("bsfl %[bmsk], %[len]" : [len] "=r" (len) : [bmsk] "r" (bmsk) );
>   return p1 + len;
> }
> [hjl@gnu-6 gcc]$ ./xgcc -B./ -O2 -msse4 /tmp/pr40470-3.c -S
> -fno-asynchronous-unwind-tables
> /tmp/pr40470-3.c: In function ?foo?:
> /tmp/pr40470-3.c:20:1: error: unable to find a register to spill in class
> ?SSE_FIRST_REG?
> /tmp/pr40470-3.c:20:1: error: this is the insn:
> (insn 30 87 32 4 ./include/smmintrin.h:62 (set (reg:V16QI 25 xmm4 [82])
>         (unspec:V16QI [
>                 (subreg:V16QI (reg/v:V2DI 25 xmm4 [orig:60 frag2 ] [60]) 0)
>                 (reg:V16QI 22 xmm1 [orig:64 D.8164 ] [64])
>                 (reg:V16QI 23 xmm2 [orig:63 D.8165 ] [63])
>             ] 134)) 1791 {*sse4_1_pblendvb} (expr_list:REG_DEAD (reg/v:V2DI 25
> xmm4 [orig:60 frag2 ] [60])
>         (nil)))
> /tmp/pr40470-3.c:20:1: internal compiler error: in spill_failure, at
> reload1.c:2094
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> [hjl@gnu-6 gcc]$ 

Even with my patch, GCSE removes xmm0 in those patterns and
makes it harder for IRA/reload to handle.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40470


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]