public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Memory map.
       [not found] <200005231702.SAA26138@phal.cygnus.co.uk>
@ 2000-05-24  1:29 ` Virgil Palanciuc
  0 siblings, 0 replies; 5+ messages in thread
From: Virgil Palanciuc @ 2000-05-24  1:29 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: Gcc@Gcc. Gnu. Org

> Variables that are volatile or have volatile fields are put straight into
> the stack; reload had nothing to do with them.  Likewise, if a variable
> must be put into the stack because the address has been taken in a way
> that can't be optimized away, or due to a setjmp, the variable is put
> early into the stack - no later then when purge_addressof is called.
> Look for / at the macros TREE_THIS_VOLATILE, TYPE_QUAL_VOLATILE and
> the functions mark_addressable, put_var_into_stack, put_reg_into_stack.

    I ran into a problem I didn't think of so far. What do I do if I have an
array declared in a function? I know no way of detecting this.

    Can't I just use getdecls() to get all the info I need?

            Virgil?

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

* RE: Memory map.
  2000-05-22 14:48 ` Joern Rennecke
  2000-05-23  0:50   ` Virgil Palanciuc
@ 2000-05-23  1:26   ` Virgil Palanciuc
  1 sibling, 0 replies; 5+ messages in thread
From: Virgil Palanciuc @ 2000-05-23  1:26 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: Gcc@Gcc. Gnu. Org

#    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?

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

* RE: Memory map.
  2000-05-22 14:48 ` Joern Rennecke
@ 2000-05-23  0:50   ` Virgil Palanciuc
  2000-05-23  1:26   ` Virgil Palanciuc
  1 sibling, 0 replies; 5+ messages in thread
From: Virgil Palanciuc @ 2000-05-23  0:50 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: Gcc@Gcc. Gnu. Org

> >     Is the memory map kept in gcc after the reload step? (e.g. e vector
> > saying the stack slot where each variable is placed). I wrote
> the code to
>
> We've got reg_renumber, which tells you for each pseudo reg which
> hard reg it got, if any, and regno_reg_rtx, which gets changed to
> the appropriate MEMs for stack slots.

     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.

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

* Re: Memory map.
  2000-05-22 10:02 Virgil Palanciuc
@ 2000-05-22 14:48 ` Joern Rennecke
  2000-05-23  0:50   ` Virgil Palanciuc
  2000-05-23  1:26   ` Virgil Palanciuc
  0 siblings, 2 replies; 5+ messages in thread
From: Joern Rennecke @ 2000-05-22 14:48 UTC (permalink / raw)
  To: Virgil Palanciuc; +Cc: Gcc@Gcc. Gnu. Org

[Charset iso-8859-1 unsupported, filtering to ASCII...]
>     Is the memory map kept in gcc after the reload step? (e.g. e vector
> saying the stack slot where each variable is placed). I wrote the code to

We've got reg_renumber, which tells you for each pseudo reg which
hard reg it got, if any, and regno_reg_rtx, which gets changed to
the appropriate MEMs for stack slots.

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

* Memory map.
@ 2000-05-22 10:02 Virgil Palanciuc
  2000-05-22 14:48 ` Joern Rennecke
  0 siblings, 1 reply; 5+ messages in thread
From: Virgil Palanciuc @ 2000-05-22 10:02 UTC (permalink / raw)
  To: Gcc@Gcc. Gnu. Org

    Is the memory map kept in gcc after the reload step? (e.g. e vector
saying the stack slot where each variable is placed). I wrote the code to
compute it, but I have the feeling that I am doing something that has
already been done (I am new to gcc and I haven't got the time to study the
sources thoroughly yet).

   Thanx.
    Virgil

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

end of thread, other threads:[~2000-05-24  1:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200005231702.SAA26138@phal.cygnus.co.uk>
2000-05-24  1:29 ` Memory map Virgil Palanciuc
2000-05-22 10:02 Virgil Palanciuc
2000-05-22 14:48 ` Joern Rennecke
2000-05-23  0:50   ` Virgil Palanciuc
2000-05-23  1:26   ` Virgil Palanciuc

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