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]

Re: [PING] Fix PR46399 - missing mode promotion for libcall args


Andreas Krebbel <krebbel@linux.vnet.ibm.com> writes:

> On 04/13/2011 03:31 PM, Ian Lance Taylor wrote:
>> "Andreas Krebbel" <krebbel@linux.vnet.ibm.com> writes:
>> 
>>> This fixes a wrong code generation bug for sw DFP:
>>>
>>> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00141.html
>> 
>> Why do we need a new target hook just for libcalls?  Why not just use
>> the existing TARGET_PROMOTE_FUNCTION_MODE hook?  We could say that for a
>> libcall functype is passed as NULL.  Only the SH cares about the
>> function type at all, and it is already prepared to handle NULL.
>
> But in order to preserve current behaviour all targets defining the hook then would have
> to be modified not to do any promotions if funtype is NULL.  As I understand it a target
> usually does not want the normal promotions for libcalls since libcalls follow their own ABI.

In the good old days libcalls followed their own ABI, but that is no
longer really true.  E.g., you are talking about functions in
libdecnumber, which are written in C, and follow the ordinary C ABI.  In
general gcc has been moving away from libcall-specific code and moving
toward treating libcalls and ordinary functions the same.

If there are cases where promoting is different between ordinary
libcalls and functions, those cases are most likely bugs.  The only
cases where it would not be a bug would be targets which provide libgcc
functions written in assembler.  So look at those to see if any
behaviour would change.

Ian


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