> On Jun 1, 2018, at 2:40 PM, Jakub Jelinek <ja...@redhat.com> wrote:
>
> On Fri, Jun 01, 2018 at 02:35:41PM -0400, Paul Koning wrote:
>> during RTL pass: dse2
>> dump file: unwind-dw2-fde.c.288r.dse2
>> ../../../../gcc/libgcc/unwind-dw2-fde.c: In function ‘get_cie_encoding’:
>> ../../../../gcc/libgcc/unwind-dw2-fde.c:342:1: internal compiler error: in
>> cselib_record_set, at cselib.c:2409
>> }
>> ^
>>
>> I don't understand what it's looking for or why it is unhappy.
>>
>> The RTL that blows up, as reported in the 288r.dse dump file, looks like
>> this:
>
> I'd say it is upset by multiple post_inc in the same instruction, that is I
> believe invalid.
>
>> (insn 195 194 197 11 (parallel [
>> (set (reg:CC 16 cc)
>> (compare:CC (mem:QI (post_inc:HI (reg/v/f:HI 0 r0 [orig:41 p
>> ] [41])) [0 MEM[base: p_38, offset: 65535B]+0 S1 A8])
>> (const_int 0 [0])))
>> (set (reg:QI 2 r2 [orig:38 byte.10_40 ] [38])
>> (mem:QI (post_inc:HI (reg/v/f:HI 0 r0 [orig:41 p ] [41])) [0
>> MEM[base: p_38, offset: 65535B]+0 S1 A8]))
>> ]) "../../../../gcc/libgcc/unwind-pe.h":166 20 {*mov_ccqi}
>> (expr_list:REG_UNUSED (reg:QI 2 r2 [orig:38 byte.10_40 ] [38])
>> (expr_list:REG_UNUSED (reg/v/f:HI 0 r0 [orig:41 p ] [41])
>> (expr_list:REG_INC (reg/v/f:HI 0 r0 [orig:41 p ] [41])
>> (nil)))))
I was wondering about that. compare-elim.cc is generating that. It looks for
the general pattern of
(parallel [(load dst src) (clobber cc)])
(compare dst val)
and converts that to
(parallel [ (compare src val) (load dst src)])
where there is a insn pattern of that form, such as this one:
(define_insn "*mov_cc<mode>"
[(set (reg:CC CC_REGNUM)
(compare:CC
(match_operand:PDPint 1 "general_operand" "rRN,Qi,rRN,Qi")
(const_int 0)))
(set (match_operand:PDPint 0 "nonimmediate_operand" "=rR,rR,Q,Q")
(match_dup 1))]
"reload_completed"
Given that the starting insn had a post_inc in it, what would be a proper
parallel... construct? If the post_inc only appears in one of the two mentions
of the source operatnd, then the match_dup is going to fail. I suppose I can
disallow pre and post_inc addressing modes, but that would be a lost
optimization opportunity.
paul