From patchwork Tue Jan 16 11:17:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 188503 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:42cf:b0:101:a8e8:374 with SMTP id q15csp183737dye; Tue, 16 Jan 2024 03:19:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3qoyn9PoDtsFc5yuJpvhiwm8PTSfVo+OmryFB7lhchOi9Ry8utuvKhmwoje+uxdJHp0DB X-Received: by 2002:a05:6902:1026:b0:dbf:2215:d7a7 with SMTP id x6-20020a056902102600b00dbf2215d7a7mr4518275ybt.126.1705403947839; Tue, 16 Jan 2024 03:19:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705403947; cv=pass; d=google.com; s=arc-20160816; b=QsnkRgFysHnO3AB/wJZk6gG1dTX4dUHvZCY6n1Nr4hhXcQicFZln/+fo7wQH5cpmZ8 /lgbt/XQE/L0lMhIL4dTPQV09v5ftVajfesuSu0rqlapmt6gtVbYAFowVVk64oNIaVRq s1OLAuoeZSpoCzpyO7MTvBh1w2eHqjovfYlk17L4mJpKu+ei764JfAUoestTmrWC9hl/ gDcWUzTn3XKNEcNPUxB4/3I/foV6NAHOaVmgTPOgOzK2FQiEoX5IhjCFuFWAwjPlGyGe q2t0kscZhpkFz3vQmhUPozwgCGrAJapmPtFHZjeJiJMuYJa9s2gWZSCCdCNdHfpAjKES H+LA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=z3mRNUscV+R6aThGp77m5oUBEfhK2sE+XMwpfwTFvaQ=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=WKnQP/++oC4njZ11/1WhK8IOuVhPGCxEmndnGqYnC4jjd2GX7xkmAVKAco8GisCL10 sW01GdvJJZgV+BgHUZKUl/5Cy3MOKqlcrGrbwHcJ2Tip/3H9pg8Wudx+jQ+CzRs9xtCA Kplcb9nurnj8rk4J8vzlbpakdV0Omw1NzOAsAomIkTfyClvzffhlyYWxlXtZKU90goxy AbP6TGZBsrH1jh6VcmWcxCqhOXX7OSFs+KchYKsYeQSMGTdMluEjs82LKQftwq6dM2xF 3CBvHqAJO62YzV2Lvoeyj3EcuMCWvOwpBbrTeh1fpLgBY962j8DCAvxbA+V+Hll7DKaU eKfg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=RPwZ9OUA; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id 8-20020ac84e88000000b0042a08b04cf4si365601qtp.402.2024.01.16.03.19.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 03:19:07 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=RPwZ9OUA; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8AF0F3858C2A for ; Tue, 16 Jan 2024 11:19:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 234563858C74 for ; Tue, 16 Jan 2024 11:17:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 234563858C74 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 234563858C74 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705403890; cv=none; b=LAmXwQu6m2hzlW/PLX12RpxFzYGOybYeYOxLQnQUBaaNECd3lanGeFpYLHqJ1ZXM3Bo4h1yEPbsXXARcySuIK3iGP2bVx7RU5xKoRmbPAvo8eAzGPXar2uD0V33vrp6rOjuxA/8uLUfF/042Jy7Bx7V0n4YcII6IRSi1zHYAdFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705403890; c=relaxed/simple; bh=2tEMEu5w7ewqPyYDVAFJB1oygZ0OjhI/Y2qLne2j53Q=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AYBg56rRwLuSIk4kFnSktbBRPvBIvX04uzz5cWd/3r8RIdVNjYV+T0cogQe+hku53ICGGSONLUZfTzWMxybrN+SHo787S0ZxHFTIYILq5bLIJgOhGSBLAAmN1l4ngg/JUfL8Fsd9pBIRkeQN6JsUY5UoUHaWUVnEPoRZ0DTZfJ4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-337be1326e3so218950f8f.2 for ; Tue, 16 Jan 2024 03:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1705403878; x=1706008678; 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=z3mRNUscV+R6aThGp77m5oUBEfhK2sE+XMwpfwTFvaQ=; b=RPwZ9OUAQObECJI7UGR+Q95bH02q1h4edSxAXzZlfRVbToXopKdsjdBIVdJD9FsBWz W+QiIu3IX9GFEDlJ/XRWhS70yVDFUGr3jgFKYkOEwGtWUSZfQZWGv9wfpM/A9rVn33hR Uex8j3Sy9ncgn1fHGtBe4NtFBvmBPHsIreLNDgv4BB1Oz3wELgym1wphQ4zHqVdfEqyS bVb7Sh6VMWbrrYVYXMbiI5vg+QhizEKVvKeEAHxKm0UnWaWgNYXwL95QXEHQxZB6MPjR r6LK6sLBjT5cv7XBSm7wbZsBINQ/5jEHDX+KbFdMvUM33e8bTbuysfDvRsgcUCd1VyhW rhvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705403878; x=1706008678; 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=z3mRNUscV+R6aThGp77m5oUBEfhK2sE+XMwpfwTFvaQ=; b=m6nJBIOb78K2F7a8xywd1oQ7qYiGFqHiyx59iuuj8vZziFYTiA5g4HT8NGMvasp9zG DHNvDfcNwUu3OhXiCI8lPD7V0j9q8o2pcQvkZDE9NcFzvb/lJzvVOPL3p6lLdmHo61Uc sesWDMMSKNL5PdRRHLMCgxcCxA1AI4dXNuavHo2/VLU+juK09wSTNccDT60ElHoTSOHP Qz1ZUrQ+3ctVzLkk0pqFxwkIvjP01sU6fw1iKzjvQakGpld11c7aIhHx++339NLSijFC Ja7GFydoL+xEZgnwL7+MEiy1yo3Jz8hnuUXnvX7liEuHJNpwwiMzHYshCCkJL2oQCabP P1iA== X-Gm-Message-State: AOJu0YzArXVzwNI7PFn4wKopKKNNRPOJb9A5DfVQVFQl4eZRm2wHWWjj 3xaK0Q8EOF6KL3tZZyQ0DuZPA4+5UYxsmBwKGbb8X3r0sg== X-Received: by 2002:a05:600c:331c:b0:40e:541b:1c32 with SMTP id q28-20020a05600c331c00b0040e541b1c32mr4459672wmp.106.1705403877919; Tue, 16 Jan 2024 03:17:57 -0800 (PST) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id u6-20020a05600c138600b0040d5a9d6b68sm23061024wmf.6.2024.01.16.03.17.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 03:17:57 -0800 (PST) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [c-family] Fix PR ada/113397 Date: Tue, 16 Jan 2024 12:17:56 +0100 Message-ID: <2170135.irdbgypaU6@fomalhaut> MIME-Version: 1.0 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 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788245649679954025 X-GMAIL-MSGID: 1788245649679954025 It is a regression on the mainline for -fdump-ada-spec in a pathological case. Tested on x86-64/Linux, applied on the mainline. 2024-01-16 Eric Botcazou PR ada/113397 * c-ada-spec.cc (check_type_name_conflict): Add guard for the presence of DECL_NAME on a TYPE_DECL. diff --git a/gcc/c-family/c-ada-spec.cc b/gcc/c-family/c-ada-spec.cc index 7d886c0f92e..4b245ed6975 100644 --- a/gcc/c-family/c-ada-spec.cc +++ b/gcc/c-family/c-ada-spec.cc @@ -1566,6 +1566,8 @@ check_type_name_conflict (pretty_printer *buffer, tree t) s = ""; else if (TREE_CODE (TYPE_NAME (tmp)) == IDENTIFIER_NODE) s = IDENTIFIER_POINTER (TYPE_NAME (tmp)); + else if (!DECL_NAME (TYPE_NAME (tmp))) + s = ""; else s = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (tmp)));