From patchwork Tue Sep 3 08:20:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1979888 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Yi+Fviti; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WydvY2VF5z1yg9 for ; Tue, 3 Sep 2024 18:24:25 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 32611385EC12 for ; Tue, 3 Sep 2024 08:24:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 51033385E45C for ; Tue, 3 Sep 2024 08:21:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51033385E45C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 51033385E45C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725351683; cv=none; b=oDtXKMWmK3WylueqANWK35Cij4nMLgddn34g72UaYp/mfjbDsOpgE7eCCzz4U8kWne1Yh7dpueVVv3nA6CXdxfUU/T3VTSR8oy+cgOt6FPmCSAWwQ6J5l71xkVWs0bUQXLdPpbidCVIa9u4bd17YTRV3QHwqvLkIsERV46m9vCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725351683; c=relaxed/simple; bh=3u0tPWm9U8XhG8UXwGGeD6AO3Q0HHBPa6v5ScMZTZ+o=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lf8xNv9KoAvam78z1VJc0639XEDUqYYDi9XpWxRzXVge3o/8KCKvWlH6KUWjeCrC4Pgq3vCloES3+T2bX+6yVIvNXh7tif5oALrQBoshe7vVIomfHoXwodHnpJuVlvoD+ATkhdEiNGANTp9/HRiPIg9BUZo+cSGEqlCoFhGV9ds= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42bbd16fcf2so33743075e9.2 for ; Tue, 03 Sep 2024 01:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725351678; x=1725956478; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=836tlnaPm0N+XoBTpApQ/y0ZTRsTF7TcH2vdIqn3EnQ=; b=Yi+FvitijgEhd291dPhkTJVzm1CUk3Y4e628IWHxOPy/44zEHDC/HOcOa9fl+9wGoX suVAbzCib61TPh5Iq0J3AycaTqtVU1EIP5pWyFG+Pzc/K8vhENpN3eHqY1hxKchYYTZa X3+poPnwBDx8FLAzI67TzHStDqN3jgXFxtxPu4eVbQBlRdwSCbW8DNiemHB9bZynB3rz lKppj5nLkAYaYKk1SFb21VnXYRDiKXyRZ0RTI1TdnKDw1J7fyi9oTgtq8QXHu74SucUU s3QfhZ7NRr0IoeZWBJGM4yD0xp9h40ZgIxLwocCIcmF7gF4z1UwGpfuZyzPBmzQBj3Z7 u82A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725351678; x=1725956478; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=836tlnaPm0N+XoBTpApQ/y0ZTRsTF7TcH2vdIqn3EnQ=; b=TQDqHnj3eVP4+t4XW8lrBZuEuP/PPX9gQTBgy2aR6Z9RYr2MKfqsVwMLyZIgB88lcR ocG5gEn8CwVMZg0hHpZ9VIbfaEOSxYiwvsyGnt6XyTaHaXnx5oP4yOt5mT7lJF70EM0R +TNwsM+k5dw4J/JENkeQgNkj8I0IIOM8GSvHS/fYRy5zN16ZTPOASNurkcNg2klHLRSa j9j8RdbIhTfzSLaYImBybxIix4z6nsSmkhITWJwmIjD0qFEEFF23Pe5iNqV540rMrzxu yrQHVUDilfCpbq8TuM84dT3/4D2atoc573l3XtTgiLWs2KYPwVjl8SZ9K5UoJLVdxEwQ 5gCQ== X-Gm-Message-State: AOJu0YzJRccFH6bXLn8r1QrJdqdlsBxfyWuoq1Z0XPiovhrQUMA6nNTQ JtyLLuBLklvEhuhHbctvD0HVM/uw5pfHSazkMZo4+fXOo4u68ph9OnpOAWewdqQOAY2x+v65yRU = X-Google-Smtp-Source: AGHT+IHLxysqcOYosCtqZ8MUfhBdXgslx5BqEwsesiW9VToBJgAmbecpOtZqUl5zpywXRBfYBoEWRA== X-Received: by 2002:a05:600c:3b8e:b0:426:616e:db8d with SMTP id 5b1f17b1804b1-42bb01b556bmr129549005e9.15.1725351677258; Tue, 03 Sep 2024 01:21:17 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e27467sm162553425e9.38.2024.09.03.01.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:21:16 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED 06/10] ada: Fix internal error on pragma pack with discriminated record component Date: Tue, 3 Sep 2024 10:20:58 +0200 Message-ID: <20240903082102.2268026-6-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240903082102.2268026-1-poulhies@adacore.com> References: <20240903082102.2268026-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Eric Botcazou When updating the size after making a packable type in gnat_to_gnu_field, we fail to clear it again when it is not constant. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_field): Clear again gnu_size after updating it if it is not constant. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 398e01521a3..655ba0b8a10 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -7686,6 +7686,8 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, gnu_field_type = gnu_packable_type; if (!gnu_size) gnu_size = rm_size (gnu_field_type); + if (TREE_CODE (gnu_size) != INTEGER_CST) + gnu_size = NULL_TREE; } }