From patchwork Thu Nov 30 10:19:12 2023 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: 81016 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 8E7523881D38 for ; Thu, 30 Nov 2023 10:20:57 +0000 (GMT) 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 202973857828 for ; Thu, 30 Nov 2023 10:19:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 202973857828 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 202973857828 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=1701339557; cv=none; b=WazlOZh6AbT3/H4H2cSNYxatQNjb/Njw4bUukc+c/n8wPNiqQcRy9IyDlk/rVRHS8znZTlTMU+mQBQ0l+pz9wYgUeAyxMLoRUrQwcnNrtYtniyCT5nOUurThV5AvKUhZ813EoOkFwnxhkl1NOKM4ltdbjbKScurQ0X73wpzEtIM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701339557; c=relaxed/simple; bh=ZWnHGBTjz9g7JFiWOds0Jv3HqECf+x4q+ZPfd6HgVMY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dinLO+MlHzXzE5MhOSYd+SO7N17qDH0nLwaEFJLe6rLZqM6iPZTGQnAQFC5ENJ2rhd1+rnQvEX95RGHpKQxY9JYtW44FtPI/ZX7e3sz62C8/j7uZAroC8/5mv4tKWWZQPg7WJYK7Jf5woxeZVI0DtsoxAwXXIvuXRrXwmVJWE6s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40b4a8db331so6143515e9.3 for ; Thu, 30 Nov 2023 02:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1701339554; x=1701944354; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=F179ZmGcBEs5O9yC0qQTCyOwtJHfN3Z0JK1KeFGuan4=; b=auoq+SEGceWTCvAyr064ROljMSRywcuPyI6poHXxV6uzg/IpOpXW/bMjEDp2W1fSxf 4iR8OHuATGzgEbMWhU+SDFMjuFfOZgNYozubHi0HnYpR1jQw0mlbrdMiaxXbxINyp2qS S/u7bgwaIA+QdO9kFmQNsEe27g093uiuWkHsPvpUry/j1P+fFKkF8GQWgVHWc3BFEWD6 Co6c5Cw1beIuW2ZjCjnz6rfbU75qruuWGlDzV8b+StWtWLgm4wrXR/U1JJUcQfiqcmOf Z8VM2fPZT6DVobiC5yfYaj3r7l7f5+iX8A6m6nMIYw6CsURQX6iYwg01XbUpz+8+rF99 bu6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701339554; x=1701944354; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=F179ZmGcBEs5O9yC0qQTCyOwtJHfN3Z0JK1KeFGuan4=; b=ZAr0xPSHlA0uZbJInYupYhXo1KGYAdlNAHvG9E1nmMWAHnrjGsnVEq8Eyz3LF17BNl uxq8PVWn4hlorWsMyJaGwZdNFHWpyqSnBSGbWINQuTYhbVGzbtFA8VgufpNkvYdKFZqz 9zU3gPnFWa19sWcuJfN/z3T7nRNZJYjrEs1LO9XKrk/dQLesKXgkH/nH2dDBMlYEM2z1 RoltfUVi3G/ZiOWdoxB08k+JKuAL/gT17jZwhc3ocz6Wtsik6K93I2uyeCg8X0cmtWwa DqMUdBiLI8QTm8g6HRr0WMxmbyXUhrqy/MHLkUAV40EOys74QNz7bxke8JNWp8vQKLgs rzYA== X-Gm-Message-State: AOJu0Yy1hma02U60oY/TvpiUaNh90kzbgmtOXGfEGbvlOVcxue1I6uoV hjRtMUImCB56EqeALUsAgnQzquRVVyP6qlKhMAakpw== X-Google-Smtp-Source: AGHT+IFglK10T2FHntECM9AOOHnOOaXLHzP60JkMKaCwlHehf9+mYuFadBHYJGg3qsEF00GVvI4xtA== X-Received: by 2002:a05:600c:4fcc:b0:408:fe93:a2f7 with SMTP id o12-20020a05600c4fcc00b00408fe93a2f7mr12515259wmq.37.1701339553884; Thu, 30 Nov 2023 02:19:13 -0800 (PST) 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 m8-20020a05600c4f4800b0040b37f107c4sm1457688wmq.16.2023.11.30.02.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 02:19:13 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Viljar Indus Subject: [COMMITTED] ada: Ignore defered compile time errors without backend Date: Thu, 30 Nov 2023 11:19:12 +0100 Message-ID: <20231130101912.3094317-1-poulhies@adacore.com> X-Mailer: git-send-email 2.42.0 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+patchwork=sourceware.org@gcc.gnu.org From: Viljar Indus We defer some compile time warnings and errors until the backend has added the extra information needed. However it is not guaranteed that the backend has run by this point. Avoid checking these errors if the backend has not been activated and no code has been generated. gcc/ada/ * sem_prag.adb (Validate_Compile_Time_Warning_Errors): Avoid checking compile time warnings and errors if backend has not been activated. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 02f6f29c8a8..bd1d9d3d59b 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -33972,6 +33972,16 @@ package body Sem_Prag is -- Start of processing for Validate_Compile_Time_Warning_Errors begin + + -- These error/warning messages were deferred because they could not be + -- evaluated in the front-end and they needed additional information + -- from the back-end. There is no reason to run these checks again if + -- the back-end was not activated by this point. + + if not Generating_Code then + return; + end if; + Expander_Mode_Save_And_Set (False); In_Compile_Time_Warning_Or_Error := True;