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]

Re: Problem with operand handling


On Tue, 2004-09-07 at 08:41, Richard Kenner wrote:
>     The only time &var is used as a pointer is if the variable passes the
>     test 'is_gimple_reg()'.  Only real operands store this pointer value. 
>     If var is a virtual SSA_NAME operand, then we store *var into a tree and
>     keep that value around.
> 
> I think this is pre-ssa-conversion, so it's still a VAR_DECL.  I didn't
> see any code to do that copying.
> 

The is_gimple-ness isnt related to SSA. I should have phrased better.  

We cannot mix virtual and real operands. That is simply not allowed. The
only time the address of the thing being pointed to used is if the
variable passes the is_gimple_reg() test.  The rest of the time *var is
used:
The first stmt in add_stmt_operands is 
  var = *var_p;
and the is_real_op is set based on the return value of is_gimple_reg\().

The only place we actually store these values is through the append_*()
routines. append_def and append_use iare called with var_p,. and all the
others (append_vuse, append_v_may_def, append_v_must_def) are called
either with the derefeernced value 'var', or with a varray_tree item
from the alias list.




>     So this should only be causing you a problem if you have an
>     is_gimple_reg() which is being passed to add_stmt_operand in this
>     manner. The thats a bug.
> 
> It was happening via a TMT "variable".

These are alias variables and should never pass the is_gimple_test, so
we ought not be doing anything with the address being passed into
add_stmt_operand, the entire function should be dealing with just the
'var' aspect of whats being passed in.

is_gimple_reg checks:

 return (is_gimple_variable (t)
          && is_gimple_reg_type (TREE_TYPE (t))
          /* A volatile decl is not acceptable because we can't reuse it as
             needed.  We need to copy it into a temp first.  */
          && ! TREE_THIS_VOLATILE (t)
          && ! needs_to_live_in_memory (t));


Does your variable pass this causing it to be a gimple_reg?  Perhaps a
flag is set incorrectly or something?


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