This is the mail archive of the 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: Use -fno-if-conversion for gcc.dg/debug/debug-[12].c on MIPS targets

On Sat, Oct 07, 2006 at 10:24:37AM +0100, Richard Sandiford wrote:
> +/* On MIPS targets that support conditional moves, the optimal
> +   implementation of this function is:
> +
> +	l[wd] tmp,p
> +	li $2,2
> +	jr $31
> +	movz $2,$0,tmp
> +
> +   After if-conversion, we have a conditional move into a pseudo P
> +   followed a copy of P into the return register ($2).  P is associated
> +   with xyzzy, so if-conversion is behaving as expected, and has not lost
> +   the variable association.  The destination of the second instruction
> +   is associated with the function return value.  Combine then combines
> +   these two instructions, removing the last use of P and xyzzy.
> +
> +   Everything is behaving as expected in this scenario, so we avoid
> +   using conditional moves for this test.  */

Don't you think it would be at least nice if we could report that xyzzy
lived in $2 for a while?  Wishing aside, I think your patch is at odds
with the comment saying what the test is checking.

/* Verify that the scheduler does not discard the lexical block.  */

Here's GCC's implementation of the function on ARM, which passes the
test somewhat unsatisfactorily:

        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        @ basic block 2
        ldr     r3, .L6
        @ lr needed for prologue
        ldr     r0, [r3, #0]
        cmp     r0, #0
        movne   r0, #2
        moveq   r0, #0
        bx      lr

 <2><93>: Abbrev Number: 3 (DW_TAG_lexical_block)
     DW_AT_ranges      : 0
 <3><98>: Abbrev Number: 4 (DW_TAG_variable)
     DW_AT_name        : (indirect string, offset: 0x0): xyzzy  
     DW_AT_decl_file   : 1      
     DW_AT_decl_line   : 11     
     DW_AT_type        : <a5>   

Notice, there's no location.  But we haven't discarded the enclosing
lexical block, so we output the types of locals even if we don't know
where they are.  

ARM is exactly the same as what you describe; xyzzy is still present
before combine and gone after, but we still output the variable.

Daniel Jacobowitz

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