Commit 85106b87 by Jakub Jelinek Committed by Jakub Jelinek

re PR target/80125 (r246297 causes segfault in reg_used_between_p())

	PR target/80125
	* combine.c (can_combine_p): Revert the 2017-03-20 change, only
	check reg_used_between_p between insn and one of succ or succ2
	depending on if succ is artificial insn not inserted into insn
	stream.

	* gcc.target/powerpc/pr80125.c: New test.

Co-Authored-By: Segher Boessenkool <segher@kernel.crashing.org>

From-SVN: r246323
parent 8c0f9dab
2017-03-21 Jakub Jelinek <jakub@redhat.com>
Segher Boessenkool <segher@kernel.crashing.org>
PR target/80125
* combine.c (can_combine_p): Revert the 2017-03-20 change, only
check reg_used_between_p between insn and one of succ or succ2
depending on if succ is artificial insn not inserted into insn
stream.
2017-03-21 Martin Liska <mliska@suse.cz> 2017-03-21 Martin Liska <mliska@suse.cz>
PR gcov-profile/80081 PR gcov-profile/80081
......
...@@ -1954,15 +1954,20 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED, ...@@ -1954,15 +1954,20 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED,
/* Don't substitute into a non-local goto, this confuses CFG. */ /* Don't substitute into a non-local goto, this confuses CFG. */
|| (JUMP_P (i3) && find_reg_note (i3, REG_NON_LOCAL_GOTO, NULL_RTX)) || (JUMP_P (i3) && find_reg_note (i3, REG_NON_LOCAL_GOTO, NULL_RTX))
/* Make sure that DEST is not used after INSN but before SUCC, or /* Make sure that DEST is not used after INSN but before SUCC, or
between SUCC and SUCC2. */ after SUCC and before SUCC2, or after SUCC2 but before I3. */
|| (succ && reg_used_between_p (dest, insn, succ))
|| (succ2 && reg_used_between_p (dest, succ, succ2))
/* Make sure that DEST is not used after SUCC but before I3. */
|| (!all_adjacent || (!all_adjacent
&& ((succ2 && ((succ2
&& (reg_used_between_p (dest, succ2, i3) && (reg_used_between_p (dest, succ2, i3)
|| reg_used_between_p (dest, succ, succ2))) || reg_used_between_p (dest, succ, succ2)))
|| (!succ2 && succ && reg_used_between_p (dest, succ, i3)))) || (!succ2 && succ && reg_used_between_p (dest, succ, i3))
|| (succ
/* SUCC and SUCC2 can be split halves from a PARALLEL; in
that case SUCC is not in the insn stream, so use SUCC2
instead for this test. */
&& reg_used_between_p (dest, insn,
succ2
&& INSN_UID (succ) == INSN_UID (succ2)
? succ2 : succ))))
/* Make sure that the value that is to be substituted for the register /* Make sure that the value that is to be substituted for the register
does not use any registers whose values alter in between. However, does not use any registers whose values alter in between. However,
If the insns are adjacent, a use can't cross a set even though we If the insns are adjacent, a use can't cross a set even though we
......
2017-03-21 Jakub Jelinek <jakub@redhat.com>
PR target/80125
* gcc.target/powerpc/pr80125.c: New test.
2017-03-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com> 2017-03-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Richard Biener <rguenther@suse.de> Richard Biener <rguenther@suse.de>
......
/* PR target/80125 */
/* { dg-do compile } */
/* { dg-options "-O2 -maltivec" } */
#include <altivec.h>
int a[1];
void
foo ()
{
vector int b, e, f, g, h, j, n;
vector unsigned c, d;
f = vec_sums (h, b);
vector int i = vec_mergel (f, g);
vector int k = vec_mergel (i, j);
vector int l = vec_sl (k, c);
vector int m = vec_sl (l, d);
vector char o;
vector int p = vec_perm (m, n, o);
e = vec_sra (p, c);
vec_st (e, 0, a);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment