EmbDev.net

Forum: ARM programming with GCC/GNU tools GCC bug? yagarto


von A. S. (aleksazr)


Attached files:

Rate this post
useful
not useful
The prog I've attached reads a dword from SAM9260's DBGU
port and echoes it back.

First it calls RecvDword, which calls RecvByte 4 times,
then SendDword, which calls SendByte 4 times.

The SEND side works, READ side has problems.

Start the make.bat then inspect src.lss and you will see
that RecvByte is called only once.

Now, either add 'volatile' to line 15 of src.c
 or change -Os to -O3 in make.bat
and RecvByte will be called 4 times.

I've tested this with real hardware,
not just by looking into src.lss.
If I send (with another comp) 0x12345678,
I get back 0x78787878, i.e. only the first byte sent.

I'm still a bit new to c language,
but this is a GCC bug, right?

I'm using yagarto (GCC 4.5.0)

von (prx) A. K. (prx)


Rate this post
useful
not useful
Please add the LSS file. Do not expect others to have the exactly same 
compiler version.

von A. S. (aleksazr)


Attached files:

Rate this post
useful
not useful
Ok, here are the 3 LSS files.

von (prx) A. K. (prx)


Rate this post
useful
not useful
Indeed it looks like a compiler bug. gcc 4.3.2 and 4.4.1 from 
codesourcery are fine though.

von A. S. (aleksazr)


Rate this post
useful
not useful
Besides 4.5.0, I also have yagarto with GCC 4.4.2. and it works fine,
but using -Os has no effect (at least not with this example).

If someone has the energy to fight with the bugzilla
report, please do so.

von (prx) A. K. (prx)


Rate this post
useful
not useful
Bugzilla #45052

von (prx) A. K. (prx)


Rate this post
useful
not useful
Workaround: add -fno-ipa-pure-const

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.