This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ARM] Fix PR60609 (Error: value of 256 too large for field of 1 bytes)
- From: Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- To: Charles Baylis <charles dot baylis at linaro dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>
- Date: Thu, 3 Apr 2014 18:02:51 +0100
- Subject: Re: [PATCH, ARM] Fix PR60609 (Error: value of 256 too large for field of 1 bytes)
- Authentication-results: sourceware.org; auth=none
- References: <CADnVucBLd0YBEWsJGFVNTktuGh-72cxXmNH0HnK-+6TytO-s6Q at mail dot gmail dot com>
- Reply-to: ramrad01 at arm dot com
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.