https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92294
Bug ID: 92294 Summary: alias attribute generates incorrect code Product: gcc Version: 4.8.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: wilco at gcc dot gnu.org Target Milestone: --- The following example (from gcc.c-torture/execute/alias-2.c) always calls abort on any AArch64 compiler with -O1 or -O2: static int a[10]; extern int b[10] __attribute__ ((alias("a"))); int off = 0; void f(void) { b[off]=1; a[off]=2; if (b[off]!=2) __builtin_abort (); } Using extern linkage for 'a' avoids the problem, as is doing off = 1 or static int off = 0. It may only affect targets which use section anchors since -fno-section-anchors avoids the issue.