From patchwork Tue Aug 20 09:51:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 1149984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-507344-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="QGZgdSJ0"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46CR0S1Mw6z9sBF for ; Tue, 20 Aug 2019 19:52:08 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=pNsrClhx+2FSEA8+h0om+QQqADobjrDiJZSZuRMF61tiG66Rol E9Zah1GD/uDB5RFVVj65QigVQh8nDJhMtswp5EsndjZYDtr5G21nRDitIdXpRsYQ Nm2FyXmlSw9jOLF1YolZIn4+xi0/QVbSJfVYig2O1qjAfr+IdVe+tOypA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=4CxyDURZdZZ2g/7uF3HNpOFPVFs=; b=QGZgdSJ0Y9l/8v3fxSED RZvuOylq4pipsUWJ+JknnWWQxevIU4X2pTlPYCYytYBwjzu5ziFRAy6zjHIqaN07 ep0AdMBKtbvzWxES743Z0tSB4WYoHx6KUVhgtXqZC5fRjCClEwca1dZmDgNKQG/w mS8vo2OK75KOyOhOyivMk2A= Received: (qmail 121427 invoked by alias); 20 Aug 2019 09:51:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 121370 invoked by uid 89); 20 Aug 2019 09:51:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=Typ X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Aug 2019 09:51:25 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 25DA2560BF; Tue, 20 Aug 2019 05:51:24 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 71V6OXnVBwPC; Tue, 20 Aug 2019 05:51:24 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id 1479A560BC; Tue, 20 Aug 2019 05:51:24 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4862) id 139A663E; Tue, 20 Aug 2019 05:51:24 -0400 (EDT) Date: Tue, 20 Aug 2019 05:51:24 -0400 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Bob Duff Subject: [Ada] Improve generated code for initialization of atomics Message-ID: <20190820095123.GA75482@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes This patch makes the temp for initialization of an atomic variable be constant. No change in behavior; no test. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-20 Bob Duff gcc/ada/ * freeze.adb (Is_Atomic_VFA_Aggregate): Make the temp for initialization of the atomic variable be constant. This is cleaner, and might improve efficiency. --- gcc/ada/freeze.adb +++ gcc/ada/freeze.adb @@ -1771,6 +1771,7 @@ package body Freeze is New_N := Make_Object_Declaration (Loc, Defining_Identifier => Temp, + Constant_Present => True, Object_Definition => New_Occurrence_Of (Typ, Loc), Expression => Relocate_Node (N)); Insert_Before (Par, New_N);