SRA argument after materialization

Erick Ochoa erick.ochoa@theobroma-systems.com
Fri Jul 10 12:29:54 GMT 2020


Hello,

is there a way to determine just how an argument is affected by SRA 
after SRA has occured? I have the following functions:

source:

_Bool
returnLastField (struct arc anArc)
{
   return anArc.c;
}

_Bool
returnNextField (struct arc anArc)
{
   _Bool *ptr = &(anArc.a);
   ptr = ptr + 1; // accesses anArc.b
   return *ptr;
}


I normally determine field accesses by looking at both COMPONENT_REF and 
MEM_REFs...

Without SRA:

returnLastField (struct arc anArc)
{
   <bb 2> [count: 1]:
   _2 = anArc.c;
   return _2;

}


returnNextField (struct arc anArc)
{
   <bb 2> [count: 1]:
   _2 = MEM[(_Bool *)&anArc + 1B]; // accesses anArc.b
   return _2;

}


However, SRA obfuscates this.

With SRA:

returnLastField.isra (_Bool ISRA.0)
{
   struct arc anArc;
   struct arc anArc;

   <bb 3> [count: 1]:

   <bb 2> [count: 1]:
   _1 = ISRA.0_2(D);
   return _1;

}

returnNextField.isra (_Bool ISRA.1)
{
   struct arc anArc;
   struct arc anArc;

   <bb 3> [count: 1]:

   <bb 2> [count: 1]:
   _1 = ISRA.1_2(D);
   return _1;

}


How would I be able to determine the effects of ISRA on the struct argument?

Thanks!


More information about the Gcc mailing list