public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/54974] New: [ARM] Incorrect placement of constant pools
@ 2012-10-18 12:58 mans at mansr dot com
  2012-10-18 13:01 ` [Bug target/54974] " mans at mansr dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: mans at mansr dot com @ 2012-10-18 12:58 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54974

             Bug #: 54974
           Summary: [ARM] Incorrect placement of constant pools
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mans@mansr.com


Created attachment 28483
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=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".


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-06-12 13:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-18 12:58 [Bug target/54974] New: [ARM] Incorrect placement of constant pools mans at mansr dot com
2012-10-18 13:01 ` [Bug target/54974] " mans at mansr dot com
2012-10-18 13:20 ` [Bug target/54974] [4.8 Regression] " doko at gcc dot gnu.org
2012-10-18 13:23 ` mikpe at it dot uu.se
2012-10-18 18:09 ` pinskia at gcc dot gnu.org
2012-10-18 19:43 ` mikpe at it dot uu.se
2012-10-19 12:24 ` doko at gcc dot gnu.org
2012-11-28  3:04 ` [Bug target/54974] [4.7/4.8 Regression] [ARM] [thumb] " ramana at gcc dot gnu.org
2012-11-29 10:02 ` mgretton at gcc dot gnu.org
2012-12-03 15:58 ` [Bug target/54974] [4.7 " rguenth at gcc dot gnu.org
2012-12-11 17:36 ` ramana at gcc dot gnu.org
2013-04-11  7:59 ` rguenth at gcc dot gnu.org
2014-06-12 13:19 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).