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] PR19100: truthvalue_conversion vs. TREE_OVERFLOW (take3)

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.

Mark Mitchell
CodeSourcery, LLC
(916) 791-8304

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