Poor code generation for M68k volatile variables

Mike Stump mrs@windriver.com
Thu Jun 15 15:09:00 GMT 2000


> Date: Thu, 15 Jun 2000 09:32:24 -0600
> From: Eric Norum <eric@cls.usask.ca>
> To: gcc-bugs@gcc.gnu.org, Joel Sherril <joel@oarcorp.com>

> Declaring a variable `volatile' makes access to it less efficient on
> m68k targets.

Yes.  Search the mailing list archives for volatile_ok, and my name.
You will find a patch to fix the compiler, the same test case as the
test case you found, a complete discussion and so on.

The solution, if you want to push it forward, is to define a new flag

#define MD_RESPECTS_VOLATILE 1

in your port file, and go through the entire port file, and ensure
that all uses of things comply with the volatile semantics, and then
conditionalize the old patch that fixes this with the condition of
MD_RESPECTS_VOLATILE being defined and true.

Voila, there you have it.


More information about the Gcc-bugs mailing list