This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ARM constant-pool layout calculations under -falign-labels
On Thu, Aug 2, 2012 at 1:57 AM, Julian Brown <julian@codesourcery.com> wrote:
> FWIW, I've hit this issue in the past, and used a patch as follows to
> fix it:
>
> @@ -12015,7 +12025,10 @@ create_fix_barrier (Mfix *fix, HOST_WIDE
> gcc_assert (GET_CODE (from) != BARRIER);
>
> /* Count the length of this insn. */
> - count += get_attr_length (from);
> + if (LABEL_P (from) && (align_jumps > 0 || align_loops > 0))
> + count += MAX (align_jumps, align_loops);
> + else
> + count += get_attr_length (from);
>
That looks like it's from a version of arm.c before get_label_padding was
added. The existing trunk code uses get_label_padding at that spot, and
my change was to get_label_padding.
> Not sure if that's equivalent, but you might want to check
> [-falign-loops] too while you're at it.
That seems like it could overestimate, if the -falign-loops value is larger
than the -falign-labels value. Not every label is for a loop.
Thanks,
Roland