From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 9BE74385841D for ; Fri, 14 Apr 2023 18:18:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9BE74385841D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x436.google.com with SMTP id s12so9941110wrb.1 for ; Fri, 14 Apr 2023 11:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1681496311; x=1684088311; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=rIy8iYIfinz6yPoSBQCbIPkwsYoyWoTihf5Ay63ulyQ=; b=R8zKvT7IbgAw82l6XYNlLlzdF+QkFo3TJ0i0SLeQ6QPezYaGQa7CDMAsVxWKonFMb3 DjZhhjBMryLefHwDtr7WLshZAa8wGuykMEuTGPQq0MqHWc2rhbqclr40OWulxA+tVyNz 6bQTkihWlM2GwbMjyzzwhZ9SLFY9/v7MHFusKM0BNmUA8l+FMWO7+GvOyiBPcxqTXSvX aaSBNcdpO786nPd4DDmlOp9uu0Msv2+IR1AXtP7QHmjt8ngnHCkHZxNeP/1BYJFvyEvd +0kwL0gnmo/DcQjq9YpZI/hhW09gmqYAoB+VQdRL0zYfBuXw11Pk4vbn/++EwewCtDaw fyqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681496311; x=1684088311; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rIy8iYIfinz6yPoSBQCbIPkwsYoyWoTihf5Ay63ulyQ=; b=jEGiyPWG/Xi2muj1FHMXilM9TwLKnUniRFXfZ4aBYNfOjaeOkVN4BGadZPHS/RneZ5 JmJWYMFVJD8Q4tbQjaVubk4gUDeH4Kb4amj8QiNbo2pfcePHL83iI7z7bReFElsKHE0/ fl9VAdIOvkZW0Nv1ZfoBpFpX24gGy4kvvChVDF/xcMNlmP2JP6V6xreE4hr+O1V1obG3 0afqSQd1nPrpqt/h17y9HGW1YthNJIoRgtCD6XzcO6LAqeHaoc3ZHOlHtkqxVlSHXu7z fnL8N51QeV2vCslsbMBWWUyv8N9En9tcsdLSnU1q5hsVKVOSzsEFFqQIIy5T6FWO/K/J 3UKQ== X-Gm-Message-State: AAQBX9eCW5D/Mffv2+Zq9TV1OmydiH/48IUE8MK5v9BmGNzO29p4pLtj 9gnpDPgMa9gUhv6Lw1usIzINaU5VQdX/BoCmvIwyQw== X-Google-Smtp-Source: AKy350YGGDU6meDrGSBfQZvXUXSplJkYjeOTd5kZevV8CWIkpd0t52QF5dcfYW3Rx4ZjRcvrbhAfbg== X-Received: by 2002:a5d:6291:0:b0:2f4:215a:98c5 with SMTP id k17-20020a5d6291000000b002f4215a98c5mr4970787wru.70.1681496311308; Fri, 14 Apr 2023 11:18:31 -0700 (PDT) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id s15-20020adfea8f000000b002d1801018e2sm4074188wrm.63.2023.04.14.11.18.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 11:18:30 -0700 (PDT) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix PR bootstrap/109510 Date: Fri, 14 Apr 2023 20:18:30 +0200 Message-ID: <1927733.PYKUYFuaPT@fomalhaut> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart21841439.EfDdHjke4D" Content-Transfer-Encoding: 7Bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is a multi-part message in MIME format. --nextPart21841439.EfDdHjke4D Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" This is the build failure of the Ada runtime for Aarch64 targets. The Aarch64 back-end now asserts that the main variant of scalar types has TYPE_USER_ALIGN cleared, and that's not the case for scalar types declared with a confirming alignment clause in Ada. Tested on Aarch64/Linux by Richard S. (thanks!) and on x86-64/Linux by me, and applied on the mainline. 2023-04-14 Eric Botcazou PR bootstrap/109510 * gcc-interface/decl.cc (gnat_to_gnu_entity) : Reset align to zero if its value is equal to TYPE_ALIGN and the type is scalar. Set TYPE_USER_ALIGN on the type only if align is positive. -- Eric Botcazou --nextPart21841439.EfDdHjke4D Content-Disposition: attachment; filename="pr109510.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="pr109510.diff" diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index d24adf33601..851a6745f77 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -4364,13 +4364,17 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* If the alignment has not already been processed and this is not an unconstrained array type, see if an alignment is specified. If not, we pick a default alignment for atomic objects. */ - if (align != 0 || TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE) + if (align > 0 || TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE) ; else if (Known_Alignment (gnat_entity)) { align = validate_alignment (Alignment (gnat_entity), gnat_entity, TYPE_ALIGN (gnu_type)); + /* Treat confirming clauses on scalar types like the default. */ + if (align == TYPE_ALIGN (gnu_type) && !AGGREGATE_TYPE_P (gnu_type)) + align = 0; + /* Warn on suspiciously large alignments. This should catch errors about the (alignment,byte)/(size,bit) discrepancy. */ if (align > BIGGEST_ALIGNMENT && Has_Alignment_Clause (gnat_entity)) @@ -4666,7 +4670,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) TYPE_BY_REFERENCE_P (gnu_type) = 1; /* Record whether an alignment clause was specified. */ - if (Present (Alignment_Clause (gnat_entity))) + if (align > 0 && Present (Alignment_Clause (gnat_entity))) TYPE_USER_ALIGN (gnu_type) = 1; /* Record whether a pragma Universal_Aliasing was specified. */ --nextPart21841439.EfDdHjke4D--