From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 305EF3858D34 for ; Mon, 15 Apr 2024 07:59:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 305EF3858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 305EF3858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713167958; cv=none; b=Y5SRgsh56CsgskSOsxKu8uwCjNFRLTMdquTlJjeIC6n/4QvTCMeaKDGPGqaw5C7otYbnDtYD/c+t/hzC/h9r5tMzJQ2tn68O8wSIWtphlcjO2TFhwpVGdClA2Uy1DUWypvU3EDQZzxD38E5+mt7flh1F2ku/CVdNkDYAxdZhUH8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713167958; c=relaxed/simple; bh=sotOsRmVdD+a8a8MwR75iEsEmtxw27inxWKNEc34wJc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=KpSZ9IBGWOSDxURd4UeZvU2VeAtLPCg7F0F86ILG/FtbAnMBoI4UWbhLEDJomAFISnf5w36q0CIJPRaslm7XtHnHsu+/zbnG9hEr9LDkjUkETX5Du9BeZ7QupDxpUt3GrbMhYRb+wRlNnOOeOBp2xeEBljYWhbXuse3UXsKKEOc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713167954; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=zDz6hVCnUV1OOCPt2sT91LBUyNsKunafwm+ziPJALQ4=; b=fDCO0M6j2EiqUw6W/oV3x1jShKb/DDc4L2ulMjlsZSuAkmt0N6QFTupZnKOQqYkIWcfI27 ITS0ulTAXDWh0e4x/nH/A6gwOf1IyMpQWMNGMgfXICv54eRL5uYcULH1UY4eC4Dv1rFUVg a7SlRzK66KsT+Dy4kDUVZ/NlltSMg4E= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-47-bP3eS4QSO0aRFm3sCozb3A-1; Mon, 15 Apr 2024 03:59:12 -0400 X-MC-Unique: bP3eS4QSO0aRFm3sCozb3A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0372429AC02F; Mon, 15 Apr 2024 07:59:12 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.224.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B8AD2026D06; Mon, 15 Apr 2024 07:59:11 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 43F7x6dV050907 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 15 Apr 2024 09:59:06 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 43F7x5nJ050906; Mon, 15 Apr 2024 09:59:05 +0200 Date: Mon, 15 Apr 2024 09:59:05 +0200 From: Jakub Jelinek To: Richard Biener , 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] Message-ID: Reply-To: Jakub Jelinek References: <02a9b94e4d653b6f1b9f89a1b62187f46e871738.camel@tugraz.at> <448b0744f89d5c6ba5d6a5bacda154fcb74b7bca.camel@tugraz.at> <71q844s1-p7ps-492r-qp8r-r8nq69s8qp8n@fhfr.qr> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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, 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. Jakub