Hi,

Current implementation of ggc_alloc_rtvec_sized is

#define ggc_alloc_rtvec_sized(NELT)                                     \
    (ggc_alloc_zone_vec_rtvec_def (sizeof (rtx),                        \
                                   sizeof (struct rtvec_def) + ((NELT) - 1), \
                                   &rtl_zone))

The size it allocates is

  (sizeof (struct rtvec_def) + ((NELT) - 1)) * sizeof (rtx)
     // (1)

Originally, the allocated size is

  sizeof (struct rtvec_def) + ((NELT) - 1) * sizeof (rtx)
    // (2)

So current implementation allocates more spaces than before.

I replace the second parameter of ggc_alloc_zone_vec_rtvec_def with

  (sizeof (struct rtvec_def) + sizeof (rtx) - 1) / sizeof (rtx) +
((NELT) - 1)   // (3)

It bootstraps on x86 successfully.  So I guess the extra spaces are
not used.  Did I miss something?

Thanks,
Liang.

Reply via email to