aboutsummaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-03-02 10:16:50 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-03-02 10:16:50 +0100
commitec2d71214f90e21675a5abbe5b532273f7b11ded (patch)
tree3d15c0641b451c63150370c5e946ac77cb1d82d3 /gcc/emit-rtl.c
parentbe86d201598e3b653acc6db1542b0c799c401e09 (diff)
downloadgcc-ec2d71214f90e21675a5abbe5b532273f7b11ded.zip
gcc-ec2d71214f90e21675a5abbe5b532273f7b11ded.tar.gz
gcc-ec2d71214f90e21675a5abbe5b532273f7b11ded.tar.bz2
re PR rtl-optimization/84614 (wrong code with u16->u128 extension at aarch64 -fno-split-wide-types -g3 --param=max-combine-insns=3)
PR target/84614 * rtl.h (prev_real_nondebug_insn, next_real_nondebug_insn): New prototypes. * emit-rtl.c (next_real_insn, prev_real_insn): Fix up function comments. (next_real_nondebug_insn, prev_real_nondebug_insn): New functions. * cfgcleanup.c (try_head_merge_bb): Use prev_real_nondebug_insn instead of a loop around prev_real_insn. * combine.c (move_deaths): Use prev_real_nondebug_insn instead of prev_real_insn. * gcc.dg/pr84614.c: New test. From-SVN: r258129
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index dd8fec3..4dce18d 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -3597,7 +3597,7 @@ prev_nonnote_nondebug_insn_bb (rtx_insn *insn)
return insn;
}
-/* Return the next INSN, CALL_INSN or JUMP_INSN after INSN;
+/* Return the next INSN, CALL_INSN, JUMP_INSN or DEBUG_INSN after INSN;
or 0, if there is none. This routine does not look inside
SEQUENCEs. */
@@ -3616,7 +3616,7 @@ next_real_insn (rtx uncast_insn)
return insn;
}
-/* Return the last INSN, CALL_INSN or JUMP_INSN before INSN;
+/* Return the last INSN, CALL_INSN, JUMP_INSN or DEBUG_INSN before INSN;
or 0, if there is none. This routine does not look inside
SEQUENCEs. */
@@ -3633,6 +3633,42 @@ prev_real_insn (rtx_insn *insn)
return insn;
}
+/* Return the next INSN, CALL_INSN or JUMP_INSN after INSN;
+ or 0, if there is none. This routine does not look inside
+ SEQUENCEs. */
+
+rtx_insn *
+next_real_nondebug_insn (rtx uncast_insn)
+{
+ rtx_insn *insn = safe_as_a <rtx_insn *> (uncast_insn);
+
+ while (insn)
+ {
+ insn = NEXT_INSN (insn);
+ if (insn == 0 || NONDEBUG_INSN_P (insn))
+ break;
+ }
+
+ return insn;
+}
+
+/* Return the last INSN, CALL_INSN or JUMP_INSN before INSN;
+ or 0, if there is none. This routine does not look inside
+ SEQUENCEs. */
+
+rtx_insn *
+prev_real_nondebug_insn (rtx_insn *insn)
+{
+ while (insn)
+ {
+ insn = PREV_INSN (insn);
+ if (insn == 0 || NONDEBUG_INSN_P (insn))
+ break;
+ }
+
+ return insn;
+}
+
/* Return the last CALL_INSN in the current list, or 0 if there is none.
This routine does not look inside SEQUENCEs. */