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 is_gimple_tmp_var


>    > I'm really not convinced we need the bit.  I suspect
>    >   DECL_ARTIFICIAL && TREE_READONLY
>    > will do the trick.
>
>    TREE_READONLY?  Not all temps are readonly.
>
>No, but the only ones that can safely be used as the LHS of a trapping
>insn are.  And that's the issue here.

Sorry.  Few of the gimple temps have TREE_READONLY when they're created.
Presumably this matters to internals of the gimplifier.  

>From gimplify.c:
create_tmp_var_raw (tree type, const char *prefix)
{
...
  /* Make the variable writable.  */
  TREE_READONLY (tmp_var) = 0;
...
}

Only those created through certain paths which set TREE_READONLY do.
So this would lose by misidentifying some gimple_tmp_vars as user
variables (without SSA_NAMEs), with unpredictable consequences.

-- 
This space intentionally left blank.


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