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]

ICE in 920624-1.c with -O3 -funroll-loops on vax-dec-ultrix4.3


The ICE occurs in verify_flow_info when it encounters a barrier.  It appears
that case insn's are being incorrectly simplified in the cse2 pass.  This
is the rtl from loop:

(jump_insn 141 140 142 (set (pc)
        (if_then_else (leu (minus:SI (reg/v:SI 22)
                    (const_int 2 [0x2]))
                (const_int 3 [0x3]))
            (plus:SI (sign_extend:SI (mem:HI (plus:SI (mult:SI (minus:SI (reg/v:SI 22)
                                    (const_int 2 [0x2]))
                                (const_int 2 [0x2]))
                            (pc)) [0 S2 A16]))
                (label_ref:SI 142))
            (pc))) -1 (nil)
    (nil))

(code_label 142 141 143 28 "" "" [2 uses])

(jump_insn 143 142 144 (addr_diff_vec:HI (label_ref:SI 142)
        [ 
            (label_ref:SI 146)
            (label_ref:SI 146)
            (label_ref:SI 153)
            (label_ref:SI 153)
        ] 
        (const_int 0 [0x0])
        (const_int 0 [0x0])) -1 (nil)
    (nil))

After cse2, we have:

(jump_insn 141 182 178 (set (pc)
        (label_ref:SI 142)) 142 {casesi1} (nil)
    (nil))

(barrier 178 141 142)

(code_label 142 178 143 28 "" "" [2 uses])

(jump_insn 143 142 171 (addr_diff_vec:HI (label_ref:SI 142)
	[
	    (label_ref:SI 146)
	    (label_ref:SI 146)
	    (label_ref:SI 155)
	    (label_ref:SI 155)
	]
										    (const_int 0 [0x0])
											    (const_int 0 [0x0])) -1 (nil)
												(nil))

I believe reg:SI 22 contains 1 here.  A simpler example that demonstrates
the problem is:

int B,Q;
f(){int s=1;switch(s){case 2:case 3:B++;case 4:case 5:Q++;}
}

Cse is not correctly simplifying case insn's when the switch argument is
outside the range of the case statements when there is a following
addr_diff_vec.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


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