re PR tree-optimization/24365 (statement makes a memory store with complex)

2006-01-13  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/24365
        * tree-inline.c (declare_return_variable): If the return variable
        was marked as a non gimple complex, set the return slot variable
        to be a non gimple comple variable.

2006-01-13  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/24365
        * g++.dg/opt/complex5.C: New test.

From-SVN: r109667
This commit is contained in:
Andrew Pinski 2006-01-13 14:30:08 +00:00 committed by Andrew Pinski
parent 690c6eacb1
commit 22918034f8
4 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2006-01-13 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/24365
* tree-inline.c (declare_return_variable): If the return variable
was marked as a non gimple complex, set the return slot variable
to be a non gimple comple variable.
2006-01-13 Richard Guenther <rguenther@suse.de>
* builtins.c (expand_builtin_sincos): New function.

View File

@ -1,3 +1,8 @@
2006-01-13 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/24365
* g++.dg/opt/complex5.C: New test.
2006-01-13 Richard Guenther <rguenther@suse.de>
* gcc.target/i386/387-9.c: New testcase.

View File

@ -0,0 +1,16 @@
// PR 24365
// { dg-do compile }
// { dg-options "-O2" }
typedef __complex__ double cdouble;
inline cdouble to_complex(double r) {
cdouble z;
__real__ z = r;
return z;
}
cdouble elt_zero() {
cdouble a = to_complex(0.0);
a+=1.0;
return a;
}

View File

@ -1233,6 +1233,10 @@ declare_return_variable (inline_data *id, tree return_slot_addr,
var = return_slot_addr;
else
var = build_fold_indirect_ref (return_slot_addr);
if (TREE_CODE (TREE_TYPE (result)) == COMPLEX_TYPE
&& !DECL_COMPLEX_GIMPLE_REG_P (result)
&& DECL_P (var))
DECL_COMPLEX_GIMPLE_REG_P (var) = 0;
use = NULL;
goto done;
}