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 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
--


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