Richard,

First off I did suspect INDIRECT_REF wasn't supported, thanks for
confirming that.

I tried what you said in the original code before I posted
but I suspect how I went at it is the problem. I'm probably
doing something(s) in a glaringly stupid way.

Can you spot it, because everything I'm doing makes total sense
to me?

Thanks Gary

--

Snippet from the code with MEM_REF:

  tree lhs_ref = build1 ( MEM_REF, field_type, field_addr);

  final_set = gimple_build_assign( lhs_ref, field_val_temp);

field_type is a double *

field_addr is an address within an malloced array of doubles.

--

Snippet from the code with ARRAY_REF:

  tree rhs_ref = build4 ( ARRAY_REF, field_type, field_arry_addr, index,
                          NULL_TREE, NULL_TREE);

  temp_set = gimple_build_assign( field_val_temp, rhs_ref);

field type is double

field_arry_addr is the starting address of an array of malloced doubles.

index is a pointer_rep (an integer)
  details:
    tree pointer_rep = make_node ( INTEGER_TYPE);
    TYPE_PRECISION (pointer_rep) = TYPE_PRECISION (pointer_sized_int_node);

Reply via email to