This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR24227, fold_binary type-mismatch
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 7 Oct 2005 09:01:44 -0600 (MDT)
- Subject: Re: [PATCH] Fix PR24227, fold_binary type-mismatch
On Fri, 7 Oct 2005, Richard Guenther wrote:
> It's coming directly from the C frontend this way. The C frontend
> builds that compound expression in
>
> c-typeck.c:build_compound_expr
>
> return build2 (COMPOUND_EXPR, TREE_TYPE (expr2), expr1, expr2);
>
> I don't know if the C frontend is supposed to use the middle-end
> fold here. If yes, I can prepare a patch for this.
That's for the C front-end folks to decide. The problem can
either be fixed early in build_compound_expr, or handled later
when the C front-end lowers COMPOUND_EXPR into generic/gimple
(which allows the front-end to maitain non-folded non-canonical
non-gimple trees whilst parsing). The important thing is that
this type of expression probably shouldn't have survived all
of the way until VRP.
Thanks again for investgating/resolving this.
Roger
--