On 04/03/14 11:02, Ramana Radhakrishnan wrote:
On Thu, Apr 3, 2014 at 2:27 PM, Charles Baylis
<charles.bay...@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.
I don't think that code ever expected an alignment directive to be emitted by ASM_OUTPUT_CASE_END :(




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.
I'd tend to agree that emitting an alignment after each barrier would be a blunt hammer in this case.

ISTM we really want a new target hook to define the alignment after a the jump table, independent of the other alignment directives. Then we'd have to teach shorten_branches about that.

Perhaps the blunt hammer for 4.9 and the new alignemnt-after-jump-table for the next stage1?

jeff

Reply via email to