This is the mail archive of the gcc@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]

Re: how to force reloader(?) to respect clobber directive?


Thanks Richard,
"+r" did not help much.

Actually, I transform a condition code of the insn followed by.
So, for the code given:

long foo(long a, long b)
{
        if(a>0) goto ee;
        return a;
ee:
        return b;
}

gcc wants to use LE condition code. Whithin tstsi operation I'm setting cond code for the next insn to LT.

Then I get: ('a' being passed in r14,r15, 'b' - in r12,r13; returns in r14,r15)
----------------
aa:
/* prologue: frame size = 0 */
.L__FrameSize_aa=0x0
/* prologue end (size=0) */
/* UID:11 ** ADDR:0 ** COST:16 *
(insn:QI 11 34 12 (parallel[ 
            (set (cc0)
                (reg/v:SI 14 r14 [22]))
            (clobber (reg/v:SI 14 r14 [22]))
        ] ) 19 {tstsi} (insn_list 4 (nil))
    (expr_list:REG_DEAD (reg/v:SI 14 r14 [22])
        (nil)))
*****************/
        sub     #1, r14  ;  11  tstsi   [length = 2]
        subc    #0, r15
/* UID:12 ** ADDR:2 ** COST:26 *
(jump_insn 12 11 22 (set (pc)
        (if_then_else (lt (cc0)
                (const_int 0 [0x0]))
            (label_ref 32)
            (pc))) 132 {blt} (nil)
    (expr_list:REG_BR_PROB (const_int 3999 [0xf9f])
        (nil)))
*****************/
        jl      .L1     ;       .L1      ;  12  blt     [length = 2]
.L3:
/* UID:26 ** ADDR:4 ** COST:4 *
(insn 26 35 32 (set (reg/i:SI 14 r14)
        (reg/v:SI 12 r12 [23])) 48 {*movsi3} (nil)
    (expr_list:REG_DEAD (reg/v:SI 12 r12 [23])
        (nil)))
*****************/
        mov     r12, r14         ;  26  *movsi3 [length = 2]
        mov     r13, r15
.L1:
/* epilogue: frame size=0 */
        ret
/* epilogue end (size=1) */
/* function aa size 7 (6) */
.Lfe1:
        .size   aa,.Lfe1-aa

----------------

So, as follows from the RTL dump reg:SI 14 dead, but gcc uses it as return operand.

Did I miss something here?



On Tue, 26 Feb 2002 09:44:56 -0800
Richard Henderson <rth@redhat.com> wrote:

> On Tue, Feb 26, 2002 at 12:13:43PM +0300, Dmitry wrote:
> > (define_insn "tstsi"
> >   [(set (cc0) (match_operand:SI 0 "register_operand" "r"))
> >         (clobber (match_dup 0))]
> 
> The constraint must be "+r" in this case.
> 
> 
> r~
> 


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