On Thu, Apr 3, 2014 at 2:27 PM, Charles Baylis
<charles.baylis@linaro.org> wrote:
Hi
This bug causes the compiler to create a Thumb-2 TBB instruction with
a jump table containing an out of range value in a .byte field:
whatever.s:148: Error: value of 256 too large for field of 1 bytes at 100
This occurs because the jump table is followed with a ".align 1" due
to ASM_OUTPUT_CASE_END, but the 'shorten' phase does not account for
the space taken by this align directive.
My first reaction is to wonder why this is this not a bug in the
"shorten" phase.
This patch addresses the issue by removing ASM_OUTPUT_CASE_END from
arm.h, and ensuring that the alignment after an ADDR_DIFF_VEC is
instead inserted by aligning the label following the barrier which
follows it. This is achieved by defining LABEL_ALIGN_AFTER_BARRIER
appropriately.
On first glance this feels like a blunt hammer, what's the code size
bloat with putting out such an alignment after each barrier that the
compiler emits rather than tracking this in ASM_OUTPUT_CASE_END.