Commit b5c878a5 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/45578 (The polyhedron test mdbx is miscompiled with -O2…

re PR tree-optimization/45578 (The polyhedron test mdbx is miscompiled with -O2 -ftree-vectorize at revision 163915)

2010-09-08  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45578
	* tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr):
	Be more careful when transfering alignment information to
	the new induction variable.
	(copy_ref_info): Likewise.

	* gfortran.dg/pr45578.f90: New testcase.

From-SVN: r163997
parent 88a2722e
2010-09-08 Richard Guenther <rguenther@suse.de> 2010-09-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45578
* tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr):
Be more careful when transfering alignment information to
the new induction variable.
(copy_ref_info): Likewise.
2010-09-08 Richard Guenther <rguenther@suse.de>
* tree.h (TYPE_ORIG_SIZE_TYPE): Remove. * tree.h (TYPE_ORIG_SIZE_TYPE): Remove.
* c-typeck.c (comptypes_internal): Remove TYPE_ORIG_SIZE_TYPE * c-typeck.c (comptypes_internal): Remove TYPE_ORIG_SIZE_TYPE
checks. checks.
......
2010-09-08 Richard Guenther <rguenther@suse.de> 2010-09-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45578
* gfortran.dg/pr45578.f90: New testcase.
2010-09-08 Richard Guenther <rguenther@suse.de>
PR testsuite/45590 PR testsuite/45590
* gcc.dg/graphite/pr44391.c: Remove -m32 option. * gcc.dg/graphite/pr44391.c: Remove -m32 option.
......
! { dg-do run }
!*==CENTCM.spg processed by SPAG 6.55Dc at 09:26 on 23 Sep 2005
SUBROUTINE CENTCM
IMPLICIT DOUBLE PRECISION(A-H,O-Z)
PARAMETER (NM=16384)
PARAMETER (NG=100)
PARAMETER (NH=100)
PARAMETER (MU=20)
PARAMETER (NL=1)
PARAMETER (LL=10*NM)
PARAMETER (KP=2001,KR=2001,KG=2001)
COMMON /LCS / X0(3,-2:NM) , X(3,-2:NM,5) , XIN(3,-2:NM)
COMMON /MOLEC / LPBc(3) , MOLsp , MOLsa , NBX , NBY , NBZ , NPLa ,&
& LPBcsm
cm1 = 0.D0
cm2 = 0.D0
cm3 = 0.D0
DO i = 1 , MOLsa
cm1 = cm1 + X0(1,i)
cm2 = cm2 + X0(2,i)
cm3 = cm3 + X0(3,i)
ENDDO
cm1 = cm1/MOLsa
cm2 = cm2/MOLsa
cm3 = cm3/MOLsa
IF ( (cm1.EQ.0.D0) .AND. (cm2.EQ.0.D0) .AND. (cm3.EQ.0.D0) ) &
& RETURN
DO i = 1 , MOLsa
X0(1,i) = X0(1,i) - cm1
X0(2,i) = X0(2,i) - cm2
X0(3,i) = X0(3,i) - cm3
XIN(1,i) = XIN(1,i) - cm1
XIN(2,i) = XIN(2,i) - cm2
XIN(3,i) = XIN(3,i) - cm3
ENDDO
CONTINUE
END
PROGRAM test
IMPLICIT DOUBLE PRECISION(A-H,O-Z)
PARAMETER (NM=16384)
PARAMETER (NG=100)
PARAMETER (NH=100)
PARAMETER (MU=20)
PARAMETER (NL=1)
PARAMETER (LL=10*NM)
PARAMETER (KP=2001,KR=2001,KG=2001)
COMMON /LCS / X0(3,-2:NM) , X(3,-2:NM,5) , XIN(3,-2:NM)
COMMON /MOLEC / LPBc(3) , MOLsp , MOLsa , NBX , NBY , NBZ , NPLa ,&
& LPBcsm
MOLsa = 10
X0 = 1.
CALL CENTCM
END
...@@ -5863,7 +5863,16 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data, ...@@ -5863,7 +5863,16 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
comp = force_gimple_operand_gsi (&bsi, comp, true, NULL_TREE, comp = force_gimple_operand_gsi (&bsi, comp, true, NULL_TREE,
true, GSI_SAME_STMT); true, GSI_SAME_STMT);
if (POINTER_TYPE_P (TREE_TYPE (tgt))) if (POINTER_TYPE_P (TREE_TYPE (tgt)))
duplicate_ssa_name_ptr_info (comp, SSA_NAME_PTR_INFO (tgt)); {
duplicate_ssa_name_ptr_info (comp, SSA_NAME_PTR_INFO (tgt));
/* As this isn't a plain copy we have to reset alignment
information. */
if (SSA_NAME_PTR_INFO (comp))
{
SSA_NAME_PTR_INFO (comp)->align = BITS_PER_UNIT;
SSA_NAME_PTR_INFO (comp)->misalign = 0;
}
}
} }
if (gimple_code (use->stmt) == GIMPLE_PHI) if (gimple_code (use->stmt) == GIMPLE_PHI)
...@@ -5891,26 +5900,44 @@ copy_ref_info (tree new_ref, tree old_ref) ...@@ -5891,26 +5900,44 @@ copy_ref_info (tree new_ref, tree old_ref)
TREE_SIDE_EFFECTS (new_ref) = TREE_SIDE_EFFECTS (old_ref); TREE_SIDE_EFFECTS (new_ref) = TREE_SIDE_EFFECTS (old_ref);
TREE_THIS_VOLATILE (new_ref) = TREE_THIS_VOLATILE (old_ref); TREE_THIS_VOLATILE (new_ref) = TREE_THIS_VOLATILE (old_ref);
if (TREE_CODE (new_ref) == TARGET_MEM_REF) new_ptr_base = TREE_OPERAND (new_ref, 0);
new_ptr_base = TMR_BASE (new_ref);
else if (TREE_CODE (new_ref) == MEM_REF)
new_ptr_base = TREE_OPERAND (new_ref, 0);
/* We can transfer points-to information from an old pointer /* We can transfer points-to information from an old pointer
or decl base to the new one. */ or decl base to the new one. */
if (new_ptr_base if (new_ptr_base
&& TREE_CODE (new_ptr_base) == SSA_NAME && TREE_CODE (new_ptr_base) == SSA_NAME
&& POINTER_TYPE_P (TREE_TYPE (new_ptr_base))
&& !SSA_NAME_PTR_INFO (new_ptr_base)) && !SSA_NAME_PTR_INFO (new_ptr_base))
{ {
tree base = get_base_address (old_ref); tree base = get_base_address (old_ref);
if (!base) if (!base)
; ;
else if ((INDIRECT_REF_P (base) else if ((TREE_CODE (base) == MEM_REF
|| TREE_CODE (base) == MEM_REF) || TREE_CODE (base) == TARGET_MEM_REF)
&& TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME) && TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME
duplicate_ssa_name_ptr_info && SSA_NAME_PTR_INFO (TREE_OPERAND (base, 0)))
(new_ptr_base, SSA_NAME_PTR_INFO (TREE_OPERAND (base, 0))); {
struct ptr_info_def *new_pi;
duplicate_ssa_name_ptr_info
(new_ptr_base, SSA_NAME_PTR_INFO (TREE_OPERAND (base, 0)));
new_pi = SSA_NAME_PTR_INFO (new_ptr_base);
/* We have to be careful about transfering alignment information. */
if (TREE_CODE (old_ref) == MEM_REF
&& !(TREE_CODE (new_ref) == TARGET_MEM_REF
&& (TMR_INDEX2 (new_ref)
|| (TMR_STEP (new_ref)
&& (TREE_INT_CST_LOW (TMR_STEP (new_ref))
< new_pi->align)))))
{
new_pi->misalign += double_int_sub (mem_ref_offset (old_ref),
mem_ref_offset (new_ref)).low;
new_pi->misalign &= (new_pi->align - 1);
}
else
{
new_pi->align = BITS_PER_UNIT;
new_pi->misalign = 0;
}
}
else if (TREE_CODE (base) == VAR_DECL else if (TREE_CODE (base) == VAR_DECL
|| TREE_CODE (base) == PARM_DECL || TREE_CODE (base) == PARM_DECL
|| TREE_CODE (base) == RESULT_DECL) || TREE_CODE (base) == RESULT_DECL)
......
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