This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
return pattern
- From: Dmitry <diwil at eis dot ru>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 12 Sep 2002 18:24:43 +0400
- Subject: return pattern
- Organization: eis.ru
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.