From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10420 invoked by alias); 17 Jul 2005 04:38:50 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10381 invoked by uid 22791); 17 Jul 2005 04:38:46 -0000 Received: from gw-d.mimosa.com (HELO gw-d.mimosa.com) (216.126.78.97) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 17 Jul 2005 04:38:46 +0000 Received: from redshift.mimosa.com (redshift.mimosa.com [192.139.70.107]) by gw-d.mimosa.com (8.12.8/8.12.8) with ESMTP id j6H4cWOE009835; Sun, 17 Jul 2005 00:38:33 -0400 Date: Sun, 17 Jul 2005 04:38:00 -0000 From: "D. Hugh Redelmeier" Reply-To: "D. Hugh Redelmeier" To: Gabriel Dos Reis cc: Daniel Berlin , gcc@gcc.gnu.org, Nathan Sidwell , Dale Johannesen , Mike Stump Subject: Re: volatile semantics In-Reply-To: Message-ID: References: <851D2CB0-93DF-4C49-A6A8-8895DB1A08F9@apple.com> <42778D99.7070904@codesourcery.com> <1121532997.29893.6.camel@linux.site> <1121548071.6761.7.camel@linux.site> <1121567241.26545.24.camel@linux.site> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-07/txt/msg00705.txt.bz2 | From: Gabriel Dos Reis | Daniel Berlin writes: | | [...] | | | > I think that is urgent. | | No offense, but everyone thinks the problems that affect them are the | | most urgent. | | miscompilation of KDE was declared urgent; I hope bug affecting code | semantics for X is not just "request for enhancement". https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=161242#c120 [Comment 120, if your browser doesn't get to the right spot] Here is the text, written by Olivier Baudron: There are 100+ casts into volatile in xorg-x11 and some of them are in libvgahw. All of these are "miscompiled" by gcc4 -O2. The patch in -43 (one volatile fixed in libvgahw) was enough for my G400. Unfortunatly, other hardware are depending upon volatile side effects found elsewhere in libvgahw or even elsewhere in xorg. Thus reported scenarii a,b,c,d are easily understood. For now, we have fixed: 1 bug out of 100+ in 1 package out of 1000+. I *really* suggest gcc4 be compatible with gcc3 in a near future. I have not verified these numbers, but they do make the bug seem serious. Just as I'm not a GCC hacker, I'm not an X hacker nor a kernel hacker. What follows is idle speculation. My feeling (i.e. it is not certain knowledge) is that a lot of X driver code may represent scar tissue from battles with intransigent hardware. There may not be explicit specs that the code is following. This may make migrating the code to another approach to volatile somewhat destabilizing. Another feeling I have is that 100+ casts to volatile are an indication that the code should be refactored. A long-term process that should not be attempted in an emergency. If GCC4 causes this much problem with X, I wonder what GCC4 will do to the Linux kernel. I understand that Linus generally prefers older GCCs to newer ones. It would be great if his preference were only superstition.