ggc_alloc_rtvec_sized allocates spaces more than necessary?
Laurynas Biveinis
laurynas.biveinis@gmail.com
Tue Aug 16 05:52:00 GMT 2011
> On Mon, Aug 15, 2011 at 2:16 PM, 王亮 <netcasper@gmail.com> wrote:
>> The size it allocates is
>>
>> (sizeof (struct rtvec_def) + ((NELT) - 1)) * sizeof (rtx)
>> Originally, the allocated size is
>>
>> sizeof (struct rtvec_def) + ((NELT) - 1) * sizeof (rtx)
Yes, this is correct, good catch.
>> (sizeof (struct rtvec_def) + sizeof (rtx) - 1) / sizeof (rtx) +
>> ((NELT) - 1) // (3)
Due to the way those macros expand, right now replacing the first arg
with "1" and the second one with straightforward "sizeof (struct
rtvec_def) + ((NELT) - 1) * sizeof (rtx)" will work and will be easier
to read than division. Liang, would you submit such patch?
Thanks again,
--
Laurynas
More information about the Gcc
mailing list