This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/20622] New: [4.0/4.1 Regression] Alias to nocommon variable fails to assemble on ppc64


/* { 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]