OSDN Git Service

2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Oct 2005 14:26:36 +0000 (14:26 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Oct 2005 14:26:36 +0000 (14:26 +0000)
        PR middle-end/24362
        * g++.dg/opt/complex4.C: New test.
2005-10-28  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/24362
        * tree-complex.c (extract_component): Treat RESULT_DECL
        like the rest of the decls.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105930 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/complex4.C [new file with mode: 0644]
gcc/tree-complex.c

index 3fed47d..a1d36b9 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-28  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR middle-end/24362
+       * tree-complex.c (extract_component): Treat RESULT_DECL
+       like the rest of the decls.
+
 2005-10-25  Eric Botcazou  <ebotcazou@adacore.com>
 
        * config/ia64/ia64.c (ia64_output_function_profiler): Emit an
index a59b549..7d844ac 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-28  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR middle-end/24362
+       * g++.dg/opt/complex4.C: New test.
+
 2005-10-25  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.dg/nested-func-4.c: New test.
diff --git a/gcc/testsuite/g++.dg/opt/complex4.C b/gcc/testsuite/g++.dg/opt/complex4.C
new file mode 100644 (file)
index 0000000..d6a0be2
--- /dev/null
@@ -0,0 +1,16 @@
+// PR 24362
+// { dg-do compile }
+// { dg-options "-O2" }
+
+typedef __complex__ double cdouble;
+cdouble elt_zero();
+const cdouble *pointer();
+
+cdouble trace(void)
+{
+  cdouble output = elt_zero();
+  const cdouble *data = pointer();
+  output += data[1];
+  return output;
+}
+
index de23119..7fc7879 100644 (file)
@@ -558,6 +558,7 @@ extract_component (block_stmt_iterator *bsi, tree t, bool imagpart_p,
       return TREE_OPERAND (t, imagpart_p);
 
     case VAR_DECL:
+    case RESULT_DECL:
     case PARM_DECL:
     case INDIRECT_REF:
     case COMPONENT_REF: