This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] avoid calling convert from convert_and_check
- From: "Rafael EspÃndola" <rafael dot espindola at gmail dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 6 Apr 2006 14:40:48 -0300
- Subject: [patch] avoid calling convert from convert_and_check
:ADDPATCH front end:
The attached patch adds the converted exp as a new argument to
convert_and_check and calls fold_convert instead of convert in
constant_fits_type_p.
The patch also adds a special treatment for REAL_CSTs in
constant_fits_type_p. This is necessary because fold_convert doesn't
handle real to integer conversions.
If desired, I can split this patch in 3. Special treatment for
REAL_CST, use fold_convert, and additional parameter to
convert_and_check.
Bootstraped and regtested on a x86.
Special thanks for Roger Sayle for proposing the additional argument
and for pointing out that the real to integer conversion is
intentionally undefined in fold_convert.
Rafael
2006-02-20 Rafael Ãvila de EspÃndola <rafael.espindola@gmail.com>
* gcc/cp/typeck.c (build_ptrmemfunc1): Add the converted exp
as the third argument of convert_and check.
* gcc/cp/call.c (convert_like_real): Add the converted exp
as the third argument of convert_and check.
* gcc/c-typeck.c (build_conditional_expr): Add the converted
exp as the third argument of convert_and check.
* gcc/c-common.c (convert_and_check): Don't call convert.
Add the converted exp as the third argument of convert_and check.
(c_add_case_label): Add the converted exp as the third
argument of convert_and check.
* gcc/c-common.h (convert_and_check): Change the signature
to match c-common.c