re PR tree-optimization/36922 (ICE in tree-data-ref.c with -ftree-loop-linear)
PR tree-optimization/36922 * tree-data-ref.c (initialize_matrix_A): Handle BIT_NOT_EXPR. * tree-scalar-evolution.c (interpret_rhs_expr, instantiate_scev_1): Likewise. * gfortran.dg/pr36922.f: New test. From-SVN: r144250
This commit is contained in:
parent
082d2ebb84
commit
418df9d79a
@ -1,3 +1,10 @@
|
||||
2009-02-18 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/36922
|
||||
* tree-data-ref.c (initialize_matrix_A): Handle BIT_NOT_EXPR.
|
||||
* tree-scalar-evolution.c (interpret_rhs_expr, instantiate_scev_1):
|
||||
Likewise.
|
||||
|
||||
2009-02-17 Richard Sandiford <rdsandiford@googlemail.com>
|
||||
|
||||
* config/mips/mips.c (mips_override_options): Set flag_dwarf2_cfi_asm
|
||||
|
@ -1,3 +1,8 @@
|
||||
2009-02-18 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/36922
|
||||
* gfortran.dg/pr36922.f: New test.
|
||||
|
||||
2009-02-17 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/39202
|
||||
|
16
gcc/testsuite/gfortran.dg/pr36922.f
Normal file
16
gcc/testsuite/gfortran.dg/pr36922.f
Normal file
@ -0,0 +1,16 @@
|
||||
C PR tree-optimization/36922
|
||||
C { dg-do compile }
|
||||
C { dg-options "-O2 -ftree-loop-linear" }
|
||||
SUBROUTINE PR36922(N,F,Z,C)
|
||||
IMPLICIT DOUBLE PRECISION(A-H,O-Z)
|
||||
DIMENSION C(23821),Z(0:2*N+1),F(0:2*N)
|
||||
I=0
|
||||
DO L=0,N
|
||||
DO M=0,L
|
||||
DO M2=M,L
|
||||
I=I+1
|
||||
C(I)=F(L+M)*F(L-M)*Z(L-M2)/(F(M2+M)*F(M2-M)*F(L-M2)*F(L-M2))
|
||||
ENDDO
|
||||
ENDDO
|
||||
ENDDO
|
||||
END
|
@ -1896,6 +1896,14 @@ initialize_matrix_A (lambda_matrix A, tree chrec, unsigned index, int mult)
|
||||
return chrec_convert (chrec_type (chrec), op, NULL);
|
||||
}
|
||||
|
||||
case BIT_NOT_EXPR:
|
||||
{
|
||||
/* Handle ~X as -1 - X. */
|
||||
tree op = initialize_matrix_A (A, TREE_OPERAND (chrec, 0), index, mult);
|
||||
return chrec_fold_op (MINUS_EXPR, chrec_type (chrec),
|
||||
build_int_cst (TREE_TYPE (chrec), -1), op);
|
||||
}
|
||||
|
||||
case INTEGER_CST:
|
||||
return chrec;
|
||||
|
||||
|
@ -1712,6 +1712,15 @@ interpret_rhs_expr (struct loop *loop, gimple at_stmt,
|
||||
fold_convert (type, integer_minus_one_node));
|
||||
break;
|
||||
|
||||
case BIT_NOT_EXPR:
|
||||
/* Handle ~X as -1 - X. */
|
||||
chrec1 = analyze_scalar_evolution (loop, rhs1);
|
||||
chrec1 = chrec_convert (type, chrec1, at_stmt);
|
||||
res = chrec_fold_minus (type,
|
||||
fold_convert (type, integer_minus_one_node),
|
||||
chrec1);
|
||||
break;
|
||||
|
||||
case MULT_EXPR:
|
||||
chrec1 = analyze_scalar_evolution (loop, rhs1);
|
||||
chrec2 = analyze_scalar_evolution (loop, rhs2);
|
||||
@ -2215,6 +2224,24 @@ instantiate_scev_1 (basic_block instantiate_below,
|
||||
|
||||
return chrec_convert (TREE_TYPE (chrec), op0, NULL);
|
||||
|
||||
case BIT_NOT_EXPR:
|
||||
/* Handle ~X as -1 - X. */
|
||||
op0 = instantiate_scev_1 (instantiate_below, evolution_loop,
|
||||
TREE_OPERAND (chrec, 0),
|
||||
fold_conversions, cache, size_expr);
|
||||
if (op0 == chrec_dont_know)
|
||||
return chrec_dont_know;
|
||||
|
||||
if (TREE_OPERAND (chrec, 0) != op0)
|
||||
{
|
||||
op0 = chrec_convert (type, op0, NULL);
|
||||
chrec = chrec_fold_minus (type,
|
||||
fold_convert (type,
|
||||
integer_minus_one_node),
|
||||
op0);
|
||||
}
|
||||
return chrec;
|
||||
|
||||
case SCEV_NOT_KNOWN:
|
||||
return chrec_dont_know;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user