This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR23624 in middle-end
- From: Jeffrey A Law <law at redhat dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 08 Sep 2005 13:09:26 -0600
- Subject: Re: [PATCH] Fix PR23624 in middle-end
- References: <Pine.LNX.4.58.0508301153300.21309@wotan.suse.de>
- Reply-to: law at redhat dot com
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