This is the mail archive of the gcc-patches@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]

Re: Add -fsection-anchors (4.2 project)


On Thu, 2 Feb 2006, Richard Sandiford wrote:
> This is the main part for the 4.2 section anchor project:
>
>     http://gcc.gnu.org/wiki/Section%20Anchor%20Optimisations
>
> The idea is to introduce anchor symbols that can be used to access
> several nearby objects.  For example, if we have:
>
>     static int a, b, c;
>     int foo (void) { return a + b + c; }
>
> gcc will normally perform separate symbolic address calculations for
> "a", "b" and "c".  The idea of this patch is to introduce a new anchor
> symbol and access "a", "b" and "c" relative to that anchor.

Yay, goodness!

> The main motivation is to reduce GOT size,

How can this change affect GOT sizes, *generally*?
Variables a, b, c do not need separate GOT entries when static.
Is there a wart in the ppc port?

If you actually apply this transformation for non-static
non-hidden variables too, then I think it isn't safe for
-fpic/-fPIC: non-hidden variables and functions must be
individually overridable.  A quick grep in your patch shows that
it doesn't test flag_pic.  Dunno if that's covered by other
means.

brgds, H-P


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