This is the mail archive of the
crossgcc@sources.redhat.com
mailing list for the crossgcc project.
See the CrossGCC FAQ for lots
more information.
m68k-elf local register allocation
- From: Ray Pimm <r dot pimm at uq dot net dot au>
- To: <crossgcc at sources dot redhat dot com>
- Date: Thu, 24 Oct 2002 13:40:11 +1000
- Subject: m68k-elf local register allocation
I am noticing suboptimal register allocation produced by gcc built for the
m68k-elf target.
In some functions the compiler uses registers other than d0/d1/a0/a1, and
goes to the trouble of saving and restoring them to/from the stack, while
leaving unused one or more of d0/d1/a0/a1, when it could have achieved the
same result using only registers from the d0/d1/a0/a1 set.
Then in other functions, it will use d0/d1/a0/a1 only. I cannot see any
pattern to the register allocation.
I am using primarily gcc-2.95.3, but I notice that the same phenomenon
occurs on gcc-3.2. I generally use optimization level -O2, but higher
optimization levels do not seem to affect the result.
My compiler options are as follows:
CXXFLAGS = -O2 \
-mcpu32 \
-fno-exceptions \
-fno-for-scope \
-fshort-enums \
-Wall \
-Wno-uninitialized \
-Wno-switch \
BTW, all of my code is C++, if this is relevant.
Thanks - Ray Pimm
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com