This is the mail archive of the gcc-patches@gcc.gnu.org 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] Fix PR23624 in middle-end


On Tue, 2005-08-30 at 11:58 +0200, Richard Guenther wrote:
> This patch fixes PR23624, ice-on-valid, where the C++ frontend
> presents fold with a COND_EXPR with the conditional being an
> integer, i.e.
> 
>  i ? 0 : i;
> 
> instead of
> 
>  i != 0 ? 0 : i;
> 
> it does so in case of a template function, see bugzilla for thorough
> analysis of the C++ frontend "bug".
> 
> This fix tells fold to check truth_value_p on the conditional before
> calling invert_truthvalue, as is done in most places.
> 
> Bootstrapped and regtested on x86_64-unknonw-linux-gnu.
> 
> This is surely a safe fix, maybe appropriate for 3.4 and 4.0.
> 
> Ok for mainline, 4.0, 3.4?
> 
> 
> Thanks,
> Richard.
> 
> :ADDPATCH fold:
> 
> 
> 2005-08-30  Richard Guenther  <rguenther@suse.de>
> 
> 	PR c++/23624
> 	* fold-const.c (fold_ternary): Check truth_value_p before
> 	calling invert_truthvalue.
> 
> 	* g++.dg/tree-ssa/pr23624.C: New testcase.
OK.  I've got no opinion on whether or not the associated change to
the C++ front-end is correct or not.

jeff



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