Commit f46fe0e6 by Andrew Pinski Committed by Andrew Pinski

re PR middle-end/32417 (416.gamess ICEs (in aff_combination_add_elt, tree-affine.c))

2007-06-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/32417
        * tree-affine.c (aff_combination_add_elt): Handle
        pointer addition specially.

2007-06-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/32417
        * gfortran.fortran-torture/compile/pr32417.f90: New test.

From-SVN: r126082
parent 5346c75c
2007-06-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/32417
* tree-affine.c (aff_combination_add_elt): Handle
pointer addition specially.
2007-06-28 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/rs6000.c (rs6000_function_ok_for_sibcall): Ensure
......
2007-06-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/32417
* gfortran.fortran-torture/compile/pr32417.f90: New test.
2007-06-28 Dorit Nuzman <dorit@il.ibm.com>
* gcc.dg/vect/vect-iv-4.c: Test now passes on vect_pack_trunc
! PR tree-opt/32417
! this used to crash while running IV-opts
! aff_combination_add_elt was not ready to handle pointers correctly
SUBROUTINE ONEINTS()
COMMON /INFOA / NAT,NUM
DIMENSION TINT(NUM*NUM,NAT,3,3,3),TINTM(NUM,NUM,NAT,3,3,3)
CALL TINTS(IC)
DO ID=1,3
DO IC=1,NAT
TINTM(J,I,IC,IAN,INU,ID) = TINT((I-1)*NUM+J,IC,IAN,INU,ID)
ENDDO
ENDDO
END
......@@ -130,6 +130,7 @@ void
aff_combination_add_elt (aff_tree *comb, tree elt, double_int scale)
{
unsigned i;
tree type;
scale = double_int_ext_for_comb (scale, comb);
if (double_int_zero_p (scale))
......@@ -169,15 +170,26 @@ aff_combination_add_elt (aff_tree *comb, tree elt, double_int scale)
return;
}
type = comb->type;
if (POINTER_TYPE_P (type))
type = sizetype;
if (double_int_one_p (scale))
elt = fold_convert (comb->type, elt);
elt = fold_convert (type, elt);
else
elt = fold_build2 (MULT_EXPR, comb->type,
fold_convert (comb->type, elt),
double_int_to_tree (comb->type, scale));
elt = fold_build2 (MULT_EXPR, type,
fold_convert (type, elt),
double_int_to_tree (type, scale));
if (comb->rest)
comb->rest = fold_build2 (PLUS_EXPR, comb->type, comb->rest, elt);
{
if (POINTER_TYPE_P (comb->type))
comb->rest = fold_build2 (POINTER_PLUS_EXPR, comb->type,
comb->rest, elt);
else
comb->rest = fold_build2 (PLUS_EXPR, comb->type, comb->rest,
elt);
}
else
comb->rest = elt;
}
......
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