Launchpad has imported 7 comments from the remote bug at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54974.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2012-10-18T12:58:24+00:00 Mans Rullgard wrote:

Created attachment 28483
Test case

If the following conditions are true, a constant pool is placed too far
from an LDR instruction accessing it:

- Compiling to Thumb2.
- There is no unconditional branch within 4k of the LDR instruction.
- At least one of:
  * The LDR instruction is not at a 4-byte aligned address.
  * There is an instruction boundary 4094 bytes from the value of PC
    at the LDR.

The problem here is twofold:

1. The base address of a PC-relative LDR in Thumb2 is the address of the
   instruction plus 4, rounded down to a multiple of 4.  The calculation
   for the valid range fails to take this rounding into account.

2. The constant pool is (rightly) 4-byte aligned.  When scanning the
   instructions for a suitable location, the possible need for padding
   is not considered.

The problem can be seen by compiling the attached preprocessed source
using flags "-mthumb -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -O0
-fPIC".

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.7/+bug/1049614/comments/14

------------------------------------------------------------------------
On 2012-10-18T13:00:48+00:00 Mans Rullgard wrote:

Created attachment 28484
Hack patch

This hack patch validates the analysis.  A proper fix probably looks
different.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.7/+bug/1049614/comments/15

------------------------------------------------------------------------
On 2012-10-18T13:20:19+00:00 Doko-v wrote:

works with 4.7, fails with trunk

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.7/+bug/1049614/comments/16

------------------------------------------------------------------------
On 2012-10-18T13:23:13+00:00 Mikpe wrote:

Also works with gcc-4.6.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.7/+bug/1049614/comments/17

------------------------------------------------------------------------
On 2012-10-18T19:43:02+00:00 Mikpe wrote:

The test case started failing with r189790:
http://gcc.gnu.org/ml/gcc-cvs/2012-07/msg00695.html

That patch merely enabled insn splitting at -O0, so I suspect it exposed
a latent problem in the back-end, consistent with Måns' analysis.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.7/+bug/1049614/comments/18

------------------------------------------------------------------------
On 2012-10-19T12:23:57+00:00 Doko-v wrote:

this patch is now on the 4.7 branch too.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.7/+bug/1049614/comments/19

------------------------------------------------------------------------
On 2012-11-28T03:03:50+00:00 Ramana-gcc wrote:

http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01825.html

Patch posted here.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.7/+bug/1049614/comments/21


** Changed in: gcc
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1049614

Title:
  Assembler messages with -O0: Error: offset out of range

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1049614/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to