This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] middle-end & C-frontend: fix PR middle-end/32668
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, joseph at codesourcery dot com
- Date: Sun, 8 Jul 2007 21:07:18 +0200
- Subject: Re: [PATCH] middle-end & C-frontend: fix PR middle-end/32668
- References: <Pine.GSO.firstname.lastname@example.org>
On 7/8/07, Kaveh R. GHAZI <email@example.com> 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: http://gcc.gnu.org/ml/gcc/2007-07/msg00221.html
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):
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 <firstname.lastname@example.org>
* builtin-attrs.def (ATTR_TYPEGENERIC,
* builtins.def (BUILT_IN_ISINF, BUILT_IN_ISNAN,
BUILT_IN_ISGREATER, BUILT_IN_ISGREATEREQUAL, BUILT_IN_ISLESS,
BUILT_IN_ISUNORDERED): Use ATTR_CONST_NOTHROW_TYPEGENERIC.
* c-common.c (handle_type_generic_attribute): New.
(c_common_attribute_table): Add "type generic".
* c-typeck.c (convert_arguments): Handle "type generic" functions.