This is the mail archive of the gcc@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]

[tuples] gimple_assign_subcode for GIMPLE_SINGLE_RHS


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?

Zdenek


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