public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115157] New: incorrect TBAA for derived types involving enum types
@ 2024-05-19 16:36 muecker at gwdg dot de
  2024-05-19 21:45 ` [Bug tree-optimization/115157] " uecker at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: muecker at gwdg dot de @ 2024-05-19 16:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115157

            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 PR114959.
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 types.

https://godbolt.org/z/qcWxn9f6z

enum E { E1 = -1, E2 = 0, E3 = 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 = c;
        *(B**)b = d;
        return *(A**)a;
}

int main()
{
        A *a, b, c;
        if (&c != (A*)foo(&a, &a, &b, &c))
                __builtin_abort();
}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-27 23:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-19 16:36 [Bug tree-optimization/115157] New: incorrect TBAA for derived types involving enum types muecker at gwdg dot de
2024-05-19 21:45 ` [Bug tree-optimization/115157] " uecker at gcc dot gnu.org
2024-05-26 12:21 ` muecker at gwdg dot de
2024-05-31  5:12 ` cvs-commit at gcc dot gnu.org
2024-06-03 10:36 ` rearnsha at gcc dot gnu.org
2024-06-27 23:06 ` thiago.bauermann at linaro dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).