[PATCH] Fix PR23624 in middle-end
Jeffrey A Law
law@redhat.com
Thu Sep 8 19:09:00 GMT 2005
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
More information about the Gcc-patches
mailing list