This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Memory map.


#    First of all, thanxs for your answer.
# 	I tried to change my code to use regno_reg_rtx ( in the idea that I
should
# use the mechanisms provided by gcc rather then rewrite them). So at first,
I
# tried to see how the regno_reg_rtx array looks, so I did:
#
#      for(i=0;i<max_regno;i++){
# 	    if(regno_reg_rtx[i]==0) continue;
#          print_rtl_single(dump_file,regno_reg_rtx[i]);
# 	}
#
#     What I got was:
#
# (reg:SI 30)
# (reg:SI 31)
# (reg:SI 32)
# (reg:SI 33)
# (reg:SI 34)
# (reg:SI 35)
# (reg:SI 16 r0)
# (reg:SI 37)
# (reg:SI 0 d0)
#
# 	I have the feeling that something went wrong - this is not at all what I
# expected. At a quick glance, it seems that alter_reg(..) in reload1.c sets
# the values this way - but AFAICT, these values should have been modified
# later to point at the stack slots. Am I misunderstanding something or
# something goes wrong in my compiler?
#
#      Virgil.
#
     The information I gave you is incomplete - sorry about that.
     I should mention a few additional things:
1. 30 is FIRST_PSEUDO_REGISTER on my system.
2. reg_renumber[i] is -1 for all register, except 36 and 38 (for them it is
16 and 0, respectively). Now I can understand why regno_reg_rtx has the
information it has, BUT:
    A. The source code of the program that produced these results is:
int main(){
  volatile int i;
  i=0;
  return i;
}

    B. The assembly produced with 'xgcc -S -O3 aa.c' is:
        opt     aec
        section .text local
;*** SC100 Star*Core SC100 Prototype 0.96 $Date: 2000/05/06 15:06:50 $ GNU
2.95.2 19991024 (release)
;
;=========================================================
;
; Frame Size    : 8 bytes
; Registers Used: d0 r0
;
;=========================================================

; [.. snipped irrelevant junk - section / alignment/ prologue ..]

        suba    r0,r0
        move.l  r0,(sp-8)
        move.l  (sp-8),d0
        suba    #<24,sp
DW_2
Fbb_cs_offset_DW_2      equ     0
        rts

        global  _main_end
_main_end

        endsec

    As you can see, the variable 'i' IS placed on stack, as expected. How do
I find out where it is placed, from the information given in regno_reg_rtx?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]