public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly
@ 2003-07-02 19:08 dmk at rscheme dot org
  2003-07-02 19:10 ` [Bug c/11413] " dmk at rscheme dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: dmk at rscheme dot org @ 2003-07-02 19:08 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: -ffixed registers on powerpc optimized incorrectly
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dmk at rscheme dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-ibm-aix5.1.0.0
  GCC host triplet: powerpc-ibm-aix5.1.0.0
GCC target triplet: powerpc-ibm-aix5.1.0.0

GCC 3.3 on RS6000/PowerPC is incorrectly optimizing registers declared -ffixed,
which RScheme uses for virtual machine registers.  In particular, the compiler
does not recognize that a call an external procedure may clobber a register
which was declared -ffixed. I've reduced it to a small example which exhibits 
the problem.  With -O0, the problem is not exhibited.

This affects the default RScheme 0.7.3.3 build (ftp://ftp.rscheme.org/priv/b/rs-
0.7.3.3-b8.tar.gz)

I will attach the source and preprocessor output.  I included the portion
of the assembly output (below) that I believe is in error (see the ### comment)

----------------------------[gcc invocation]-----------------
bash-2.04$ gcc -v -save-temps -ffixed-18 -ffixed-19 -O2 test.c
Reading specs from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/specs
Configured with: /tmp/gcc-3.3/configure 
Thread model: aix
gcc version 3.3
 /usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/cc1 -E -quiet -v -
D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 test.c -ffixed-18 -
ffixed-19 -O2 test.i
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/powerpc-ibm-aix5.1.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/cc1 -fpreprocessed test.i -
quiet -dumpbase test.c -auxbase test -O2 -version -ffixed-18 -ffixed-19 -o 
test.s
GNU C version 3.3 (powerpc-ibm-aix5.1.0.0)
        compiled by GNU C version 3.3.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
 as -u -mcom -o test.o test.s
 /usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/collect2 -bpT:0x10000000 -
bpD:0x20000000 -btextro -bnodelcsect /lib/crt0.o -L/usr/local/lib/gcc-
lib/powerpc-ibm-aix5.1.0.0/3.3 -L/usr/local/lib/gcc-lib/powerpc-ibm-
aix5.1.0.0/3.3/../../.. test.o /usr/local/lib/gcc-lib/powerpc-ibm-
aix5.1.0.0/3.3/libgcc.a /usr/local/lib/gcc-lib/powerpc-ibm-
aix5.1.0.0/3.3/libgcc_eh.a -lc /usr/local/lib/gcc-lib/powerpc-ibm-
aix5.1.0.0/3.3/libgcc.a /usr/local/lib/gcc-lib/powerpc-ibm-
aix5.1.0.0/3.3/libgcc_eh.a
------------------------------------------------------
.foo:
        .extern __mulh
        .extern __mull
        .extern __divss
        .extern __divus
        .extern __quoss
        .extern __quous
        mflr 0
        mr 19,18
        stw 0,8(1)
        stwu 1,-56(1)
        bl .quux        # (this call clobbers reg 18)
        nop
        li 3,0
        andi. 0,18,3 ############# <--- this should reference register 19!
        bne- 0,L..3
L..1:
        addi 1,1,56
        lwz 0,8(1)
        mtlr 0
        blr
L..3:
        bl .blech
        nop
        b L..1


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

end of thread, other threads:[~2004-01-12 21:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-02 19:08 [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly dmk at rscheme dot org
2003-07-02 19:10 ` [Bug c/11413] " dmk at rscheme dot org
2003-07-02 19:11 ` dmk at rscheme dot org
2003-07-02 19:56 ` geoffk at geoffk dot org
2003-07-20 13:16 ` [Bug target/11413] " pinskia at physics dot uc dot edu
2003-07-20 14:31 ` pinskia at physics dot uc dot edu
2003-08-20  4:16 ` pinskia at gcc dot gnu dot org
2003-08-23  0:39 ` dhazeghi at yahoo dot com
2003-08-29 18:06 ` [Bug target/11413] [3.3/3.4 regression] " bangerth at dealii dot org
2003-09-27 16:41 ` cvs-commit at gcc dot gnu dot org
2003-09-27 17:37 ` lerdsuwa at gcc dot gnu dot org
2004-01-10  7:03 ` pinskia at gcc dot gnu dot org
2004-01-12 21:02 ` geoffk 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).