public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/20263] New: Incorrect asm for global register vars on sparc64
@ 2005-03-01 16:45 gcc-bugzilla at gcc dot gnu dot org
  2005-03-01 16:50 ` [Bug target/20263] " rcbilson at plg dot uwaterloo dot ca
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2005-03-01 16:45 UTC (permalink / raw)
  To: gcc-bugs


Using a global variable tied to register g7 generates invalid assembly
code on sparc64.

Consider:

    register void *tp __asm__("%g7");

    void set_tp() {
	tp = 0;
    }

Compiling this file produces an error and a warning from the assembler:

    /usr/ccs/bin/as: "/var/tmp//ccLsIpQg.s", line 2: error: statement syntax
    /usr/ccs/bin/as: "/var/tmp//ccLsIpQg.s", line 10: warning: detect global register use not covered .register pseudo-op

Environment:
System: SunOS plg2.math 5.8 Generic_117350-18 sun4u sparc SUNW,Sun-Fire-880
Architecture: sun4
host: sparc64-sun-solaris2.8
build: sparc64-sun-solaris2.8
target: sparc64-sun-solaris2.8
configured with: ../gcc/configure --prefix=/u/rcbilson/software/gcc --enable-languages=c,c++ sparc64-sun-solaris2.8

How-To-Repeat:
Attempt to compile the above program fragment.
------- Additional Comments From rcbilson at plg dot uwaterloo dot ca  2005-03-01 16:45 -------
Fix:
Examining the -S output shows that the .register op generated by the
compiler is

    .register       %g7, %g7

The second operand seems to be incorrect -- it ought to be a plain
name, not a register name.  Replacing this op with

    .register       %g7, g7

allows the code to assemble, eliminating both the error and the
warning.

I don't know enough about .register to be confident in suggesting an
appropriate identifier to use for the second operand.

-- 
           Summary: Incorrect asm for global register vars on sparc64
           Product: gcc
           Version: 1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rcbilson at plg dot uwaterloo dot ca
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc64-sun-solaris2.8
  GCC host triplet: sparc64-sun-solaris2.8
GCC target triplet: sparc64-sun-solaris2.8


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20263


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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-01 16:45 [Bug target/20263] New: Incorrect asm for global register vars on sparc64 gcc-bugzilla at gcc dot gnu dot org
2005-03-01 16:50 ` [Bug target/20263] " rcbilson at plg dot uwaterloo dot ca
2005-03-01 16:52 ` rcbilson at plg dot uwaterloo dot ca
2005-03-01 17:47 ` pinskia at gcc dot gnu dot org
2005-03-01 19:52 ` ebotcazou at gcc dot gnu dot org
2005-03-16  7:56 ` [Bug target/20263] [4.0/4.1 Regression] Incorrect asm for global register vars ebotcazou at gcc dot gnu dot org
2005-03-16  9:05 ` [Bug middle-end/20263] " ebotcazou at gcc dot gnu dot org
2005-03-16 15:13 ` rcbilson at plg dot uwaterloo dot ca
2005-03-16 15:56 ` ebotcazou at gcc dot gnu dot org
2005-03-24 19:08 ` mmitchel at gcc dot gnu dot org
2005-03-24 22:24 ` ebotcazou at gcc dot gnu dot org
2005-03-29 12:09 ` cvs-commit at gcc dot gnu dot org
2005-03-29 12:21 ` cvs-commit at gcc dot gnu dot org
2005-03-29 12:24 ` ebotcazou 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).