Re: odd code generation

"David W. Schultz" <[email protected]> Sun, 27 Sep 2015 10:23:44 -0500
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.user
Organization State of Total Disorganization
Message-ID <[email protected]>
Answered my own question, sort of.

The TI version of gcc doesn't have the hooks to linker defined symbols
like mspgcc did so I edited the linker script to provide symbols
defining the information memory. I also used the now missing crtld.h as
a guide and included "char __infoc[];"

When I changed that to a type int, the generated code is much better.

So the compiler is seeing the type cast but remembering that the
original type is char. It is also apparently assuming that the alignment
will be completely random so generates code assuming misalignment.

Easily fixed in my case but still very surprising.


-- 
David W. Schultz
http://home.earthlink.net/~david.schultz
Returned for Regrooving



------------------------------------------------------------------------------