From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2B0DD3858D3C; Tue, 21 May 2024 15:21:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B0DD3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716304915; bh=2gWzAqnLZlpR8ceZhK0KxT9gaFm9M92ecAH1Yz9Flkg=; h=From:To:Subject:Date:From; b=GoLZJYbzc6paHJJJFQBz+dVdBrNTxZPUgeHX3CmHUQKqYCh0aXyRiHjlJRQcidyjx DZ6kIpuAOq5Rxh21AFnKP7iGe7mhEpwZ76/3GUDOgT2WlgkDQ3pUGk3MEKmwsMTMFM vhVvvLediBNqqMHfhB11UhVEjQbkliMjbHkYSX8g= From: "muecker at gwdg dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/115177] New: incorrect TBAA for derived types involving hardbool types Date: Tue, 21 May 2024 15:21:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: muecker at gwdg dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115177 Bug ID: 115177 Summary: incorrect TBAA for derived types involving hardbool types Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: muecker at gwdg dot de Target Milestone: --- This is another example where type compatibility in the C FE disagrees with TBAA. Not sure whether those types should be made incompatible instead. https://godbolt.org/z/e6nYzWMzx typedef int A; typedef int __attribute__ (( hardbool(0, 1) )) B; _Static_assert(_Generic((A*){ 0 }, B*: 1), ""); void* foo(void* a, void *b, A *c, B *d) { *(A**)a =3D c; *(B**)b =3D d; return *(A**)a; } int main() { A *a, b, c; if (&c !=3D (A*)foo(&a, &a, &b, &c)) __builtin_abort(); }=