[sa]: Don't create overlap variables for unused parts of structures

Daniel Berlin dberlin@dberlin.org
Wed Dec 22 22:10:00 GMT 2004


This patch enables us to conservatively prune the overlap variables so
that they are only created for the used parts of the structure.

Rather than record a set of field_decls for each variable, i simply made
a min/max range of used portions.  This works well for most structures
where accesses in a function are close together.
As an example, before we used to create 89 ovrelap variables whenever
someone used a lang hook, and 120 whenever someone called a target hook,
which is bad :P.

For basically all of these uses, we now create 1 or 2 overlap variables
for just those used fields, since they generally only call one or two
langhooks/target functions from a given function.

Some structures (cough cough gfortran) like to access the first and last
fields (but none in the middle) of very large structures, so this
doesn't help at all.

I'm looking into other pruning methods as well, but first i'm going to
clean up the interface to getting the fake variables for a component
ref/var_decl by moving it into an annotation.

Bootstrapped and regtested on i686-pc-linux-gnu.
Installed on structure aliasing branch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: prunestructs.diff
Type: text/x-patch
Size: 7858 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20041222/2d9e0e4b/attachment.bin>


More information about the Gcc-patches mailing list