This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add a shared constant pool
Richard Sandiford wrote:
>> Walk me through the logic here a bit. For example, on ARM, we use
>> per-function constant pools so that we can use PC-relative addressing to
>> find constants. Now, I know that on ARM we don't currently have any of
>> the new object block hooks wired up, but, suppose we did. Then, your
>> thinking is that we would define use_blocks_for_constant_p to always
>> return false on this target because we really want to put things in
>> per-function pools?
>
> Right.
OK, got it.
>> What about things like:
>>
>> static const int i = 3;
>> static const int *ip = &i;
>>
>> Here, wouldn't we possibly want to put 3 (or, equivalently, "i") into a
>> block? Or, does all this apply only to constants that are not variable
>> initializers?
>
> The hook only applies to _rtx_ constant pools, i.e. those forced into
> memory by force_const_mem. It doesn't have any say on what we do
> with VAR_DECLs or tree constants.
OK, I understand. I always get confused by the fact that we have two
different ways of emitting constants.
The patch looks fine to me. Please give others 24 hours to comment;
then commit, assuming no objections.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713