aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/complex4.C16
-rw-r--r--gcc/tree-complex.c1
4 files changed, 28 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3fed47d..a1d36b9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a59b549..7d844ac 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..d6a0be2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/complex4.C
@@ -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;
+}
+
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index de23119..7fc7879 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -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: