This is the mail archive of the 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: [PATCH] middle-end & C-frontend: fix PR middle-end/32668

On 7/8/07, Kaveh R. GHAZI <> wrote:
This patch addresses PR middle-end/32668, which is a problem with
type-generic builtins.  Because they are implemented with variadic
prototypes, these builtins promote float to double which can either cause
pessimization and/or incorrect code generated from the middle-end.

My solution (suggested by Joseph) was to create a new internal-only
attribute to mark variadic builtins as "type generic" which notifies GCC
not to do the default C promotions for these calls.  This was discussed in
this thread:

I didn't document the builtin because the only other internal-only builtin
"no vops" wasn't document either AFAICT.  I could be convinced to document
"type generic" if necessary, but I don't want to confuse users who can't
use it anyway.

Although we normally test patches in isolation, this patch needs my other
recent work to really get exercised.  So I combined this patch with the
other stuff I have submitted to make use of these type-generic builtins.
It was bootstrapped along with these patches (with some minor conflicts
resolved in builtins.def):




Check/test subnormals:

Add more testcases (& temporarily fix solaris fixincludes):

Remove solaris fixincludes hacks, rely only on builtins:

Bootstrap and regtest passed. This can go in either before or after any of the above patches. It's only when they're all combined that you notice the need for it in the isnormal builtin which gets more rigorously checked through my extra testcases.

Okay for mainline?

The middle-end parts of this patch are ok. The C frontend parts need approval from a C frontend maintainer.


2007-07-07 Kaveh R. Ghazi <>

PR middle-end/32668

        * builtin-attrs.def (ATTR_TYPEGENERIC,

        * builtins.def (BUILT_IN_ISINF, BUILT_IN_ISNAN,

        * c-common.c (handle_type_generic_attribute): New.
        (c_common_attribute_table): Add "type generic".

* c-typeck.c (convert_arguments): Handle "type generic" functions.

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