This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: SH: far conditional branch
- From: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: joern dot rennecke at superh dot com, aoliva at redhat dot com, gniibe at m17n dot org, aph at cambridge dot redhat dot com
- Date: Fri, 28 Jun 2002 19:59:22 +0900
- Subject: Re: SH: far conditional branch
- References: <3D1C3398.3D9ECE8B@superh.com>
Joern Rennecke <joern.rennecke@superh.com> wrote:
>kaz Kojima wrote:
>> It seems that the appended parts of .mach and .dbr dump files
>> show what is going in this case. After the machine dependant
>> reorg phase, there are no "far" conditional branches, but
>> the dbr optimization makes them: dbr optimization deforms
>>
>> conditional_branch Lnear
>> branch Lfar0
>> Lnear: branch Lfar1
>>
>> to
>>
>> conditional_branch Lfar1
>> branch Lfar0
>>
>> where Lfar? are out of the medium (+-4096) range relative to pc.
>
> Why isn't this transformation prevented by MD_CAN_REDIRECT_BRANCH ?
gdb backtrace shows that it's done by relax_delay_slots:
if (target_label)
{
/* If this jump goes to another unconditional jump, thread it, but
don't convert a jump into a RETURN here. */
trial = follow_jumps (target_label);
/* We use next_real_insn instead of next_active_insn, so that
the special USE insns emitted by reorg won't be ignored.
If they are ignored, then they will get deleted if target_label
is now unreachable, and that would cause mark_target_live_regs
to fail. */
trial = prev_label (next_real_insn (trial));
if (trial == 0 && target_label != 0)
trial = find_end_label ();
if (trial != target_label
&& redirect_with_delay_slots_safe_p (delay_insn, trial, insn))
{
reorg_redirect_jump (delay_insn, trial);
target_label = trial;
}
without checking by MD_CAN_REDIRECT_BRANCH.
kaz