public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* TMSC320C6x port: return label is being deleted
@ 2004-09-14 17:24 Adrian Strätling
  2004-09-14 18:50 ` Graham Stott
  0 siblings, 1 reply; 8+ messages in thread
From: Adrian Strätling @ 2004-09-14 17:24 UTC (permalink / raw)
  To: gcc

Hi all,

I'm currently trying to optimize a gcc port for the TI TMS320C6x chips. 
My predecessor in this task built a port for gcc 3.3. I updated it to 
the 3.5 version to benefit from general development.

Now I have the following problem:

This architecture does not have a specific call instruction, so we had 
to produce the following code:

"
push    ret_label
move   b_label, breg
branch   breg

ret_label:
    ...
"

so the callee can pop the return address from the stack and jump there.
In gcc version 3.3 after jump optimization 'ret_label' is present as a 
CODE_LABEL_DELETED_INSN,
but in version 3.5 I can't find it

3.3:
"
(insn 19 17 20 0 0x4021bf78 (set:SI (reg/f:SI 0 a0 [72])
        (label_ref:SI [23 deleted])) 0 {movsi} (nil)
    (insn_list:REG_LABEL 23 (nil)))

(insn 20 19 21 0 0x4021bf78 (set:SI (reg/f:SI 47 b15)
        (plus:SI (reg/f:SI 47 b15)
            (const_int -4 [0xfffffffc]))) 5 {*addsi3_prologue} (nil)
    (nil))

(insn 21 20 48 0 0x4021bf78 (set:SI (mem:SI (reg/f:SI 47 b15) [0 S4 A32])
        (reg/f:SI 0 a0 [72])) 0 {movsi} (nil)
    (nil))

(insn 48 21 22 0 (nil) (set (reg:SI 0 a0)
        (symbol_ref:SI ("nop"))) 0 {movsi} (nil)
    (nil))

(call_insn 22 48 23 0 0x4021bf78 (call (mem:QI (reg:SI 0 a0) [0 S1 A8])
        (const_int 0 [0x0])) 3 {*call_internal} (nil)
    (expr_list:REG_EH_REGION (const_int 0 [0x0])
        (nil))
    (nil))

(note 23 22 27 0 "" NOTE_INSN_DELETED_LABEL 5)
"

3.5
"
(insn 41 15 17 1 (set (reg:SI 36 b4)
        (label_ref:SI 19)) 2 {*movsi_big} (nil)
    (nil))

(insn 17 41 42 1 (set (mem:SI (pre_dec:SI (reg/f:SI 47 b15)) [0 S4 A32])
        (reg:SI 36 b4)) 3 {movsi} (nil)
    (insn_list:REG_LABEL 19 (nil)))

(insn 42 17 18 1 (set (reg:SI 36 b4)
        (symbol_ref:SI ("nop") [flags 0x3] <function_decl 0x402965e4 
nop>)) 2 {*movsi_big} (nil)
    (nil))

(call_insn 18 42 21 1 (call (mem:QI (reg:SI 36 b4) [0 S1 A8])
        (const_int 0 [0x0])) 6 {*call_internal} (nil)
    (expr_list:REG_EH_REGION (const_int 0 [0x0])
        (nil))
    (nil))
"

The differences in 'push' are the result of other changes. I don't think 
they matter here.

I have been able to avoid the deletion of the label by changing:
"emit_label (ret_label);"
into
"LABEL_PRESERVE_P( emit_label (ret_label) ) = 1;"
but on the one hand I don't think that's the way it has been meant (no 
one else does so) and on the other it only works without optimization. 
The scheduler would move the label next to the function label. I guess 
it handles it not as a code_label but as a note when it does so.

Does anyone know a solution to this?

Thanks in advance,

greets,
Adrian Strätling

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-10-08 13:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-14 17:24 TMSC320C6x port: return label is being deleted Adrian Strätling
2004-09-14 18:50 ` Graham Stott
2004-09-16 18:03   ` Adrian Strätling
2004-09-16 18:30     ` Graham Stott
2004-09-18 21:21       ` Adrian Strätling
2004-10-04 13:37       ` Nick Ing-Simmons
2004-10-04 16:31         ` Adrian Strätling
2004-10-08 13:56           ` Nick Ing-Simmons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).