Re: Question about 4.5.x register allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Mahoney <wmahoney@xxxxxxxxxxxxxxxx> writes:

> I have some code that I have added to GCCs in the past for doing 
> instrumentation at a basic block level. Recently I grabbed 4.5.1 and added 
> in my changes. 
>
> First, so you know:
>
> Target: x86_64-unknown-linux-gnu
> Configured with: /home/bmahoney/Projects/gcc-4.5.1/configure 
> --disable-multilib --prefix=/home/bmahoney/Projects/native_451_out 
> --enable-libjava --enable-languages=c,c++,java,fortran
>
> Now, I need to be aware of the live-in set for each block, so that I can 
> save and restore the registers that are live around the instrumentation 
> code that is inserted. In the past, looking at the live-in set for the 
> basic block header has always worked but now I have something that is 
> confusing.  I put some debugging in to look at things at the RTL level and 
> my debugging output (hopefully self-evident) is:
>
> Starting on basic block 12 it looks like it DOES have code
> global_live_at_start =  6 [bp] 7 [sp] 16 [argp] 20 [frame] 75
> global_live_at_end =  6 [bp] 7 [sp] 16 [argp] 20 [frame] 74
> Block after this one is block 13
> FIRST_PSEUDO_REGISTER = 53
> Here is the basic block before adding code:
> (note 170 70 71 [bb 12] NOTE_INSN_BASIC_BLOCK)
> (insn 71 170 190 (set (reg:DF 21 xmm0 [74])
>         (float:DF (reg:DI 0 ax [75]))) play.cpp:91 219 
> {*floatdidf2_sse_interunit}
>      (nil))
>
> My pass is right after pass_convert_to_eh_region_ranges, so it is right at 
> the end and should be past the hard register assignment. 
>
> Finally my question. In the past, checking the register set from 0 to 
> FIRST_PSEUDO_REGISTER has always worked because this should be the range 
> of the hard registers. It certainly looks to me like 74 and 75 are above 
> the range of the hard registers and thus would not really be "live" in 
> that sense.  I couldn't find the #define for FIRST_PSEUDO_REGISTER so I 
> just printed it out, but on this hardware it is 53 as you can see.
>
> What am I missing here?

It's hard to answer without seeing your code.  What are you doing to
fetch the global_live_at_start information?  How are you printing it?

If you are running after pass_convert_to_eh_region_ranges then it sounds
like you are running after pass_free_cfg and that means that basic block
info is very dubious.  Can you move your pass before pass_free_cfg?

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux