From patchwork Tue Nov 28 09:40:18 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: 80901 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 1393F3959C92 for ; Tue, 28 Nov 2023 09:41:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id AC7213945C16 for ; Tue, 28 Nov 2023 09:40:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AC7213945C16 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 AC7213945C16 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::22f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701164429; cv=none; b=QtsXH7C6LNPxXGqiBbiWvNLyLTKmc9P22rfZhDwaHdbwSUYaJ5aeKpOz/seTgz1zJjecLyVmsbeq8z5+oL7ZiiHWskHjP6Q6YnYsaJQ66ucPyCfjLpPHVYVEDRnNxUenjh+Z7/yVmghcQS8qjbKdqdkXUdF5BAQ5feq1yzWWbjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701164429; c=relaxed/simple; bh=57Cet0mQcAH0kF2UapNy8QBX83ah6lmnYr11GvMG4LI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=cTQftE9/i7fMCxDTw7uV8FxxmgR7s/3V49FiTc1GmK5NRSKJO9NbNeEk8G4s3Kj0DVxs5Iu2SpDiX+DKvb0nx2XZadNVyU9/VBzUkz53HO556cbdFIP+dkqOtLL0mtW+Hh8BB7yrkKfzDzFuMU8p9AHKM8fjCos0dCY0CUPEhSE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3b845ba9ba9so3262158b6e.3 for ; Tue, 28 Nov 2023 01:40:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1701164427; x=1701769227; 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=Zuj5F0TUUyXSR2cjomd9N3hsvmM9cvZVPqqyP1hLw/M=; b=kumQiX9g5VOr/sM3FCAckQotYIWndQ7gfwP+vqgovhhLUmDKMC/9Zu1q8NaimElbf7 ZnY/Z4jaJQO4298sojPiRJLeB6lRX1Zfz2tLREKmv/Frl3jMWsIZ3KZCvZsHDQUGD9o3 0PF/EDO/VbuifEPBNB8+jjRQvgWgyYz3sWeNOueS4PQkJ3g3ON1qz54lnG/5WtBULhY2 h7vKbX6c4xir48EyUkzqI+zZsDzcuq1aj7sFV0cQSz0kx54U4hUuMFhFuX9GTzI1f3YA c/AFpJ7s4aCoKvcI0yp8QpubzuvOVa88cjOhOQTmBlWnQRcFsvCWwgApIVBwJWVJza+Z 74Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701164427; x=1701769227; 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=Zuj5F0TUUyXSR2cjomd9N3hsvmM9cvZVPqqyP1hLw/M=; b=R9InnPCLp1fKODpUpaTQJFaSjmOzEATP1dQV0G6A3ouiNbhvYuSbFtkykYbeONSakf dpVBlFxLU5khiQ9LHfS85M9P8h22nUH3oN3TkwwLxVyg6zJcMQ3WeeIdgrPL2UeS2YUi HCwvIr/098QD7MOkMo9WuqzEiSMJHSUTV/xQx2sCgl4NAsEqpb7ya+8WxpIlsKrOf/qU kklA/GyZ4vhcIuGNNZgVtRfq/0PiOJ/mvG7xHqGR2T3jW2b/siEqCu3IAs1k4TWQssHm GFeT7N8E+Mv/pMMB0a9Gpt66gaUA0MoiUM3ZUTjAmJtMG9kyMc0l8grUaKZCxZXYbqRS M09w== X-Gm-Message-State: AOJu0Yyq2+wlVUIRfre42vD1quiTiESSZO+ERqLxuFMQQsri88J9dmyo fZ5ImMgizCGEQ8jB8wGvoltMjz0cwlNkk1nDZx6xOQ== X-Google-Smtp-Source: AGHT+IGCe3PMFtxvK1v/OAYvIt8O0wTaCotm3LO4ev92TsH4GJGYMnfZK8/gfvBq1qlZCin9kGVcrA== X-Received: by 2002:a54:4018:0:b0:3b2:e649:b5fb with SMTP id x24-20020a544018000000b003b2e649b5fbmr15917291oie.15.1701164427016; Tue, 28 Nov 2023 01:40:27 -0800 (PST) Received: from localhost.localdomain ([2001:861:3382:1a90:a24b:a65f:9576:c701]) by smtp.gmail.com with ESMTPSA id hq19-20020a056a00681300b006cbb80e4577sm8568534pfb.210.2023.11.28.01.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 01:40:26 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Marc_Poulhi=C3=A8s?= Subject: [COMMITTED] ada: Add comment for assertion Date: Tue, 28 Nov 2023 10:40:18 +0100 Message-ID: <20231128094018.2971385-1-poulhies@adacore.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 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 Add possible cause for a failed assertion. gcc/ada/ * gcc-interface/utils2.cc (build_simple_component_ref): Add comment on assertion. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/utils2.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/ada/gcc-interface/utils2.cc b/gcc/ada/gcc-interface/utils2.cc index 95bbce2f1b4..6a951093ff8 100644 --- a/gcc/ada/gcc-interface/utils2.cc +++ b/gcc/ada/gcc-interface/utils2.cc @@ -2021,7 +2021,10 @@ build_simple_component_ref (tree record, tree field, bool no_fold) /* The failure of this assertion will very likely come from a missing insertion of an explicit dereference. */ - gcc_assert (RECORD_OR_UNION_TYPE_P (type) && COMPLETE_TYPE_P (type)); + gcc_assert (RECORD_OR_UNION_TYPE_P (type)); + + /* The type must be frozen at this point. */ + gcc_assert (COMPLETE_TYPE_P (type)); /* Try to fold a conversion from another record or union type unless the type contains a placeholder as it might be needed for a later substitution. */