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

Re: c/2898: Illegal function return in ARM code when compiling with -mthumb-interwork -O2


The following reply was made to PR c/2898; it has been noted by GNATS.

From: Richard Earnshaw <rearnsha@arm.com>
To: Philip Blundell <philb@gnu.org>
Cc: trauscher@loytec.com, gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org,
        Richard.Earnshaw@arm.com
Subject: Re: c/2898: Illegal function return in ARM code when compiling 
 with -mthumb-interwork -O2
Date: Wed, 23 May 2001 18:19:51 +0100

 > > >When compiling for an ARM target with -mthumb-interwork and -02 or higher 
 > > >optimization,
 > > >the compiler does not correctly return with the BX instruction but loads
 > > >the PC directly. Thus, the function cannot be called from THUMB code
 > > >safely. 
 > > 
 > > Thanks for your bug report.
 > > 
 > > I think the patch below should fix this problem (which, incidentally, is a 
 > > regression from 2.95).
 > > 
 > > p.
 > > 
 > > 2001-05-22  Philip Blundell  <philb@gnu.org>
 > > 
 > > 	* config/arm/arm.c (output_return_instruction): Correctly handle
 > > 	interworking and interrupt functions.
 > 
 > OK (both).
 > 
 > Thanks,
 > R.
 > 
 > 
 
 Doh! Wait a moment, we only want to avoid this sequence if really 
 returning -- popping to lr should be safe with a load even for the cases 
 concerned (though we should never be tail-calling out of an interrupt 
 function...).
 
 R.
 


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