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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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