re PR middle-end/45567 (__builtin_popcountl ICEs with -ftree-ter)
PR middle-end/45567 * builtins.c (expand_builtin_interclass_mathfn, expand_builtin_cexpi, expand_builtin_powi): Remove subtarget argument, pass NULL_RTX instead. (expand_builtin): Adjust caller. (expand_builtin_unop): Only use subtarget if it has the right mode. * gcc.dg/pr45567.c: New test. From-SVN: r164274
This commit is contained in:
parent
515871c739
commit
4359dc2a31
|
@ -1,3 +1,11 @@
|
||||||
|
2010-09-14 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR middle-end/45567
|
||||||
|
* builtins.c (expand_builtin_interclass_mathfn, expand_builtin_cexpi,
|
||||||
|
expand_builtin_powi): Remove subtarget argument, pass NULL_RTX instead.
|
||||||
|
(expand_builtin): Adjust caller.
|
||||||
|
(expand_builtin_unop): Only use subtarget if it has the right mode.
|
||||||
|
|
||||||
2010-09-14 Tristan Gingold <gingold@adacore.com>
|
2010-09-14 Tristan Gingold <gingold@adacore.com>
|
||||||
|
|
||||||
* configure.ac (plugins): Fix typos.
|
* configure.ac (plugins): Fix typos.
|
||||||
|
|
|
@ -106,9 +106,9 @@ static void expand_errno_check (tree, rtx);
|
||||||
static rtx expand_builtin_mathfn (tree, rtx, rtx);
|
static rtx expand_builtin_mathfn (tree, rtx, rtx);
|
||||||
static rtx expand_builtin_mathfn_2 (tree, rtx, rtx);
|
static rtx expand_builtin_mathfn_2 (tree, rtx, rtx);
|
||||||
static rtx expand_builtin_mathfn_3 (tree, rtx, rtx);
|
static rtx expand_builtin_mathfn_3 (tree, rtx, rtx);
|
||||||
static rtx expand_builtin_interclass_mathfn (tree, rtx, rtx);
|
static rtx expand_builtin_interclass_mathfn (tree, rtx);
|
||||||
static rtx expand_builtin_sincos (tree);
|
static rtx expand_builtin_sincos (tree);
|
||||||
static rtx expand_builtin_cexpi (tree, rtx, rtx);
|
static rtx expand_builtin_cexpi (tree, rtx);
|
||||||
static rtx expand_builtin_int_roundingfn (tree, rtx);
|
static rtx expand_builtin_int_roundingfn (tree, rtx);
|
||||||
static rtx expand_builtin_int_roundingfn_2 (tree, rtx);
|
static rtx expand_builtin_int_roundingfn_2 (tree, rtx);
|
||||||
static rtx expand_builtin_next_arg (void);
|
static rtx expand_builtin_next_arg (void);
|
||||||
|
@ -2338,11 +2338,10 @@ interclass_mathfn_icode (tree arg, tree fndecl)
|
||||||
isnan, etc).
|
isnan, etc).
|
||||||
Return 0 if a normal call should be emitted rather than expanding the
|
Return 0 if a normal call should be emitted rather than expanding the
|
||||||
function in-line. EXP is the expression that is a call to the builtin
|
function in-line. EXP is the expression that is a call to the builtin
|
||||||
function; if convenient, the result should be placed in TARGET.
|
function; if convenient, the result should be placed in TARGET. */
|
||||||
SUBTARGET may be used as the target for computing one of EXP's operands. */
|
|
||||||
|
|
||||||
static rtx
|
static rtx
|
||||||
expand_builtin_interclass_mathfn (tree exp, rtx target, rtx subtarget)
|
expand_builtin_interclass_mathfn (tree exp, rtx target)
|
||||||
{
|
{
|
||||||
enum insn_code icode = CODE_FOR_nothing;
|
enum insn_code icode = CODE_FOR_nothing;
|
||||||
rtx op0;
|
rtx op0;
|
||||||
|
@ -2375,7 +2374,7 @@ expand_builtin_interclass_mathfn (tree exp, rtx target, rtx subtarget)
|
||||||
side-effects more the once. */
|
side-effects more the once. */
|
||||||
CALL_EXPR_ARG (exp, 0) = arg = builtin_save_expr (arg);
|
CALL_EXPR_ARG (exp, 0) = arg = builtin_save_expr (arg);
|
||||||
|
|
||||||
op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
|
op0 = expand_expr (arg, NULL_RTX, VOIDmode, EXPAND_NORMAL);
|
||||||
|
|
||||||
if (mode != GET_MODE (op0))
|
if (mode != GET_MODE (op0))
|
||||||
op0 = convert_to_mode (mode, op0, 0);
|
op0 = convert_to_mode (mode, op0, 0);
|
||||||
|
@ -2442,11 +2441,10 @@ expand_builtin_sincos (tree exp)
|
||||||
|
|
||||||
/* Expand a call to the internal cexpi builtin to the sincos math function.
|
/* Expand a call to the internal cexpi builtin to the sincos math function.
|
||||||
EXP is the expression that is a call to the builtin function; if convenient,
|
EXP is the expression that is a call to the builtin function; if convenient,
|
||||||
the result should be placed in TARGET. SUBTARGET may be used as the target
|
the result should be placed in TARGET. */
|
||||||
for computing one of EXP's operands. */
|
|
||||||
|
|
||||||
static rtx
|
static rtx
|
||||||
expand_builtin_cexpi (tree exp, rtx target, rtx subtarget)
|
expand_builtin_cexpi (tree exp, rtx target)
|
||||||
{
|
{
|
||||||
tree fndecl = get_callee_fndecl (exp);
|
tree fndecl = get_callee_fndecl (exp);
|
||||||
tree arg, type;
|
tree arg, type;
|
||||||
|
@ -2469,7 +2467,7 @@ expand_builtin_cexpi (tree exp, rtx target, rtx subtarget)
|
||||||
op1 = gen_reg_rtx (mode);
|
op1 = gen_reg_rtx (mode);
|
||||||
op2 = gen_reg_rtx (mode);
|
op2 = gen_reg_rtx (mode);
|
||||||
|
|
||||||
op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL);
|
op0 = expand_expr (arg, NULL_RTX, VOIDmode, EXPAND_NORMAL);
|
||||||
|
|
||||||
/* Compute into op1 and op2. */
|
/* Compute into op1 and op2. */
|
||||||
expand_twoval_unop (sincos_optab, op0, op2, op1, 0);
|
expand_twoval_unop (sincos_optab, op0, op2, op1, 0);
|
||||||
|
@ -3215,7 +3213,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
|
||||||
function; if convenient, the result should be placed in TARGET. */
|
function; if convenient, the result should be placed in TARGET. */
|
||||||
|
|
||||||
static rtx
|
static rtx
|
||||||
expand_builtin_powi (tree exp, rtx target, rtx subtarget)
|
expand_builtin_powi (tree exp, rtx target)
|
||||||
{
|
{
|
||||||
tree arg0, arg1;
|
tree arg0, arg1;
|
||||||
rtx op0, op1;
|
rtx op0, op1;
|
||||||
|
@ -3244,7 +3242,7 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget)
|
||||||
|| (optimize_insn_for_speed_p ()
|
|| (optimize_insn_for_speed_p ()
|
||||||
&& powi_cost (n) <= POWI_MAX_MULTS)))
|
&& powi_cost (n) <= POWI_MAX_MULTS)))
|
||||||
{
|
{
|
||||||
op0 = expand_expr (arg0, subtarget, VOIDmode, EXPAND_NORMAL);
|
op0 = expand_expr (arg0, NULL_RTX, VOIDmode, EXPAND_NORMAL);
|
||||||
op0 = force_reg (mode, op0);
|
op0 = force_reg (mode, op0);
|
||||||
return expand_powi (op0, mode, n);
|
return expand_powi (op0, mode, n);
|
||||||
}
|
}
|
||||||
|
@ -3258,7 +3256,7 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget)
|
||||||
if (target == NULL_RTX)
|
if (target == NULL_RTX)
|
||||||
target = gen_reg_rtx (mode);
|
target = gen_reg_rtx (mode);
|
||||||
|
|
||||||
op0 = expand_expr (arg0, subtarget, mode, EXPAND_NORMAL);
|
op0 = expand_expr (arg0, NULL_RTX, mode, EXPAND_NORMAL);
|
||||||
if (GET_MODE (op0) != mode)
|
if (GET_MODE (op0) != mode)
|
||||||
op0 = convert_to_mode (mode, op0, 0);
|
op0 = convert_to_mode (mode, op0, 0);
|
||||||
op1 = expand_expr (arg1, NULL_RTX, mode2, EXPAND_NORMAL);
|
op1 = expand_expr (arg1, NULL_RTX, mode2, EXPAND_NORMAL);
|
||||||
|
@ -5000,7 +4998,10 @@ expand_builtin_unop (enum machine_mode target_mode, tree exp, rtx target,
|
||||||
return NULL_RTX;
|
return NULL_RTX;
|
||||||
|
|
||||||
/* Compute the argument. */
|
/* Compute the argument. */
|
||||||
op0 = expand_expr (CALL_EXPR_ARG (exp, 0), subtarget,
|
op0 = expand_expr (CALL_EXPR_ARG (exp, 0),
|
||||||
|
(subtarget
|
||||||
|
&& (TYPE_MODE (TREE_TYPE (CALL_EXPR_ARG (exp, 0)))
|
||||||
|
== GET_MODE (subtarget))) ? subtarget : NULL_RTX,
|
||||||
VOIDmode, EXPAND_NORMAL);
|
VOIDmode, EXPAND_NORMAL);
|
||||||
/* Compute op, into TARGET if possible.
|
/* Compute op, into TARGET if possible.
|
||||||
Set TARGET to wherever the result comes back. */
|
Set TARGET to wherever the result comes back. */
|
||||||
|
@ -5835,7 +5836,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
|
||||||
CASE_FLT_FN (BUILT_IN_FINITE):
|
CASE_FLT_FN (BUILT_IN_FINITE):
|
||||||
case BUILT_IN_ISFINITE:
|
case BUILT_IN_ISFINITE:
|
||||||
case BUILT_IN_ISNORMAL:
|
case BUILT_IN_ISNORMAL:
|
||||||
target = expand_builtin_interclass_mathfn (exp, target, subtarget);
|
target = expand_builtin_interclass_mathfn (exp, target);
|
||||||
if (target)
|
if (target)
|
||||||
return target;
|
return target;
|
||||||
break;
|
break;
|
||||||
|
@ -5865,7 +5866,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE_FLT_FN (BUILT_IN_POWI):
|
CASE_FLT_FN (BUILT_IN_POWI):
|
||||||
target = expand_builtin_powi (exp, target, subtarget);
|
target = expand_builtin_powi (exp, target);
|
||||||
if (target)
|
if (target)
|
||||||
return target;
|
return target;
|
||||||
break;
|
break;
|
||||||
|
@ -5887,7 +5888,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE_FLT_FN (BUILT_IN_CEXPI):
|
CASE_FLT_FN (BUILT_IN_CEXPI):
|
||||||
target = expand_builtin_cexpi (exp, target, subtarget);
|
target = expand_builtin_cexpi (exp, target);
|
||||||
gcc_assert (target);
|
gcc_assert (target);
|
||||||
return target;
|
return target;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
2010-09-14 Jakub Jelinek <jakub@redhat.com>
|
2010-09-14 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR middle-end/45567
|
||||||
|
* gcc.dg/pr45567.c: New test.
|
||||||
|
|
||||||
PR debug/45660
|
PR debug/45660
|
||||||
* g++.dg/debug/pr45660.C: New test.
|
* g++.dg/debug/pr45660.C: New test.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
/* PR middle-end/45567 */
|
||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-options "-ftree-ter" } */
|
||||||
|
|
||||||
|
unsigned
|
||||||
|
foo (char c)
|
||||||
|
{
|
||||||
|
return __builtin_popcountl ((unsigned long) c);
|
||||||
|
}
|
Loading…
Reference in New Issue