This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix tree-opt/29059, ICE with the recent builtins improvements
- From: Roger Sayle <roger at eyesopen dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Sep 2006 12:31:40 -0600 (MDT)
- Subject: Re: [PATCH] Fix tree-opt/29059, ICE with the recent builtins improvements
On Mon, 18 Sep 2006, Diego Novillo wrote:
> > This is OK for mainline. Thanks.
> >
> Not OK.
>
> Add a check for !is_gimple_val. You are pessimizing unnecessarily.
> It's perfectly alright to replace a builtin call with a MODIFY_EXPR, if
> the RHS of the MODIFY_EXPR is a gimple_val.
Not not OK!
I'm not sure you've fully thought this through, but this issue
is not merely replacing a builtin-call with a MODIFY_EXPR, but whether
it makes sense to replace the RHS of a gimple statement with a
MODIFY_EXPR. This is not valid gimple, and indeed a check for
is_gimple_val(expr) will/should always return false when passed
a MODIFY_EXPR. The problematic transformation is something like:
x = memcpy(p,q,C) => x = (p = q)
This isn't valid even if "q" is a gimple value!
> Better get the builtin folders to return valid GIMPLE.
I disagree. The ability for the middle-end to manipulate and reason
about arbitrarily deep trees (more than simple tuples) allows far more
expressive power than limiting things to the the atomic operations
allowed by GIMPLE.
Roger
--