From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 534553858C53; Sun, 19 May 2024 16:36:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 534553858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716136609; bh=sRTcKozYnnsEKFT0YHqi7Ta7NmyIT8UazNh7vi9O/fA=; h=From:To:Subject:Date:From; b=lvqIGkEbrzWN0UlFxHSK7uhF7BqLvioNBxZIdk8GboxHOzJ26gyYj3PSDv9wKGPFc 5WzWsHSX+4kg9SdBrTpy7XBPKczPojYI7da7A2oA4+x3SkLMWL6beRL/VjpCqAx0en onWFgWkfPfp1znsCQuqVa+IeVrj5Zk1Lk7ocCVi4= From: "muecker at gwdg dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/115157] New: incorrect TBAA for derived types involving enum types Date: Sun, 19 May 2024 16:36:48 +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=3D115157 Bug ID: 115157 Summary: incorrect TBAA for derived types involving enum 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: --- Another example where TBAA does not seem to work correctly similar to PR114= 959. I guess here it should be easier to set TYPE_CANONICAL correctly in the FE,= but we have the same completion issues we also have in C23 with other tagged ty= pes. https://godbolt.org/z/qcWxn9f6z enum E { E1 =3D -1, E2 =3D 0, E3 =3D 1 }; typedef int A; typedef enum E 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(); }=