This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/24644] [4.1 Regression] gcc-4.1 compiled ppc64 kernels do not boot

------- Comment #10 from ian at airs dot com  2005-11-04 05:48 -------
>From IRC, the problem seems to be that gcc is copying the value out of a global
register variable, which it was not doing before.  This is not acceptable, as
the global register may be changed on any context switch, and it is important
to always use the current value each time it is dereferenced.

Declaring the global register variable as volatile may fix the problem,
although one then gets an annoying unconditional warning every time you run the
compiler ("volatile register variables don't work as you might wish").  The
volatile qualifier is recorded at the tree level, but it is not recorded at the
RTL level.  At the RTL level global registers are sometimes treated as volatile
(e.g., hash_rtx in cse.c) and sometimes not (e.g., they are not noticed by
volatile_refs_p, and thus are permitted in the input instructions in combine).

So some fixes that come to mind are, in order of increasing difficulty:
1) Change the source code to declare the variable volatile, and provide an
option to disable the warning.
2) Change global registers to be volatile by default in the C/C++ frontends,
and move the warning to there.
3) Change the source code to declare the variable volatile, and fix the RTL
level to handle volatile register variables correctly.


ian at airs dot com changed:

           What    |Removed                     |Added
                 CC|                            |ian at airs dot com
             Status|WAITING                     |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-04 05:48:27
               date|                            |

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]