Blame SOURCES/gcc34-rh233941.patch
|
|
6fdc0f |
2007-04-02 Jakub Jelinek <jakub@redhat.com>
|
|
|
6fdc0f |
|
|
|
6fdc0f |
* expr.c (expand_expr_real) <case COMPLEX_EXPR>: Force op1
|
|
|
6fdc0f |
into register if target overlaps with op1.
|
|
|
6fdc0f |
|
|
|
6fdc0f |
* g77.f-torture/execute/20070402.f: New test.
|
|
|
6fdc0f |
|
|
|
6fdc0f |
--- gcc/expr.c.jj 2006-10-05 00:37:01.000000000 +0200
|
|
|
6fdc0f |
+++ gcc/expr.c 2007-04-02 13:28:52.000000000 +0200
|
|
|
6fdc0f |
@@ -8949,6 +8949,9 @@ expand_expr_real (tree exp, rtx target,
|
|
|
6fdc0f |
|
|
|
6fdc0f |
if (! target)
|
|
|
6fdc0f |
target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp)));
|
|
|
6fdc0f |
+ else if (GET_CODE (target) == MEM
|
|
|
6fdc0f |
+ && reg_overlap_mentioned_p (target, op1))
|
|
|
6fdc0f |
+ op1 = force_reg (mode, op1);
|
|
|
6fdc0f |
|
|
|
6fdc0f |
start_sequence ();
|
|
|
6fdc0f |
|
|
|
6fdc0f |
--- gcc/testsuite/g77.f-torture/execute/20070402.f.jj 2007-04-02 13:29:51.000000000 +0200
|
|
|
6fdc0f |
+++ gcc/testsuite/g77.f-torture/execute/20070402.f 2007-04-02 12:11:00.000000000 +0200
|
|
|
6fdc0f |
@@ -0,0 +1,21 @@
|
|
|
6fdc0f |
+ program rh233941
|
|
|
6fdc0f |
+ implicit none
|
|
|
6fdc0f |
+ complex*16 z
|
|
|
6fdc0f |
+ z = dcmplx(1.0, 2.0)
|
|
|
6fdc0f |
+ call sub(z)
|
|
|
6fdc0f |
+ stop
|
|
|
6fdc0f |
+ end program rh233941
|
|
|
6fdc0f |
+
|
|
|
6fdc0f |
+ subroutine sub(z)
|
|
|
6fdc0f |
+ implicit none
|
|
|
6fdc0f |
+ complex*16 z
|
|
|
6fdc0f |
+ z = dcmplx(-dimag(z), dreal(z))
|
|
|
6fdc0f |
+ call sub2(z)
|
|
|
6fdc0f |
+ return
|
|
|
6fdc0f |
+ end subroutine sub
|
|
|
6fdc0f |
+
|
|
|
6fdc0f |
+ subroutine sub2(z)
|
|
|
6fdc0f |
+ implicit none
|
|
|
6fdc0f |
+ complex*16 z
|
|
|
6fdc0f |
+ if (dreal(z).ne.-2.0.or.dimag(z).ne.1.0) call abort
|
|
|
6fdc0f |
+ end subroutine sub2
|