From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3016 invoked by alias); 24 Sep 2004 16:16:45 -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 2981 invoked from network); 24 Sep 2004 16:16:42 -0000 Received: from unknown (HELO lon-mail-2.gradwell.net) (193.111.201.126) by sourceware.org with SMTP; 24 Sep 2004 16:16:42 -0000 Received: (qmail 33873 invoked from network); 24 Sep 2004 16:16:41 -0000 Received: from digraph.polyomino.org.uk (postmaster%pop3.polyomino.org.uk@81.187.227.50) by lon-mail-2.gradwell.net with SMTP; 24 Sep 2004 16:16:41 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.41) id 1CAskT-0006Lm-IQ; Fri, 24 Sep 2004 16:16:41 +0000 Date: Fri, 24 Sep 2004 18:50:00 -0000 From: "Joseph S. Myers" X-X-Sender: jsm28@digraph.polyomino.org.uk To: Richard Kenner cc: gcc@gcc.gnu.org Subject: Re: SRA problem with uninitialzed fields In-Reply-To: <10409241604.AA01618@vlsi1.ultra.nyu.edu> Message-ID: References: <10409241604.AA01618@vlsi1.ultra.nyu.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-09/txt/msg01432.txt.bz2 On Fri, 24 Sep 2004, Richard Kenner wrote: > But what about the C test case I sent? Isn't that valid C++ also and > wouldn't it have the problem I mentioned if that hook is false? C++ bit-fields have a restricted width representation but their type is the underlying type rather than a special restricted width type. (Thus e.g. with 64-bit long, 32-bit int, unsigned long:40 + unsigned long:40 has type unsigned long:40 in C but type unsigned long in C++.) A proper implementation that keeps the types those that accord with the language semantics would be for the GIMPLE generated to include explicit mask operations for assignments to bit-fields. If it doesn't represent that assignment to a bit-field from the same type may change the value, then there are likely to be problems. At one point there were, but I don't see such problems at present in some quick tests. -- Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/ http://www.srcf.ucam.org/~jsm28/gcc/#c90status - status of C90 for GCC 4.0 jsm@polyomino.org.uk (personal mail) jsm28@gcc.gnu.org (Bugzilla assignments and CCs)