diff options
author | Chung-Lin Tang <cltang@codesourcery.com> | 2012-03-27 13:05:01 +0000 |
---|---|---|
committer | Chung-Lin Tang <cltang@gcc.gnu.org> | 2012-03-27 13:05:01 +0000 |
commit | 066922e6cd5d48610d0306b3c2e2e73ae9ddbb25 (patch) | |
tree | 6f25b957bcdb236a085a54cc45cbfdadf2b5ad9d | |
parent | 005aa1b4fba54dfc9f8a532ee82a8ac5f7257b9f (diff) | |
download | gcc-066922e6cd5d48610d0306b3c2e2e73ae9ddbb25.zip gcc-066922e6cd5d48610d0306b3c2e2e73ae9ddbb25.tar.gz gcc-066922e6cd5d48610d0306b3c2e2e73ae9ddbb25.tar.bz2 |
re PR target/52667 (sh_reorg segfault)
2012-03-27 Chung-Lin Tang <cltang@codesourcery.com>
PR target/52667
* config/sh/sh.c (find_barrier): Add equality check of last_got
to avoid going above orig insn. Update comments.
From-SVN: r185867
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e9acac3..876da25 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-03-27 Chung-Lin Tang <cltang@codesourcery.com> + + PR target/52667 + * config/sh/sh.c (find_barrier): Add equality check of last_got + to avoid going above orig insn. Update comments. + 2012-03-27 Richard Guenther <rguenther@suse.de> PR middle-end/52720 diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 7141a63..68e6034 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -4751,8 +4751,12 @@ find_barrier (int num_mova, rtx mova, rtx from) /* Don't emit a constant table int the middle of global pointer setting, since that that would move the addressing base GOT into another table. We need the first mov instruction before the _GLOBAL_OFFSET_TABLE_ - in the pool anyway, so just move up the whole constant pool. */ - if (last_got) + in the pool anyway, so just move up the whole constant pool. + + However, avoid doing so when the last single GOT mov is the starting + insn itself. Going past above the start insn would create a negative + offset, causing errors. */ + if (last_got && last_got != orig) from = PREV_INSN (last_got); /* Don't insert the constant pool table at the position which |