This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch RFC] SH: PR target/22553
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Cc: gcc-patches at gcc dot gnu dot org, aoliva at redhat dot com
- Date: Mon, 26 Sep 2005 22:52:50 +0100
- Subject: Re: [patch RFC] SH: PR target/22553
- References: <20050925.095236.38689803.kkojima@rr.iij4u.or.jp>
Kaz Kojima wrote:
Hi,
It seems that target/22553 is one of the 4.1 regressions which
is critial for sh4-*-linux-gnu. It causes the build failure
during libstdc++ build on some systems, though my nightly builds
on this target couldn't catch it because I'm using slightly
different libc headers with those of the reporter of that PR.
The reduced testcase in #2 of the audit trail of the PR fails
even with the 4.0 compiler.
Taking a look at it, it seems to be the problem of the first
scheduling pass in PIC case
:REVIEWMAIL:
No. With mainline, I see a return value copy torn away from a function
call.
The first step happens very early, more or less during rtl generation:
because the call might trap, it ends a basic block, and the return value
copy is being put in at the start of the following block.
(call_insn 52 49 66 8 (parallel [
(set (reg:SI 0 r0)
(call (mem:SI (symbol_ref:SI ("_Z3foov") [flags 0x41]
<function_decl 0xb5950400 foo>) [0 S4 A32])
(const_int 0 [0x0])))
(use (reg:PSI 151 ))
(use (reg:SI 12 r12))
(clobber (reg:SI 146 pr))
(clobber (scratch:SI))
]) 229 {call_value_pcrel} (nil)
(expr_list:REG_EH_REGION (const_int 1 [0x1])
(nil))
(nil))
(note 66 52 53 9 [bb 9] NOTE_INSN_BASIC_BLOCK)
(insn 53 66 54 9 (set (reg/v:SI 159 [ j ])
(reg:SI 0 r0)) 172 {movsi_ie} (nil)
(nil))
(jump_insn 54 53 55 9 (set (pc)
(label_ref 11)) 218 {jump_compact} (nil)
(nil))
(barrier 55 54 58)
(note 58 55 63 NOTE_INSN_FUNCTION_END)
The second step happens during try_optimize_cfg, called from cleanup_cfg,
called from rest_of_handle_jump2. The return value copy ends up far in
front
of the call, near the start of the function.
(barrier 10 9 84)
(code_label 84 10 66 9 28 "" [1 uses])
(note 66 84 53 9 [bb 9] NOTE_INSN_BASIC_BLOCK)
(insn 53 66 15 9 (set (reg/v:SI 159 [ j ])
(reg:SI 0 r0)) 172 {movsi_ie} (nil)
(nil))
(insn 15 53 16 9 (set (reg/f:SI 164)
(const:SI (unspec [
(symbol_ref:SI ("k") <var_decl 0xb58bd1b8 k>)
] 7))) 172 {movsi_ie} (nil)
(nil))
.... lots of blocks...
(call_insn 52 49 83 8 (parallel [
(set (reg:SI 0 r0)
(call (mem:SI (symbol_ref:SI ("_Z3foov") [flags 0x41]
<function_decl 0xb5950400 foo>) [0 S4 A32])
(const_int 0 [0x0])))
(use (reg:PSI 151 ))
(use (reg:SI 12 r12))
(clobber (reg:SI 146 pr))
(clobber (scratch:SI))
]) 229 {call_value_pcrel} (nil)
(expr_list:REG_EH_REGION (const_int 1 [0x1])
(nil))
(nil))
(note 83 52 85 11 [bb 11] NOTE_INSN_BASIC_BLOCK)
(jump_insn 85 83 86 11 (set (pc)
(label_ref 84)) -1 (nil)
(nil))
(barrier 86 85 58)
(note 58 86 63 NOTE_INSN_FUNCTION_END)
(code_label 63 58 68 10 25 "" [2 uses])
(note 68 63 0 10 [bb 10] NOTE_INSN_BASIC_BLOCK)