On Mon, Dec 2, 2024 at 6:39 AM H.J. Lu <[email protected]> wrote:
>
> On Mon, Dec 2, 2024 at 6:15 AM Jeff Law <[email protected]> wrote:
> >
> >
> >
> > On 11/27/24 3:34 PM, H.J. Lu wrote:
> > > On Thu, Nov 21, 2024, 2:02 PM H.J. Lu <[email protected]
> > > <mailto:[email protected]>> wrote:
> > >
> > > Promote integer arguments smaller than int if
> > > TARGET_PROMOTE_PROTOTYPES
> > > returns true.
> > >
> > > PR middle-end/14907
> > > * calls.c (initialize_argument_information): Promote small
> > > integer
> > > arguments if TARGET_PROMOTE_PROTOTYPES returns true.
> > This doesn't look right. Promotions are primarily driven by the target
> > files, in particular TARGET_PROMOTE_FUNCTION_MODE.
> >
> > PROMOTE_PROTOTYPES is more of a language front-end hook and it doesn't
> > seem appropriate to be testing it in calls.cc.
>
> TARGET_PROMOTE_PROTOTYPES isn't used by all frontends since
> it isn't required by the ABI. It is an option to extend the upper bits in
> the 32-bit outgoing integer slots when the argument type is smaller
> than int. Since it is for outgoing arguments, it is appropriate to do it
> when expanding the call.
TARGET_PROMOTE_FUNCTION_MODE is done after
TARGET_PROMOTE_PROTOTYPES in calls.cc:
unsignedp = TYPE_UNSIGNED (type);
arg.type = type;
arg.mode
= promote_function_mode (type, TYPE_MODE (type), &unsignedp,
fndecl ? TREE_TYPE (fndecl) : fntype, 0);
where type is promoted by TARGET_PROMOTE_PROTOTYPES if
it returns true.
>
> >
> >
> > Jeff
>
> --
> H.J.
--
H.J.