aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@gcc.gnu.org>2010-04-22 22:02:55 +0000
committerKaz Kojima <kkojima@gcc.gnu.org>2010-04-22 22:02:55 +0000
commitfc9c984d84576bf2024f914e62578bbbe84a19ba (patch)
treeef66a240acfd5b2060476084edf5a82e83440f13 /gcc
parentd5dceab84ca90088c65a64c15dce862ffb75f378 (diff)
downloadgcc-fc9c984d84576bf2024f914e62578bbbe84a19ba.zip
gcc-fc9c984d84576bf2024f914e62578bbbe84a19ba.tar.gz
gcc-fc9c984d84576bf2024f914e62578bbbe84a19ba.tar.bz2
re PR target/43744 (SH: Error: pcrel too far)
PR target/43744 * config/sh/sh.c (find_barrier): Don't emit a constant pool in the middle of insns for casesi_worker_2. From-SVN: r158655
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sh/sh.c17
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3d3aac0..3d8c5b0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-22 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/43744
+ * config/sh/sh.c (find_barrier): Don't emit a constant pool
+ in the middle of insns for casesi_worker_2.
+
2010-04-22 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/x-aix: Override LDFLAGS for all COMPILERS.
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 04b98c1..a3084b9 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -4410,6 +4410,7 @@ find_barrier (int num_mova, rtx mova, rtx from)
int hi_limit;
rtx orig = from;
rtx last_got = NULL_RTX;
+ rtx last_symoff = NULL_RTX;
/* For HImode: range is 510, add 4 because pc counts from address of
second instruction after this one, subtract 2 for the jump instruction
@@ -4551,6 +4552,16 @@ find_barrier (int num_mova, rtx mova, rtx from)
{
switch (untangle_mova (&num_mova, &mova, from))
{
+ case 1:
+ if (flag_pic)
+ {
+ rtx src = SET_SRC (PATTERN (from));
+ if (GET_CODE (src) == CONST
+ && GET_CODE (XEXP (src, 0)) == UNSPEC
+ && XINT (XEXP (src, 0), 1) == UNSPEC_SYMOFF)
+ last_symoff = from;
+ }
+ break;
case 0: return find_barrier (0, 0, mova);
case 2:
{
@@ -4654,6 +4665,12 @@ find_barrier (int num_mova, rtx mova, rtx from)
so we'll make one. */
rtx label = gen_label_rtx ();
+ /* Don't emit a constant table in the middle of insns for
+ casesi_worker_2. This is a bit overkill but is enough
+ because casesi_worker_2 wouldn't appear so frequently. */
+ if (last_symoff)
+ from = last_symoff;
+
/* If we exceeded the range, then we must back up over the last
instruction we looked at. Otherwise, we just need to undo the
NEXT_INSN at the end of the loop. */