This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, ARM] Fix PR60609 (Error: value of 256 too large for field of 1 bytes)


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.

I'll try and have a look at this again tomorrow morning.

regards
Ramana

>
> Bootstrapped/checked on arm-unknown-linux-gnueabihf.
>
> OK for trunk, and backporting to 4.8?
>
>
>
> 2014-04-02  Charles Baylis  <charles.baylis@linaro.org>
>
>         PR target/60609
>         * config/arm/arm.h (ASM_OUTPUT_CASE_END) Remove.
>         (LABEL_ALIGN_AFTER_BARRIER) Align barriers which occur after
>         ADDR_DIFF_VEC.
>
>
> 2014-04-02  Charles Baylis  <charles.baylis@linaro.org>
>
>         PR target/60609
>         * g++.dg/torture/pr60609.C: New test.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]