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]

[tree-ssa] field names


This is a question related to the GIMPLE format.

In gimplifying, expressions that take the addres of a structure field are
turned into an offset expression.
The name of the field seems to get lost in this. E.g. when the following
program is gimplified

int main(void)
{    struct {
        int m;
        int n;
        } s;

    int *p = &s.n;
}

then the assignment becomes something like

    p = s + 4

At least that is what is shown in the .t00.tu and .t03.generic files
produced by -fdump-tree-all.

Is there a simple way (without essentially reversing the offset calculation)
to recover the info that
the n field was selected?

In "closer-to-the-source" analyses that GIMPLE is supposed to enable, such
info may not be
discarded, I would think. The offset 4 is platform dependent and seems out
of place in an
intermediate language at the level of GIMPLE.

--dennis (pls. cc replies to dennis@research.bell-labs.com)


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