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]

-O0 dead code


So how do people feel about the notion of dead code elimination at -O0?
If we exclude the bits that that detect dead stores, we shouldn't be
affecting any user-visible state, since all user variables live in
memory at -O0.

It shouldn't (though I've not checked) take any more compile time than
we're using now, since flow1 is used to collect lifetimes for register
allocation.  Normal dead code elimination happens concurrent to that.

I'm asking because on IA-64 I'm seeing lots of gunk like

        adds r16 = -16, r36 ;;		**
        mov r14 = r16 ;;		**
        mov r14 = r36 ;;
        st8 [r14] = r15
        adds r15 = -16, r36 ;;		**
        mov r14 = r15			**
        adds r15 = 8, r36
        adds r16 = -16, r36 ;;		**
        mov r14 = r16 ;;		**
        mov r14 = r36 ;;
        ld8 r14 = [r14] ;;

In this sequence 6 of 11 insns are dead.  It's all
leftover address arithmetic from I don't know where.

Thoughts?


r~

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