This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tuples] gimple_assign_subcode for GIMPLE_SINGLE_RHS
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Zdenek Dvorak" <rakdver at kam dot mff dot cuni dot cz>
- Cc: gcc at gcc dot gnu dot org, dnovillo at google dot com, aldyh at redhat dot com
- Date: Sun, 9 Mar 2008 14:15:48 +0100
- Subject: Re: [tuples] gimple_assign_subcode for GIMPLE_SINGLE_RHS
- References: <20080309002946.GA22003@kam.mff.cuni.cz>
On Sun, Mar 9, 2008 at 1:29 AM, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> Hi,
>
> I just noticed an error in a part of the code that I converted, that
> looks this way:
>
> switch (gimple_assign_subcode (stmt))
> {
> case SSA_NAME:
> handle_ssa_name ();
> break;
>
> case PLUS_EXPR:
> handle_plus ();
> break;
>
> default:
> something ();
> }
>
> The problem of course is that for GIMPLE_SINGLE_RHS, we do not maintain
> the invariant that
>
> gimple_assign_subcode (stmt) == TREE_CODE (gimple_assign_rhs1 (stmt)),
>
> so gimple_assign_subcode typically will not be SSA_NAME, but VAR_DECL.
> Enforcing this invariant might be hard and probably asking for more
> trouble than it is worth. However, perhaps it would make sense
> to use some special tree code to indicate GIMPLE_SINGLE_RHS, in order
> to avoid confusion?
What is GIMPLE_SINGLE_RHS after all?
Thanks,
Richard.