aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@gcc.gnu.org>2008-02-20 23:37:58 +0000
committerKaz Kojima <kkojima@gcc.gnu.org>2008-02-20 23:37:58 +0000
commit7a3cb3ab1443e992c2fd3aa5b93fe07c10409f0b (patch)
treea8ed3cfac01ae73905443796589d00961f9277ad
parent6d4d15b84d914b9de4289fafdd541413d41a2138 (diff)
downloadgcc-7a3cb3ab1443e992c2fd3aa5b93fe07c10409f0b.zip
gcc-7a3cb3ab1443e992c2fd3aa5b93fe07c10409f0b.tar.gz
gcc-7a3cb3ab1443e992c2fd3aa5b93fe07c10409f0b.tar.bz2
re PR target/35225 (gcc segfaults when building GTK+ code with -O2 -fPIC for SH4)
PR target/35225 * config/sh/sh.c (find_barrier): Don't go past 'from' argument. From-SVN: r132503
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4245df6..8c0b6eb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2008-02-20 Kaz Kojima <kkojima@gcc.gnu.org>
+ PR target/35225
+ * config/sh/sh.c (find_barrier): Don't go past 'from' argument.
+
+2008-02-20 Kaz Kojima <kkojima@gcc.gnu.org>
+
PR target/35190
* config/sh/sh.md (jump_compact): Disable for crossing jumps.
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 37abdf6a..dccbc1e 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -3838,6 +3838,7 @@ find_barrier (int num_mova, rtx mova, rtx from)
rtx barrier_before_mova = 0, found_barrier = 0, good_barrier = 0;
int si_limit;
int hi_limit;
+ rtx orig = from;
/* For HImode: range is 510, add 4 because pc counts from address of
second instruction after this one, subtract 2 for the jump instruction
@@ -4070,7 +4071,8 @@ find_barrier (int num_mova, rtx mova, rtx from)
/* 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. */
- if (count_hi > hi_limit || count_si > si_limit)
+ if (PREV_INSN (from) != orig
+ && (count_hi > hi_limit || count_si > si_limit))
from = PREV_INSN (PREV_INSN (from));
else
from = PREV_INSN (from);