mirror of git://gcc.gnu.org/git/gcc.git
re PR middle-end/77798 (465.tonto ICE with trunk with -O2)
2016-10-01 Richard Biener <rguenther@suse.de> PR middle-end/77798 * genmatch.c (get_operand_type): Add operand position arg and handle COND_EXPR comparison operand with fixed boolean_type_node. (expr::gen_transform): Adjust. (dt_simplify::gen_1): Likewise. * gfortran.fortran-torture/compile/pr77798.f90: New testcase. From-SVN: r240696
This commit is contained in:
parent
0f0565b143
commit
f00b6283fb
|
|
@ -1,3 +1,11 @@
|
||||||
|
2016-10-01 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR middle-end/77798
|
||||||
|
* genmatch.c (get_operand_type): Add operand position arg
|
||||||
|
and handle COND_EXPR comparison operand with fixed boolean_type_node.
|
||||||
|
(expr::gen_transform): Adjust.
|
||||||
|
(dt_simplify::gen_1): Likewise.
|
||||||
|
|
||||||
2016-10-01 Jakub Jelinek <jakub@redhat.com>
|
2016-10-01 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* config/i386/sse.md (<mask_codefor><code><mode>): Add FALLTHRU
|
* config/i386/sse.md (<mask_codefor><code><mode>): Add FALLTHRU
|
||||||
|
|
|
||||||
|
|
@ -2216,11 +2216,12 @@ is_conversion (id_base *op)
|
||||||
|| *op == VIEW_CONVERT_EXPR);
|
|| *op == VIEW_CONVERT_EXPR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the type to be used for generating operands of OP from the
|
/* Get the type to be used for generating operand POS of OP from the
|
||||||
various sources. */
|
various sources. */
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_operand_type (id_base *op, const char *in_type,
|
get_operand_type (id_base *op, unsigned pos,
|
||||||
|
const char *in_type,
|
||||||
const char *expr_type,
|
const char *expr_type,
|
||||||
const char *other_oprnd_type)
|
const char *other_oprnd_type)
|
||||||
{
|
{
|
||||||
|
|
@ -2235,6 +2236,9 @@ get_operand_type (id_base *op, const char *in_type,
|
||||||
else if (is_a <operator_id *> (op)
|
else if (is_a <operator_id *> (op)
|
||||||
&& strcmp (as_a <operator_id *> (op)->tcc, "tcc_comparison") == 0)
|
&& strcmp (as_a <operator_id *> (op)->tcc, "tcc_comparison") == 0)
|
||||||
return other_oprnd_type;
|
return other_oprnd_type;
|
||||||
|
else if (*op == COND_EXPR
|
||||||
|
&& pos == 0)
|
||||||
|
return "boolean_type_node";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Otherwise all types should match - choose one in order of
|
/* Otherwise all types should match - choose one in order of
|
||||||
|
|
@ -2319,7 +2323,7 @@ expr::gen_transform (FILE *f, int indent, const char *dest, bool gimple,
|
||||||
char dest[32];
|
char dest[32];
|
||||||
snprintf (dest, 32, "ops%d[%u]", depth, i);
|
snprintf (dest, 32, "ops%d[%u]", depth, i);
|
||||||
const char *optype
|
const char *optype
|
||||||
= get_operand_type (opr, in_type, expr_type,
|
= get_operand_type (opr, i, in_type, expr_type,
|
||||||
i == 0 ? NULL : op0type);
|
i == 0 ? NULL : op0type);
|
||||||
ops[i]->gen_transform (f, indent, dest, gimple, depth + 1, optype,
|
ops[i]->gen_transform (f, indent, dest, gimple, depth + 1, optype,
|
||||||
cinfo, indexes,
|
cinfo, indexes,
|
||||||
|
|
@ -3157,7 +3161,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result)
|
||||||
char dest[32];
|
char dest[32];
|
||||||
snprintf (dest, 32, "res_ops[%d]", j);
|
snprintf (dest, 32, "res_ops[%d]", j);
|
||||||
const char *optype
|
const char *optype
|
||||||
= get_operand_type (opr,
|
= get_operand_type (opr, j,
|
||||||
"type", e->expr_type,
|
"type", e->expr_type,
|
||||||
j == 0 ? NULL : "TREE_TYPE (res_ops[0])");
|
j == 0 ? NULL : "TREE_TYPE (res_ops[0])");
|
||||||
/* We need to expand GENERIC conditions we captured from
|
/* We need to expand GENERIC conditions we captured from
|
||||||
|
|
@ -3247,7 +3251,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result)
|
||||||
snprintf (dest, 32, "res_op%d", j);
|
snprintf (dest, 32, "res_op%d", j);
|
||||||
}
|
}
|
||||||
const char *optype
|
const char *optype
|
||||||
= get_operand_type (opr,
|
= get_operand_type (opr, j,
|
||||||
"type", e->expr_type,
|
"type", e->expr_type,
|
||||||
j == 0
|
j == 0
|
||||||
? NULL : "TREE_TYPE (res_op0)");
|
? NULL : "TREE_TYPE (res_op0)");
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-10-01 Richard Biener <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR middle-end/77798
|
||||||
|
* gfortran.fortran-torture/compile/pr77798.f90: New testcase.
|
||||||
|
|
||||||
2016-10-01 Andre Vehreschild <vehre@gcc.gnu.org>
|
2016-10-01 Andre Vehreschild <vehre@gcc.gnu.org>
|
||||||
|
|
||||||
PR fortran/77663
|
PR fortran/77663
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
subroutine foo(self,value)
|
||||||
|
integer(kind=kind(1)), dimension(:) :: self
|
||||||
|
integer(kind=kind(1)), intent(in) :: value
|
||||||
|
integer(kind=kind(1)) :: x,y,sign
|
||||||
|
intent(inout) :: self
|
||||||
|
integer(kind=kind(1)) :: len,i
|
||||||
|
|
||||||
|
len = size(self)
|
||||||
|
do i = 1,len
|
||||||
|
x = self(i)
|
||||||
|
if (x==0.0d0) cycle
|
||||||
|
y = abs(x)
|
||||||
|
sign = x/y
|
||||||
|
self(i) = sign*min(value,y)
|
||||||
|
end do
|
||||||
|
|
||||||
|
end subroutine
|
||||||
Loading…
Reference in New Issue