This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR19100: truthvalue_conversion vs. TREE_OVERFLOW (take3)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 02 Jan 2005 18:52:46 -0800
- Subject: Re: [PATCH] PR19100: truthvalue_conversion vs. TREE_OVERFLOW (take3)
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.firstname.lastname@example.org>
Roger Sayle wrote:
The following patch is my third attempt at resolving PR middle-end/19100
which is a wrong code bug affecting both C and C++ on mainline. I still
believe that the correct fix is to clean-up truthvalue_conversion, however
I also agree that reducing/eliminating TREE_OVERFLOW from GCC is a good
thing, so the patch below humours Mark's request to investigate a fix in
the middle-end. [It did however require two fixes to int_fits_type_p :)]
* fold-const.c (fold_convert_const): Don't set TREE_OVERFLOW when
converting constants from one integer type to another.
Is this OK with the Ada/Java folks? It certainly makes sense to me from
a C/C++ perspective.
* c-common.c (convert_and_check): Avoid testing TREE_OVERFLOW to
detect conversion overflow, instead use int_fits_type_p.
I'll let Joseph comment on this bit, but it seems plausible to me.
Thank you for trying to hard to fix this bug.