From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 7AFB63858D34 for ; Mon, 15 Apr 2024 08:02:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7AFB63858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7AFB63858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713168157; cv=none; b=ld69E2Os+Uqtni3FnjK5M96jkblJCNvyMYmoaqYV6QrH1pbepL33SHec5Oh+oi+22BcEDMjufavo0dUlaoEc+pM+TVO9pm8JfMhbGZHZr1WdbU4e6pB4uod13ZXCrswwScSBGkxtB58US86hsLtPGpeze96LMLBxd8XFNlVv8yo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713168157; c=relaxed/simple; bh=6Itqb//+R7093/CYgm/wobddBtVPcVbKKWHjXxYjH2I=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=SQRAMF5E4534aBwELZUmcwRGMAHiaNPddfpUqc7vgJVOIOj7XU9/sUe0Vgp9AwG+VkDhDidB02nGtxY10l7s/CySBhAAuqL8fN4Eb4HjOPIk7R1MWcAoNP5e6pBjlnc6MPNI5em2Xz7qy8VBDiI3cTpiu1nIGbFIOOOE6QTPI+k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.168.5.241] (unknown [10.168.5.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3E7A45C75B; Mon, 15 Apr 2024 08:02:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1713168145; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fCoYHn3UGYxHAQ29kbE2VRFpc3hE++f7vrF4EP4pcCE=; b=gTpLwHxrMnKVDRAec7BzjlGTIPqkQDzN9n76y6zT0R0Khzt5mIekAv28XNXPjw06y2bCAe T6qybIeESON9z/oiehnnZhC3hitjJmS3ZQKB6bi4MRs2yLjft/ZI/rwR6iP00aJzbCLI0w QIeeHQcFNBrxhh0p5DjDStmhTq25KDI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1713168145; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fCoYHn3UGYxHAQ29kbE2VRFpc3hE++f7vrF4EP4pcCE=; b=TaBCBr5pFu2q7YglKONZWMejmo27OoI+JJSY4Um/ESFqK/B1ZRMfdTyq24kVk2a0hZxurg PA/afJCWC8ZgOSDQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1713168145; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fCoYHn3UGYxHAQ29kbE2VRFpc3hE++f7vrF4EP4pcCE=; b=gTpLwHxrMnKVDRAec7BzjlGTIPqkQDzN9n76y6zT0R0Khzt5mIekAv28XNXPjw06y2bCAe T6qybIeESON9z/oiehnnZhC3hitjJmS3ZQKB6bi4MRs2yLjft/ZI/rwR6iP00aJzbCLI0w QIeeHQcFNBrxhh0p5DjDStmhTq25KDI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1713168145; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fCoYHn3UGYxHAQ29kbE2VRFpc3hE++f7vrF4EP4pcCE=; b=TaBCBr5pFu2q7YglKONZWMejmo27OoI+JJSY4Um/ESFqK/B1ZRMfdTyq24kVk2a0hZxurg PA/afJCWC8ZgOSDQ== Date: Mon, 15 Apr 2024 10:02:25 +0200 (CEST) From: Richard Biener To: Jakub Jelinek cc: Martin Uecker , gcc-patches@gcc.gnu.org, "Joseph S. Myers" Subject: Re: [C PATCH, v2] Fix ICE with -g and -std=c23 related to incomplete types [PR114361] In-Reply-To: Message-ID: <00r63o4n-88ns-0184-n594-55n69769n785@fhfr.qr> References: <02a9b94e4d653b6f1b9f89a1b62187f46e871738.camel@tugraz.at> <448b0744f89d5c6ba5d6a5bacda154fcb74b7bca.camel@tugraz.at> <71q844s1-p7ps-492r-qp8r-r8nq69s8qp8n@fhfr.qr> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Score: -4.30 X-Spam-Level: X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_THREE(0.00)[4] X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 List-Id: On Mon, 15 Apr 2024, Jakub Jelinek wrote: > On Mon, Apr 15, 2024 at 09:38:29AM +0200, Jakub Jelinek wrote: > > I had this spot instrumented to log the different cases (before adding the > > code to fix up also pointer types in c_update_type_canonical) and the only thing > > that triggered was that the 2 TYPE_CANONICALs weren't equal if > > TYPE_STRUCTURAL_EQUALITY_P (TREE_TYPE (t)), the other was just in case. > > gcc.c-torture/compile/20021205-1.c > > gcc.c-torture/compile/20040214-2.c > > gcc.c-torture/compile/20060109-1.c > > gcc.c-torture/compile/pr113623.c > > gcc.c-torture/compile/pr46866.c > > gcc.c-torture/compile/pta-1.c > > gcc.c-torture/execute/pr33870-1.c > > gcc.c-torture/execute/pr33870.c > > gcc.dg/torture/pr57478.c > > tests were affected in make check-gcc. > > I thought it would be a clear consequence of the choice we've discussed on > > IRC, that build_pointer_type_for_mode and other tree.cc functions which > > lookup/create derived types don't try to fill in TYPE_CANONICAL for > > types derived from something which initially had TYPE_STRUCTURAL_EQUALITY_P > > but later changed to non-TYPE_STRUCTURAL_EQUALITY_P. The patch updates > > it solely for qualified types/related pointer types, but doesn't do that > > for array types, pointer to array types, function types, ... > > So, I think the assertion could still trigger if we have something like > > -O2 -flto -std=c23 > > struct S; > > typedef struct S *T; > > typedef T U[10]; > > typedef U *V; > > V foo (int x) { return 0; } > > struct S { int s; }; > > (but doesn't, dunno what I'm missing; though here certainly V and U have > > TYPE_STRUCTURAL_EQUALITY_P, even T has because it is a typedef, not > > something actually normally returned by build_pointer_type). > > Though, haven't managed to reproduce it with -O2 -flto -std=c23 > struct S; > typedef struct S **V[10]; > V **foo (int x) { return 0; } > struct S { int s; }; > either. > So, maybe let's drop the ipa-free-lang-data.cc part? > Seems fld_incomplete_type_of uses fld_type_variant which should > copy over TYPE_CANONICAL. If you have a testcase that still triggers it would be nice to see it. Richard.