PR optimization/5999, middle-end/5731

PR optimization/5999, middle-end/5731
	* expr.c (expand_expr) [RDIV_EXPR]: Only convert real divisions into
	multiplications by reciprocals.

	* gcc.c-torture/compile/20020319-1.c: New test.

From-SVN: r51040
This commit is contained in:
Dale Johannesen 2002-03-19 22:17:44 +01:00 committed by Jakub Jelinek
parent 865436117c
commit 689f6d25b9
4 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2002-03-19 Dale Johannesen <dalej@apple.com>
PR optimization/5999, middle-end/5731
* expr.c (expand_expr) [RDIV_EXPR]: Only convert real divisions into
multiplications by reciprocals.
2002-03-19 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.md (adddi3, adddi_carry, subdi3,

View File

@ -7741,6 +7741,7 @@ expand_expr (exp, target, tmode, modifier)
expensive divide. If not, combine will rebuild the original
computation. */
if (flag_unsafe_math_optimizations && optimize && !optimize_size
&& TREE_CODE (type) == REAL_TYPE
&& !real_onep (TREE_OPERAND (exp, 0)))
return expand_expr (build (MULT_EXPR, type, TREE_OPERAND (exp, 0),
build (RDIV_EXPR, type,

View File

@ -4,6 +4,8 @@
* gcc.dg/struct-by-value-1.c: New test.
* gcc.c-torture/compile/20020319-1.c: New test.
2002-03-18 Neil Booth <neil@daikokuya.demon.co.uk>
* gcc.dg/cpp/wchar-1.c: Fix test.

View File

@ -0,0 +1,10 @@
/* PR optimization/5999
This testcase ICEd because one a/b -> a * (1/b) optimization
did not handle complex divides. */
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math" } */
__complex__ double foo (__complex__ double x, __complex__ double y)
{
return x / y;
}