From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31778 invoked by alias); 4 Nov 2005 05:48:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31748 invoked by uid 48); 4 Nov 2005 05:48:27 -0000 Date: Fri, 04 Nov 2005 05:48:00 -0000 Message-ID: <20051104054827.31747.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/24644] [4.1 Regression] gcc-4.1 compiled ppc64 kernels do not boot In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ian at airs dot com" X-SW-Source: 2005-11/txt/msg00583.txt.bz2 List-Id: ------- 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| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24644