This is the mail archive of the gcc-patches@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]

RFA: IQ2000: Generate a return insn as a branch


Hi Stan,

  Please can I apply the following patch to the iq2000 backend for GCC
  ?  It fixes a problem in iq2000_expand_epilogue() where the return
  insn was being generated via an emit_insn() call rather than an
  emit_jump_insn().

  I discovered this problem when I noticed that gcc was mis-compiling
  libgloss/iq2000/trap.c.  The post-reload scheduler was moving the
  return insn in the __trap0() function to the start of the code,
  before all of the "asm volatile..." statements!  With this patch
  applied this no longer happens.

Cheers
  Nick

2004-10-28  Nick Clifton  <nickc@redhat.com>

	* config/iq2000/iq2000.c (iq2000_expand_epilogue): Use
	emit_jump_insn() to generate the return instruction.

Index: gcc/config/iq2000/iq2000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/iq2000/iq2000.c,v
retrieving revision 1.28
diff -c -3 -p -r1.28 iq2000.c
*** gcc/config/iq2000/iq2000.c	18 Sep 2004 19:19:35 -0000	1.28
--- gcc/config/iq2000/iq2000.c	28 Oct 2004 12:50:02 -0000
*************** iq2000_expand_epilogue (void)
*** 2297,2303 ****
  
    if (iq2000_can_use_return_insn ())
      {
!       emit_insn (gen_return ());
        return;
      }
  
--- 2297,2303 ----
  
    if (iq2000_can_use_return_insn ())
      {
!       emit_jump_insn (gen_return ());
        return;
      }
  


  


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