[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] gcc-code-generation
Am 20.01.2010, 21:13 Uhr, schrieb Vincent Rivière
<vincent.riviere@freesbee.fr>:
Interesting !
Yes!
So GCC assume the stack can never be odd.
And is wrong. It did not do this always, but I couldn't see any system in
it.
With GCC 4.4.2, the test is never checked, even without -O.
Interesting!
So when someone wants to trace the alignment, an extra function is needed.
unsigned short check_alignment( unsigned long e )
{
if( e & 1 )
return 1;
if( e & 2 )
return 2;
return 4;
}
This works.
NB: Compile with -fomit-frame-pointer to get rid of these useless
link/unlnk.
I know, and already did it, looks better ..
--
Helmut Karlowski