This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/42574] [4.3/4.4/4.5/4.6 Regression] Address of global variable is calculated multiple times (missed CSE)
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Apr 2010 20:49:55 -0000
- Subject: [Bug middle-end/42574] [4.3/4.4/4.5/4.6 Regression] Address of global variable is calculated multiple times (missed CSE)
- References: <bug-42574-17572@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from steven at gcc dot gnu dot org 2010-04-14 20:49 -------
Created an attachment (id=20379)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20379&action=view)
Classic GCSE, resurrected (with some improvements)
Updated patch for trunk r158281.
Bootstrapped and tested on ia64-unknown-linux-gnu (with this new old pass
enabled at -O2 or higher with an incremental patch).
Also tested the effect on size using CSiBE with various different options.
Baseline options are "-Os -mcpu=arm7tdmi -fno-short-enums", other options are
"-fpic", "-mthumb", and "-fpic -mthumb":
trunk patched diff ratio
baseline 3542232 3537080 5152 99.8546
baseline+fpic 3792475 3782747 9728 99.7435
baseline+mthumb 2693008 2690942 2066 99.9233
baseline+fpic+mthumb 2840739 2836169 4570 99.8391
So in all cases there is a code size reduction, but it's not very much. All in
all I'm not sure if it's worth the cost.
I'm also still working on integrating this with the hoisting pass. That would
make this pass easier to justify (it'd be almost free, HOIST already computes
everything).
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #19446|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42574