Oh, I was wrong previously, gcc does respect __attribute__
((__regparm__ (3))) flag (I forget to add -Os so it still uses stack
to store value). And the bug is still there ! Try this test program:

Compile with:
gcc -m32 -mregparm=3 -Os test.c

./a.out
10 31 -6674368

gcc is 4.3.4 from debian.

Here the test on Mac OSX 10.5.7:

* with gcc 4.0.1:

gcc -m32 -fnested-functions test.c : 10 31 31

gcc -m32 -fnested-functions -mregparm=3 -Os test.c : 10 31 -1073744144


* with gcc 4.2.1

gcc-4.2 -m32 -fnested-functions test.c : 10 31 31

gcc-4.2 -m32 -fnested-functions -mregparm=3 -Os test.c : 10 31 -1073744128

Regards,
Yves

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to