🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42783

Using -ffixed- with gcc-2.6.3

#42783
From: Ramakrishnan Rajamony
Date: Sun, 22 Oct 1995 00:00
64 lines
1904 bytes
I am running gcc 2.6.3 on a sparc-sun-sunos4.1.3_U1 system. With version 2.5.8
(on the same system), I was able to use the command line flag -ffixed-register
to prevent the compiler from using certain registers. However, I am having
trouble doing so with version 2.6.3

I have checked the REGISTER_NAMES macro in the machine description macro file,
and the register names haven't been changed. An example case is appended below.

E-mail comments will be greatly appreciated.
-ram.

----------------------------------------------------------------------------
Example case:

The following C code:

    int b, c;
    doit ()
    {
	b = c;
    }

when compiled with 2.6.3 (gcc -O -S -ffixed-"%g2") produces:

    gcc2_compiled.:
    ___gnu_compiled_c:
    .text
	    .align 4
	    .global _doit
	    .proc   04
    _doit:
	    !#PROLOGUE# 0
	    !#PROLOGUE# 1
	    sethi %hi(_b),%g2
	    sethi %hi(_c),%g3
	    ld [%g3+%lo(_c)],%g3
	    st %g3,[%g2+%lo(_b)]
	    retl
	    nop
	    .common _b,4,"bss"
	    .common _c,4,"bss"

and when compiled with gcc-2.5.8 -O -S -ffixed-"%g2"  produces:

    gcc2_compiled.:
    ___gnu_compiled_c:
    .text
	    .align 4
	    .global _doit
	    .proc   04
    _doit:
	    !#PROLOGUE# 0
	    save %sp,-112,%sp
	    !#PROLOGUE# 1
	    sethi %hi(_c),%g3
	    ld [%g3+%lo(_c)],%g3
	    sethi %hi(_b),%i0
	    st %g3,[%i0+%lo(_b)]
	    ret
	    restore
	    .global _b
	    .common _b,8,"bss"
	    .global _c
	    .common _c,8,"bss"
Technical Details
Message-ID: <46c742$sl0@larry.rice.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,791f477b12acf359,start
X-Google-Attributes: gid11318c,public
From: rrk@pi.rice.edu (Ramakrishnan Rajamony)
Subject: Using -ffixed- with gcc-2.6.3
Date: 1995/10/22
Message-ID: <46c742$sl0@larry.rice.edu>
X-Deja-AN: 117898357
organization: Rice University
reply-to: rrk@rice.edu
newsgroups: gnu.gcc.help