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

* [Bug c/11413] -ffixed registers on powerpc optimized incorrectly
  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 ` dmk at rscheme dot org
  2003-07-02 19:11 ` dmk at rscheme dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dmk at rscheme dot org @ 2003-07-02 19:10 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



------- Additional Comments From dmk at rscheme dot org  2003-07-02 19:10 -------
Created an attachment (id=4329)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4329&action=view)
Standalone test case (C source code)


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

* [Bug c/11413] -ffixed registers on powerpc optimized incorrectly
  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
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dmk at rscheme dot org @ 2003-07-02 19:11 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



------- Additional Comments From dmk at rscheme dot org  2003-07-02 19:11 -------
Created an attachment (id=4330)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4330&action=view)
Preprocessed output of test case


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

* [Bug c/11413] -ffixed registers on powerpc optimized incorrectly
  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
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: geoffk at geoffk dot org @ 2003-07-02 19:56 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



------- Additional Comments From geoffk at geoffk dot org  2003-07-02 19:56 -------
Subject: Re:  New: -ffixed registers on powerpc optimized incorrectly


This is probably due to something using call_used_regs instead of
regs_invalidated_by_call.


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

* [Bug target/11413] -ffixed registers on powerpc optimized incorrectly
  2003-07-02 19:08 [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly dmk at rscheme dot org
                   ` (2 preceding siblings ...)
  2003-07-02 19:56 ` geoffk at geoffk dot org
@ 2003-07-20 13:16 ` pinskia at physics dot uc dot edu
  2003-07-20 14:31 ` pinskia at physics dot uc dot edu
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-20 13:16 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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target


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

* [Bug target/11413] -ffixed registers on powerpc optimized incorrectly
  2003-07-02 19:08 [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly dmk at rscheme dot org
                   ` (3 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-20 14:31 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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
 GCC target triplet|powerpc-ibm-aix5.1.0.0      |powerpc-*-*
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-20 14:31:47
               date|                            |


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-20 14:31 -------
I can confirm this on the mainline (20030720) on powerpc-apple-darwin6.6.


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

* [Bug target/11413] -ffixed registers on powerpc optimized incorrectly
  2003-07-02 19:08 [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly dmk at rscheme dot org
                   ` (4 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-20  4:16 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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-20 04:16 -------
I think this is related to bug 10684 and bug 7871.


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

* [Bug target/11413] -ffixed registers on powerpc optimized incorrectly
  2003-07-02 19:08 [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly dmk at rscheme dot org
                   ` (5 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23  0:39 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


dhazeghi at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|powerpc-ibm-aix5.1.0.0      |
   GCC host triplet|powerpc-ibm-aix5.1.0.0      |
   Target Milestone|3.4                         |---


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

* [Bug target/11413] [3.3/3.4 regression] -ffixed registers on powerpc optimized incorrectly
  2003-07-02 19:08 [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly dmk at rscheme dot org
                   ` (6 preceding siblings ...)
  2003-08-23  0:39 ` dhazeghi at yahoo dot com
@ 2003-08-29 18:06 ` bangerth at dealii dot org
  2003-09-27 16:41 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bangerth at dealii dot org @ 2003-08-29 18:06 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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|-ffixed registers on powerpc|[3.3/3.4 regression] -ffixed
                   |optimized incorrectly       |registers on powerpc
                   |                            |optimized incorrectly
   Target Milestone|---                         |3.4


------- Additional Comments From bangerth at dealii dot org  2003-08-29 18:06 -------
This has incorrectly not been marked as a regression, see  
  http://gcc.gnu.org/ml/gcc/2003-08/msg01744.html 
Done hereby. 
W.


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

* [Bug target/11413] [3.3/3.4 regression] -ffixed registers on powerpc optimized incorrectly
  2003-07-02 19:08 [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly dmk at rscheme dot org
                   ` (7 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-09-27 16:41 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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-09-27 16:34 -------
Subject: Bug 11413

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	lerdsuwa@gcc.gnu.org	2003-09-27 16:34:29

Modified files:
	gcc/cp         : ChangeLog parser.c 

Log message:
	PR c++/11413
	* parser.c (cp_parser_nested_name_specifier_opt): Issue correct
	error message when parser->scope is global_namespace.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3704&r2=1.3705
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.112&r2=1.113


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

* [Bug target/11413] [3.3/3.4 regression] -ffixed registers on powerpc optimized incorrectly
  2003-07-02 19:08 [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly dmk at rscheme dot org
                   ` (8 preceding siblings ...)
  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
  11 siblings, 0 replies; 13+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2003-09-27 17:37 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



------- Additional Comments From lerdsuwa at gcc dot gnu dot org  2003-09-27 16:41 -------
Oops.  The patch above is actually for PR11415.
The ChangeLog is corrected now.


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

* [Bug target/11413] [3.3/3.4 regression] -ffixed registers on powerpc optimized incorrectly
  2003-07-02 19:08 [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly dmk at rscheme dot org
                   ` (9 preceding siblings ...)
  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
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-10  7:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-10 07:03 -------
Nobody really uses global registers that much (or should I say they should not be).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


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


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

* [Bug target/11413] [3.3/3.4 regression] -ffixed registers on powerpc optimized incorrectly
  2003-07-02 19:08 [Bug c/11413] New: -ffixed registers on powerpc optimized incorrectly dmk at rscheme dot org
                   ` (10 preceding siblings ...)
  2004-01-10  7:03 ` pinskia at gcc dot gnu dot org
@ 2004-01-12 21:02 ` geoffk at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2004-01-12 21:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From geoffk at gcc dot gnu dot org  2004-01-12 21:02 -------
-ffixed registers are, by definition, not call-clobbered.  You should not use -ffixed with a register 
that you use for a global register variable.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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


^ 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).