public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/20622] New: [4.0/4.1 Regression] Alias to nocommon variable fails to assemble on ppc64
@ 2005-03-24 14:20 jakub at gcc dot gnu dot org
  2005-03-24 14:52 ` [Bug middle-end/20622] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-03-24 14:20 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2005-03-29 15:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-24 14:20 [Bug middle-end/20622] New: [4.0/4.1 Regression] Alias to nocommon variable fails to assemble on ppc64 jakub at gcc dot gnu dot org
2005-03-24 14:52 ` [Bug middle-end/20622] " pinskia at gcc dot gnu dot org
2005-03-24 15:34 ` jakub at gcc dot gnu dot org
2005-03-24 18:13 ` pinskia at gcc dot gnu dot org
2005-03-24 18:55 ` mmitchel at gcc dot gnu dot org
2005-03-29 15:38 ` cvs-commit at gcc dot gnu dot org
2005-03-29 15:41 ` cvs-commit at gcc dot gnu dot org
2005-03-29 15:45 ` jakub at gcc dot gnu 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).