Modifying GIMPLE/SSA tree to collect memory accesses

Srinivas Pasupuleti
Tue Feb 9 05:30:00 GMT 2010

I want to print for each modify statement in GIMPLE tree, the address
that data is written to (store) and the addresses from which data is
accessed (load).

I need this to build a dynamic data dependency graph based on memory
store and memory loads.

When the optimization flag is not used, I'm able to print the memory
accesses. I want to do the same with the optimization flag turned on,
but there is some consistency problems due to some GCC passes like
(dfa, ssa-alias etc).


On Mon, Feb 8, 2010 at 7:28 PM, Ian Lance Taylor <> wrote:
> Srinivas Pasupuleti <> writes:
>> I have written a GIMPLE pass to do memory profiling. Basically for
>> every GIMPLE_MODIFY_STMT, I'm including a printf statement to print
>> the reference of DEF and USE variables of the statement. I'm using GCC
>> 4.3.4
>> For e.g., if the statement in gimple is
>> D.2761 = D.2616 + 1;
>> I insert printf call in GIMPLE tree just below the above statement:
>> printf("DEF %p, USE %p\n",&D.2761, &D.2616);
> I'm not quite sure what you are doing here.  You can't take the
> address of a GIMPLE variable.  What is it that you want to print?
> Ian

More information about the Gcc-help mailing list