From patchwork Sat Feb 1 10:44:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 105859 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7E2503858D39 for ; Sat, 1 Feb 2025 10:46:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E2503858D39 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=WNA7wYFD X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 14C9E3858408 for ; Sat, 1 Feb 2025 10:44:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14C9E3858408 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 14C9E3858408 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::333 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738406676; cv=none; b=pi+rsWTVWMsxnBv/hyNduKkOItkd5nhkR6ALcv0ES+ovfgPaASpzOHTgE2tz7C1LEk50Vfqnk/GDp2zs8hMLyie06W5t8rCJeikbCm5YbfTXH3wZ/N0yI2Ot/Ud0wYzGjb0uADdg3YxVmrcxzIZ6/bivHoYXhXS8vOHOz+63T/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738406676; c=relaxed/simple; bh=megMlk2845Md2e0mfUOHIKR11T35je5U2W05emcemDc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WGRb8Rz5y54dUP2LqCP/xl/4K4Er0+EsrYC5Ye97XnNxdwmXhfZ9CpP6gZSMtVeK5iaL7uv0zB/f9imGrbsehG3igBqF8jMII2e8H0ej+5af4iK04RyBvpKpqXQ1Slr9GbpUYoxaTe9Z9Ik7USo4hqQdxhiqDRiB4io1pXCxl2k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14C9E3858408 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-436ce2ab251so19579085e9.1 for ; Sat, 01 Feb 2025 02:44:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1738406675; x=1739011475; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=2TlXYGz+Ar+SeCpWGz1lkoBPrizEU4WEUyGZlavrss4=; b=WNA7wYFDoYS+C8DDYek4ivB7QYM3D0NfYUT3BR6JdrF3N7IoAI0wHOUxwshvfAaoI4 WMT8ut/QVrGrCU9bAtB6PUFRIIn16FWIffzlaVYLAeLR+HK+JNzOg4TsZ26ZM+sZEgJ/ bu51YAkgiXEFrK/TVXHs0vdoX+tsvIQ4EGR4+ya25SS1ZZpNrdaChWAdiXg1lmnnuYl5 lk0oSvSpKHYjX2iiSNlDYdJ/jKAlPC09GAyuUIyU5CuMyK13GKv8Tr0NwoiGHvVmgG4W f9j7kV5E5lKCbhqFLa0NcnYbjblZEKz771pUOogDt/yMZD3q6RsVdxbcyg+oLBub3s2N /PhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738406675; x=1739011475; 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=2TlXYGz+Ar+SeCpWGz1lkoBPrizEU4WEUyGZlavrss4=; b=RwRqn1PypMl9j2uoTmhlppyigJGF4tA45utny7+sU/u1rohjUiU5+o82FerN6//kwo 7iXmINt2eKM5Lmqi7puO2xDImTnTLqaNl5xh7nB41dmVZjD3OBbZUmN8tf/RcI60r+XU WdLLEyDVeWdhLzGIjI/PQByP19E0uxPszuRJiSJisuRrOpsu+h24K0TuoPPAERmNnqq7 +pElK5MvazYtz14Ipk9L8xHWIo1j/xuFl7+DhuB7BuGI6f6wgGei7sSr4nReX0YkuIal y0oU8y5OudGRoNFyEG3xiILyx3tAJ0YC6tjKEryn/WXDl1ApwLvHZgBOkLm15Pvws5e/ hTCA== X-Gm-Message-State: AOJu0Yxajn2t8eW656OsNyDNE2/sZuDHGbBLPmi1GsB9ExQLwEMCT31f p/D9eV0WRlte4YMyujPd2Cr78RCCVOYC2fv0cx5NqMCIImfj6D9jKb0069jE7JtxE/p9SaIWmM0 = X-Gm-Gg: ASbGnctg/hp8tvNwws2SA+z+5D1WZgsNK6fBpUpPTyft6Iuq6yG5HABNJJ64nZmqFlo mL+i0PQqFQK4FJWTSx883258k97OGYFIUdRtdDVNtGmR2TuJ8IiKaAmiCXjoEpZr1jPWanwHj/3 sDjGrMw7aqGVfY80U1qZB8tTsEFKcIbs2C/77aAM0flQ3RrcYXMWFi1kfNbuNCSyeHZdPsUvvgh p22lKUaI/mHRcIMPe1jvubs1wquFE3YFhyhRGm6JfAT6LG6yGZ3MqyX8pe5phsITQ0tSroSHYoL z+XXpv16ABrti23HPZf0k7paVYa6 X-Google-Smtp-Source: AGHT+IGcLKKrxEySjgavOFLEj/7J0otA65hZcr90dePFLVDm/UPseczk0uF6RyNss+jM4+AJpKvGvw== X-Received: by 2002:a05:600c:a45:b0:434:f7e3:bfbd with SMTP id 5b1f17b1804b1-438dc40cf15mr117690535e9.23.1738406674704; Sat, 01 Feb 2025 02:44:34 -0800 (PST) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438d75de282sm85498565e9.2.2025.02.01.02.44.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Feb 2025 02:44:33 -0800 (PST) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix PR ada/118712 Date: Sat, 01 Feb 2025 11:44:33 +0100 Message-ID: <3602717.dWV9SEqChM@fomalhaut> MIME-Version: 1.0 X-Spam-Status: No, score=-11.0 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 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~patchwork=sourceware.org@gcc.gnu.org This is a regression present on the mainline, 14 and 13 branches: the compiler segfaults when warning about an uninitialized variable as operand of primitive operator of derived real type, because of a small internal adjustment. Tested on x86-64/Linux, applied on the mainline, 14 and 13 branches. 2025-02-01 Eric Botcazou PR ada/118712 * sem_warn.adb (Check_References): Deal with small adjustments of references. 2025-02-01 Eric Botcazou * gnat.dg/warn33.adb: New test. * gnat.dg/warn33_pkg.ads: New helper. diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index e460799da1f..35ef6166472 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -1257,6 +1257,10 @@ package body Sem_Warn is UR := Unset_Reference (E1); end if; + -- Protect again small adjustments of reference + + UR := Unqual_Conv (UR); + -- Special processing for access types if Present (UR) and then Is_Access_Type (E1T) then