Hello, 
I experienced an ICE for no-scevccp-outer-16.c in our port. It seems not in 
other ports so I couldn't file a bug report. 

Baiscally, the problem appears after the following transformations in 
expand_compound_operation (combine.c). 

Enter expand_compound_operation 
x:
(zero_extend:SI (subreg:HI (plus:V4HI (reg:V4HI 143 [ vect_var_.65 ])
            (reg:V4HI 142 [ vect_var_.65 ])) 0))
            
tem = gen_lowpart (mode, XEXP (x, 0));
tem = (subreg:SI (plus:V4HI (reg:V4HI 143 [ vect_var_.65 ])
        (reg:V4HI 142 [ vect_var_.65 ])) 0)
                        
tem = simplify_shift_const (NULL_RTX, ASHIFT, mode,
                                  tem, modewidth - pos - len);
tem = (subreg:SI (ashift:V4HI (plus:V4HI (reg:V4HI 143 [ vect_var_.65 ])
            (reg:V4HI 142 [ vect_var_.65 ]))
        (const_int 16 [0x10])) 0)                       
        
tem = simplify_shift_const (NULL_RTX, unsignedp ? LSHIFTRT : ASHIFTRT,
                                  mode, tem, modewidth - len);
        
/projects/firepath/tools/work/bmei/gcc-head/src/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-16.c:
 In function 'main':
/projects/firepath/tools/work/bmei/gcc-head/src/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-16.c:59:1:
 internal compiler error: in trunc_int_for_mode, at explow.c:56
Please submit a full bug report,        

#0  internal_error (gmsgid=0xe9aa77 "in %s, at %s:%d") at 
../../src/gcc/diagnostic.c:707
#1  0x00000000005acf23 in fancy_abort (file=0xea8453 "../../src/gcc/explow.c", 
line=56, function=0xea8440 "trunc_int_for_mode") at 
../../src/gcc/diagnostic.c:763
#2  0x000000000060528b in trunc_int_for_mode (c=65535, mode=V4HImode) at 
../../src/gcc/explow.c:56
#3  0x00000000005edf24 in gen_int_mode (c=65535, mode=V4HImode) at 
../../src/gcc/emit-rtl.c:459
#4  0x0000000000cf22d9 in simplify_and_const_int (x=0x0, mode=V4HImode, 
varop=0x2a957a8420, constop=65535) at ../../src/gcc/combine.c:9038
#5  0x0000000000cf462f in simplify_shift_const_1 (code=LSHIFTRT, 
result_mode=SImode, varop=0x2a957a0600, orig_count=16) at 
../../src/gcc/combine.c:10073
#6  0x0000000000cf47cf in simplify_shift_const (x=0x0, code=LSHIFTRT, 
result_mode=SImode, varop=0x2a957a8408, count=16) at 
../../src/gcc/combine.c:10122
#7  0x0000000000cebbf9 in expand_compound_operation (x=0x2a95789c20) at 
../../src/gcc/combine.c:6517
#8  0x0000000000ce8afe in combine_simplify_rtx (x=0x2a95789c20, 
op0_mode=HImode, in_dest=0) at ../../src/gcc/combine.c:5535
#9  0x0000000000ce6da5 in subst (x=0x2a95789c20, from=0x2a95781ba0, 
to=0x2a957a83a8, in_dest=0, unique_copy=0) at ../../src/gcc/combine.c:4884
#10 0x0000000000ce6b53 in subst (x=0x2a957a0660, from=0x2a95781ba0, 
to=0x2a957a83a8, in_dest=0, unique_copy=0) at ../../src/gcc/combine.c:4812
#11 0x0000000000ce13ed in try_combine (i3=0x2a957a1678, i2=0x2a957a1630, 
i1=0x0, new_direct_jump_p=0x7fbfffeafc) at ../../src/gcc/combine.c:2963
...


It seems to me that both the gen_lowpart and simplify_shift_const do the wrong 
things in handling vector type. (zero_extend:SI (subreg:HI (V4HI)) is not equal 
to (subreg:SI (V4HI)), is it?  simplify_shift_const produces (ashift:V4HI 
(V4HI..) (16), which is not right either. Does shifting of a vector with a 
const value mean shifting every element of vector or treat the vector as an 
entity? Internal manual is not very clear about that. 


Thanks,
Bingfeng Mei

Reply via email to