This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: SH: far conditional branch


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


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