GCC bug? yagarto

OP #1791747
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)
Attached files:

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.