mirror of git://gcc.gnu.org/git/gcc.git
optabs.c (expand_parity): Fix mode mismatch, add final conversion and keep looping on failure.
* optabs.c (expand_parity): Fix mode mismatch, add final conversion and keep looping on failure. From-SVN: r241202
This commit is contained in:
parent
523ee218bb
commit
baa33d8380
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-10-15 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
|
* optabs.c (expand_parity): Fix mode mismatch, add final conversion
|
||||||
|
and keep looping on failure.
|
||||||
|
|
||||||
2016-10-14 David Malcolm <dmalcolm@redhat.com>
|
2016-10-14 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
* print-rtl-function.c (print_edge): Omit "(flags)" when none are
|
* print-rtl-function.c (print_edge): Omit "(flags)" when none are
|
||||||
|
|
|
||||||
18
gcc/optabs.c
18
gcc/optabs.c
|
|
@ -2382,18 +2382,26 @@ expand_parity (machine_mode mode, rtx op0, rtx target)
|
||||||
|
|
||||||
last = get_last_insn ();
|
last = get_last_insn ();
|
||||||
|
|
||||||
if (target == 0)
|
if (target == 0 || GET_MODE (target) != wider_mode)
|
||||||
target = gen_reg_rtx (mode);
|
target = gen_reg_rtx (wider_mode);
|
||||||
|
|
||||||
xop0 = widen_operand (op0, wider_mode, mode, true, false);
|
xop0 = widen_operand (op0, wider_mode, mode, true, false);
|
||||||
temp = expand_unop (wider_mode, popcount_optab, xop0, NULL_RTX,
|
temp = expand_unop (wider_mode, popcount_optab, xop0, NULL_RTX,
|
||||||
true);
|
true);
|
||||||
if (temp != 0)
|
if (temp != 0)
|
||||||
temp = expand_binop (wider_mode, and_optab, temp, const1_rtx,
|
temp = expand_binop (wider_mode, and_optab, temp, const1_rtx,
|
||||||
target, true, OPTAB_DIRECT);
|
target, true, OPTAB_DIRECT);
|
||||||
if (temp == 0)
|
|
||||||
delete_insns_since (last);
|
|
||||||
|
|
||||||
return temp;
|
if (temp)
|
||||||
|
{
|
||||||
|
if (mclass != MODE_INT
|
||||||
|
|| !TRULY_NOOP_TRUNCATION_MODES_P (mode, wider_mode))
|
||||||
|
return convert_to_mode (mode, temp, 0);
|
||||||
|
else
|
||||||
|
return gen_lowpart (mode, temp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
delete_insns_since (last);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
2016-10-15 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
|
* gcc.target/sparc/popc.c: Rename to...
|
||||||
|
* gcc.target/sparc/popc-1.c: ...this.
|
||||||
|
* gcc.target/sparc/popc-2.c: New test.
|
||||||
|
|
||||||
2016-10-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
2016-10-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
PR fortran/77972
|
PR fortran/77972
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-options "-mcpu=niagara2 -Os" } */
|
||||||
|
|
||||||
|
int foo (unsigned long long l)
|
||||||
|
{
|
||||||
|
return __builtin_parityll (l);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue