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.133.124]) by sourceware.org (Postfix) with ESMTPS id 7EAFC385E827 for ; Tue, 2 Apr 2024 20:42:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7EAFC385E827 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 7EAFC385E827 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712090536; cv=none; b=sm21YnnaymCT3UFJd9kCceRk+MZ60ou1UfhWTusXBXrZfYJwjITRsX6DoL+NNbXQBOU/pWzTsCJhuuj0HFzhOtZA7I5Sh5FO/fzLvLKXVE0zm8A1PZm+K1n5PlpoLW0rO+zsxEGxoqAREtBYGwRvdBkTQYtWMRvj0qo4Dz41A5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712090536; c=relaxed/simple; bh=ERbJVMP0iTt+HWp5FpzWR8gemaA733ed94c4VMRF9gY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=ww9qpwl+G9FyfYLhQBWqUbZ53k/HFBce5EohkwXKyajPmECZ7+Tgl2Hjn7xqFjRIaK6VMGGYKi45rkeCl3/L9IsENzZwnMsQYQIpcbdeTn1UnKlnvHyIrzdN+OUSY0hjiTFM5GwnJHgiNx3fHRzESW2W/BfAt19kmhHzuVl1DW0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712090534; h=from:from:reply-to:subject:subject: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=LQCoU6ouHtIe0N8PKdCdW+XLSWFu6s2e704M/1WQnLA=; b=O7R7+5vtrEGBqFgXE6hQm3hPjsrYJtdL9Upeb31KVHIFXgsZ1ncO7TctnT1MC3VGwu55RR 7um/9C1bdbZEbsni4N9IVbMSIRmsYfbd8S1NW+uQSgpISVsKhVwbe/i95691Ag0y7gFyk7 gTmiD02NAgjHeuU7rX4spKobyIb+Lj4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-122-jVx-TZKiOpu65WKOdQWXjg-1; Tue, 02 Apr 2024 16:42:12 -0400 X-MC-Unique: jVx-TZKiOpu65WKOdQWXjg-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-41481f2d826so26857645e9.1 for ; Tue, 02 Apr 2024 13:42:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712090531; x=1712695331; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LQCoU6ouHtIe0N8PKdCdW+XLSWFu6s2e704M/1WQnLA=; b=hoGDmNZSIwXUx7J5f+9Cfu2a4jYvNUlu8p4vDriBXanxKIyHaRu/R2p2LLoz4NuPyP siRQ3w4npa7aA5Qi4tvwi+uz/2B7xbF5xroqMP3XVkzURXFocxPN7g20HMs4n+iY09Jc AEoebT9u8eIe2O6B7D0XbZ9sKfDjPOSz8aFXznXJCsiVGOjxa9FzeKJFubow7LRurm36 2OKeTvdCFcwc2YAYXSlJMbpmBJ0Dg7Ch3RDDtxQELQFYUSxGOpC6wj/EowBytZFTUU+W yfCp/ug07jeie0Qk8Z1Mf3VpxeBbimXBmMC/utbiM2rzMqwfeS/sMAdwBBiY3gGT4wMq tl8A== X-Gm-Message-State: AOJu0YydYMN7cel+xm7x9OyWqF1z/FzrtXonMycG1U3jYHGA7L8texff /8EfyDpdc5uS8rAikpws4DJyJXaq11ivixy8tjU4Ih+7WnujuSxS/qpwfeDIhEeHslxsMV248Pj k+ogppDAj8e+bw6WkvmbZUz9Kk7Z/9Hwyz3xonDQ9eXia47dSyHAtDGIYoLc//FE= X-Received: by 2002:a05:600c:5d1:b0:414:69be:54b0 with SMTP id p17-20020a05600c05d100b0041469be54b0mr595056wmd.22.1712090531171; Tue, 02 Apr 2024 13:42:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6ziPihqxTPxkU34NqQXphbVVyn/+RixmdJhyTZ2FzcOMEt1mbpmW8Rf62mnqdWlwP+xeZgg== X-Received: by 2002:a05:600c:5d1:b0:414:69be:54b0 with SMTP id p17-20020a05600c05d100b0041469be54b0mr595047wmd.22.1712090530829; Tue, 02 Apr 2024 13:42:10 -0700 (PDT) Received: from digraph.polyomino.org.uk (digraph.polyomino.org.uk. [2001:8b0:bf73:93f7::51bb:e332]) by smtp.gmail.com with ESMTPSA id jg7-20020a05600ca00700b004161e19513bsm1954508wmb.19.2024.04.02.13.42.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 13:42:10 -0700 (PDT) Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.95) (envelope-from ) id 1rrkxN-0022u1-D1; Tue, 02 Apr 2024 20:42:09 +0000 Date: Tue, 2 Apr 2024 20:42:09 +0000 (UTC) From: Joseph Myers To: Martin Uecker cc: gcc-patches@gcc.gnu.org Subject: Re: [C PATCH] fix aliasing for structures/unions with incomplete types In-Reply-To: <0379aa34b5050780f99894b4040e416e3e95e851.camel@tugraz.at> Message-ID: <4aaeac41-2c95-8a5-85ea-f24137c9cee0@redhat.com> References: <02a9b94e4d653b6f1b9f89a1b62187f46e871738.camel@tugraz.at> <0379aa34b5050780f99894b4040e416e3e95e851.camel@tugraz.at> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.3 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 Tue, 2 Apr 2024, Martin Uecker wrote: > [C23]fix aliasing for structures/unions with incomplete types > > When incomplete structure/union types are completed later, compatibility > of struct types that contain pointers to such types changes. When forming > equivalence classes for TYPE_CANONICAL, we therefor need to be conservative > and treat all structs with the same tag which are pointer targets as > equivalent. I don't see how what it done is actually about "which are pointer targets". > @@ -1355,6 +1356,7 @@ comptypes_internal (const_tree type1, const_tree type2, > /* Do not remove mode information. */ > if (TYPE_MODE (t1) != TYPE_MODE (t2)) > return false; > + data->pointedto = true; > return comptypes_internal (TREE_TYPE (t1), TREE_TYPE (t2), data); This appears to be more like "which are the targets of pointers that *have just been compared in the present comptypes call*". Not which are targets of some other pointers not involved in that call. Maybe some such logic based only on pointers compared in the present call makes sense for some purposes, but it's not clear to me that either this or any similar approach is a good approach for TYPE_CANONICAL - couldn't that mean that two types are considered equivalent for TYPE_CANONICAL at one point in the translation unit, but no longer equivalent at some later point when the comparison takes place in the context of comparing two other pointer types? -- Joseph S. Myers josmyers@redhat.com