This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/43129] Simplify global variable's address loading with option -fpic
- From: "carrot at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Mar 2010 06:23:57 -0000
- Subject: [Bug target/43129] Simplify global variable's address loading with option -fpic
- References: <bug-43129-17659@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from carrot at google dot com 2010-03-16 06:23 -------
This optimization uses one less register (the register hold the GOT base), to
get this beneficial the ideal place for it should be before register
allocation.
Usually expand pass generates instructions to load global variable's address
from GOT entry for each access of the global variable. Later cse/gcse passes
can remove many of them. In order to precisely model the cost, this
optimization should be put after some cse/gcse passes.
So what is the best place for this optimization? Is there any existed pass can
be enhanced with this optimization? Or should I add a new pass?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43129