]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/30168 (C++ constructors can cause invalid gimple to happen with complex...
authorAndrew Pinski <pinskia@gmail.com>
Fri, 22 Dec 2006 07:30:55 +0000 (23:30 -0800)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Fri, 22 Dec 2006 07:30:55 +0000 (23:30 -0800)
2006-12-21  Andrew Pinski  <pinskia@gmail.com>

        PR C++/30168
        * optimize.c (update_cloned_parm): Copy DECL_GIMPLE_REG_P also.

2006-12-21  Andrew Pinski  <pinskia@gmail.com>

        PR C++/30168
        * g++.dg/opt/complex6.C: New test.

From-SVN: r120144

gcc/cp/ChangeLog
gcc/cp/optimize.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/complex6.C [new file with mode: 0644]

index 083b925201d6573ec14f87d57a2846c552d9cf93..caad0ec0fd52776cf7555d2d668d2a4475b165b1 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-21  Andrew Pinski  <pinskia@gmail.com>
+
+       PR C++/30168
+       * optimize.c (update_cloned_parm): Copy DECL_GIMPLE_REG_P also.
+
 2006-12-22  Kazu Hirata  <kazu@codesourcery.com>
 
        * decl.c: Fix a coment typo.
index 7ac24376ed1c6c5ab6b56ce11395fbf5a1fe9ea4..839c4e6b01253a59fc55211359acd04502ee122a 100644 (file)
@@ -69,6 +69,8 @@ update_cloned_parm (tree parm, tree cloned_parm, bool first)
   DECL_NAME (cloned_parm) = DECL_NAME (parm);
   DECL_SOURCE_LOCATION (cloned_parm) = DECL_SOURCE_LOCATION (parm);
   TREE_TYPE (cloned_parm) = TREE_TYPE (parm);
+
+  DECL_GIMPLE_REG_P (cloned_parm) = DECL_GIMPLE_REG_P (parm);
 }
 
 /* FN is a function that has a complete body.  Clone the body as
index 206b391c624003a21e5ff45bd62c7017e062fd84..f49fa37e2e9bd1f944f0fae1288aad3e926ea45c 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-21  Andrew Pinski  <pinskia@gmail.com>
+
+       PR C++/30168
+       * g++.dg/opt/complex6.C: New test.
+
 2006-12-22  Ben Elliston  <bje@au.ibm.com>
 
        * lib/gcc-dg.exp (gcc-dg-prune): Return "::unsupported::memory
diff --git a/gcc/testsuite/g++.dg/opt/complex6.C b/gcc/testsuite/g++.dg/opt/complex6.C
new file mode 100644 (file)
index 0000000..bedb3ed
--- /dev/null
@@ -0,0 +1,14 @@
+// PR 30168
+// { dg-do compile }
+// { dg-options "-O2" }
+
+struct aaa
+{
+      aaa(_Complex float __z) ;
+      _Complex float _M_value;
+};
+aaa::aaa(_Complex float __z)
+{
+  __z*=2.0f;
+  _M_value = __z;
+}