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

return pattern


Hi folks,

I got a problem with a 'return' pattern.

So, I define 

(define_insn "return"
  [(return)]
  "reload_completed && msp430_empty_epilogue()"
  "*
{
  if(msp430_empty_epilogue()==1) return \"ret\";
  if(msp430_empty_epilogue()==2) return \"ret\";
  return \"ret\";	/* just in case */
}"
  [(set_attr "length" "1")
   (set_attr "cc" "clobber")])

Which works fine for complex routines.

But for the code given:
int dd( int a)
{
        return a+2;
}

gcc does not want to issue a return command at the end of file.

Even more - if a function does not have any jump insn, gcc does not want to issue return command.

In function's epilogue I check if the epilogue is empty and if it is I obviously do not issue 'ret' insn. 

Did I miss something?
I'm playing with gcc-20020902.


Thanks,
Dmitry.



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