From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24865 invoked by alias); 26 Jan 2007 10:12:02 -0000 Received: (qmail 24837 invoked by uid 22791); 26 Jan 2007 10:12:00 -0000 X-Spam-Check-By: sourceware.org Received: from province.act-europe.fr (HELO province.act-europe.fr) (212.157.227.214) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 26 Jan 2007 10:11:50 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-province.act-europe.fr (Postfix) with ESMTP id E78F64ACF1; Fri, 26 Jan 2007 11:11:47 +0100 (CET) Received: from province.act-europe.fr ([127.0.0.1]) by localhost (province.act-europe.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 71701-07; Fri, 26 Jan 2007 11:11:47 +0100 (CET) Received: from [192.168.1.3] (dyn-83-155-193-149.ppp.tiscali.fr [83.155.193.149]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by province.act-europe.fr (Postfix) with ESMTP id 8BACC4ACEE; Fri, 26 Jan 2007 11:11:47 +0100 (CET) From: Eric Botcazou To: "Richard Guenther" Subject: Re: [PATCH] Tree SRA and atomicity/volatility Date: Fri, 26 Jan 2007 10:12:00 -0000 User-Agent: KMail/1.7.1 Cc: gcc-patches@gcc.gnu.org, "Mark Mitchell" , "Mike Stump" , "Richard Kenner" References: <200701061422.39157.ebotcazou@adacore.com> <45B96D42.5010303@codesourcery.com> <84fc9c000701260117x7ec2e0e1p71cf64ea4d35deb9@mail.gmail.com> In-Reply-To: <84fc9c000701260117x7ec2e0e1p71cf64ea4d35deb9@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701261112.42111.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-01/txt/msg02180.txt.bz2 > I disagree. We have a defect for Ada and Ada happens to require certain > semantics on a for now unspecified middle-end construct. It is perfectly > reasonable to require, that upon fixing this defect, the interface between > the frontend and middle-end is specified where it relates to that defect. I disagree with your disagreement. :-) I took great care of not dragging the discussion towards the problem of the semantics of "volatile", my patch doesn't rely on it, the bug I pointed out in the Tree-SRA pass is not directly related to it, but rather to how TREE_SIDE_EFFECTS is honored. To recap, we have: /* Scalarize a LDST. To recap, this is an assignment between one scalarizable reference ELT and one non-scalarizable reference OTHER. IS_OUTPUT is true if ELT is on the left-hand side. */ static void scalarize_ldst (struct sra_elt *elt, tree other, block_stmt_iterator *bsi, bool is_output) { /* Shouldn't have gotten called for a scalar. */ gcc_assert (!elt->replacement); if (elt->use_block_copy) { /* Since ELT is not fully instantiated, we have to leave the block copy in place. Treat this as a USE. */ scalarize_use (elt, NULL, bsi, is_output, false); } else { /* The interesting case is when ELT is fully instantiated. In this case we can have each element stored/loaded directly to/from the corresponding slot in OTHER. This avoids a block copy. */ I claim that the last comment (and the code below it) violates the perfectly well defined TREE_SIDE_EFFECTS flag of the middle-end if it happens to be set on OTHER because it will generate multiple instances of OTHER out of 1. That's all. That the discussion has drifted towards the problem of the semantics of "volatile" is unfortunate and should not blur the issue. -- Eric Botcazou