Re: 68K GNU Compiler

Michael Schnell <[email protected]>
Newsgroups gmane.linux.uclinux.devel
Message-ID <[email protected]>
You are right.

My compiler also produces this absolutely decent code when not 
specifying the variables as "volatile".

With "volatile" the code is a lot worse, I don't understand this, as the 
"normal" code not only fulfills what is necessary to volatile but even 
is "thread-atomic", as a thread switch does not do an interrupt within a 
single instruction, not even with the Fido that provides _hardware_ threads.

Thanks a lot for discussing this with me.

-Michael




On 08/03/2012 03:34 PM, Luis Alves wrote:
> Hi Michael,
>
> Here is the result (gcc version is 4.2.4):
>
> C test code used:
> int xx, xy;
> int yy, yx;
> int zz;
>
> int main(void)
> {
> 	xx |= 0x80;
> 	xy |= 0x80000000;
>
> 	if (zz & 0x4000)
> 		yy=yx;
>
> 	return 0;
> }
>
>
> [...]
> main:
> 	link.w %fp,#0
> 	or.w #128,xx+2
> 	bset #7,xy
> 	btst #6,zz+2
> 	jbeq .L2
> 	move.l yx,yy
> .L2:
> 	clr.l %d0
> 	unlk %fp
> 	rts
> [...]
>
>


_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.