[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gcc compiler bug (sparc, ppc)

Joel Sherrill <joel.sherrill at oarcorp.com> writes:
> Ralf Corsepius wrote:
>> IMO, this is bad advice, these ain't no volatiles.
> Not in the general sense but this looks remarkably like the RTEMS chain code
> and the intent there was very simple.  The code was originally in assembly
> language and we really meant each memory load or store to occur.
> I would go so far as to assert that most of the RTEMS SuperCore and
> APIs are written with this intent.  It was written as C that is just
> marginally above assembly language.  RTEMS generally has very simple C
> statements.

Do you suggest to declare all core RTEMS variables volatile? ;)

Anyway, how is it relevant provided this case is most probably just a
GCC bug?  Moreover, the bug apparently even does not bite in normal -O2
builds, so there is no reason to search for a dirty tricks to overcome
the bug.

As for the RTEMS chain code, IMHO it should be replaced with a
straightforward implementation anyway. I recall I've removed similar
tricks during rework of the heap management code, and nobody even
noticed that, I think.

-- Sergei.