aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@gcc.gnu.org>2015-05-04 23:25:58 +0000
committerKaz Kojima <kkojima@gcc.gnu.org>2015-05-04 23:25:58 +0000
commit4e417af354507747882f17d09c616d6e572ab0ee (patch)
tree357f991056108ae9200502c47ffa18e6981c664a /gcc
parentf5322614a6fb5a0ce3cf85914e85946296271e91 (diff)
downloadgcc-4e417af354507747882f17d09c616d6e572ab0ee.zip
gcc-4e417af354507747882f17d09c616d6e572ab0ee.tar.gz
gcc-4e417af354507747882f17d09c616d6e572ab0ee.tar.bz2
re PR target/65987 ([SH] Wrong jump generated for gcc.dg/tree-prof/va-arg-pack-1.c with -fprofile-use)
PR target/65987 * config/sh/sh.c (output_far_jump, split_branches): Take into account sectiion crossing jumps. From-SVN: r222783
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sh/sh.c10
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 116a6d6..75a6d9e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-05-04 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/65987
+ * config/sh/sh.c (output_far_jump): Take into account crossing jumps.
+ (split_branches): Likewise.
+
2015-05-04 Sandra Loosemore <sandra@codesourcery.com>
* common.opt (fdelete-null-pointer-checks): Init to -1.
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 1cf6ed0..a4c9c4c 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -2747,7 +2747,8 @@ output_far_jump (rtx_insn *insn, rtx op)
if (TARGET_SH2
&& offset >= -32764
- && offset - get_attr_length (insn) <= 32766)
+ && offset - get_attr_length (insn) <= 32766
+ && ! CROSSING_JUMP_P (insn))
{
far = 0;
jump = "mov.w %O0,%1" "\n"
@@ -6753,6 +6754,13 @@ split_branches (rtx_insn *first)
if (type == TYPE_JUMP)
{
+ if (CROSSING_JUMP_P (insn))
+ {
+ emit_insn_before (gen_block_branch_redirect (const0_rtx),
+ insn);
+ continue;
+ }
+
far_label = as_a <rtx_insn *> (
XEXP (SET_SRC (PATTERN (insn)), 0));
dest_uid = get_dest_uid (far_label, max_uid);