re PR middle-end/39937 (Revision 146831 failed SPEC CPU 2006)

2009-04-28  Richard Guenther  <rguenther@suse.de>

	PR middle-end/39937
	* fold-const.c (fold_binary): Use distribute_real_division only
	on float types.

	* gfortran.fortran-torture/compile/pr39937.f: New testcase.

From-SVN: r146901
This commit is contained in:
Richard Guenther 2009-04-28 15:27:09 +00:00 committed by Richard Biener
parent 9a17c91def
commit e0dd989a1b
4 changed files with 42 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2009-04-28 Richard Guenther <rguenther@suse.de>
PR middle-end/39937
* fold-const.c (fold_binary): Use distribute_real_division only
on float types.
2009-04-28 Steve Ellcey <sje@cup.hp.com>
* config.gcc (hppa*64*-*-hpux11*): Set use_gcc_stdint and

View File

@ -10102,7 +10102,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
}
}
if (flag_unsafe_math_optimizations
if (flag_unsafe_math_optimizations
&& (TREE_CODE (arg0) == RDIV_EXPR || TREE_CODE (arg0) == MULT_EXPR)
&& (TREE_CODE (arg1) == RDIV_EXPR || TREE_CODE (arg1) == MULT_EXPR)
&& (tem = distribute_real_division (code, type, arg0, arg1)))
@ -10542,7 +10542,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
}
}
if (flag_unsafe_math_optimizations
if (FLOAT_TYPE_P (type)
&& flag_unsafe_math_optimizations
&& (TREE_CODE (arg0) == RDIV_EXPR || TREE_CODE (arg0) == MULT_EXPR)
&& (TREE_CODE (arg1) == RDIV_EXPR || TREE_CODE (arg1) == MULT_EXPR)
&& (tem = distribute_real_division (code, type, arg0, arg1)))

View File

@ -1,3 +1,8 @@
2009-04-28 Richard Guenther <rguenther@suse.de>
PR middle-end/39937
* gfortran.fortran-torture/compile/pr39937.f: New testcase.
2009-04-28 H.J. Lu <hongjiu.lu@intel.com>
g++.dg/warn/pr35652.C: Removed.

View File

@ -0,0 +1,28 @@
SUBROUTINE DTREVC( SIDE, HOWMNY, SELECT, N, T, LDT, VL, LDVL, VR,
$ LDVR, MM, M, WORK, INFO )
DOUBLE PRECISION T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ),
$ WORK( * )
DOUBLE PRECISION X( 2, 2 )
CALL DLALN2( .FALSE., 1, 1, SMIN, ONE, T( J, J ),
$ ZERO, X, 2, SCALE, XNORM, IERR )
CALL DSCAL( KI, SCALE, WORK( 1+N ), 1 )
DO 90 J = KI - 2, 1, -1
IF( J.GT.JNXT )
$ GO TO 90
JNXT = J - 1
IF( J.GT.1 ) THEN
IF( T( J, J-1 ).NE.ZERO ) THEN
IF( WORK( J ).GT.BIGNUM / XNORM ) THEN
X( 1, 1 ) = X( 1, 1 ) / XNORM
END IF
END IF
CALL DLALN2( .FALSE., 2, 2, SMIN, ONE,
$ T( J-1, J-1 ), LDT, ONE, ONE,
$ XNORM, IERR )
CALL DAXPY( J-2, -X( 1, 1 ), T( 1, J-1 ), 1,
$ WORK( 1+N ), 1 )
CALL DAXPY( J-2, -X( 2, 2 ), T( 1, J ), 1,
$ WORK( 1+N2 ), 1 )
END IF
90 CONTINUE
END