/* { dg-do run } */ /* { dg-require-alias "" } */ /* { dg-options "-O2" } */
extern void abort (void); int foo __asm__ ("foo") __attribute__((nocommon)); extern __typeof (foo) bar __attribute__ ((weak, alias ("foo"))); int main (void) { if (&foo != &bar || foo || bar) abort (); return bar; } results in gas looping forever. That is of course also gas bug, but the output from GCC for this testcase is wrong on all the architectures I tried. The important part of ppc64 assembly is: .weak bar .lcomm bar,4,4 .type bar, @object .globl foo .lcomm foo,4,4 .type foo, @object .weak bar .set bar,foo .weak bar .set bar,foo Note that although bar is just an alias and thus bar should be seen in the assembly only in its uses, .weak bar and .set bar,foo, not as a separate variable later on aliased to foo (and not twice either). -- Summary: [4.0/4.1 Regression] Alias to nocommon variable fails to assemble on ppc64 Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org GCC target triplet: ppc64-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20622