re PR c++/36185 (wrong code with -O2 -fgcse-sm)
authorKenneth Zadeck <zadeck@gcc.gnu.org>
Sat, 10 May 2008 20:28:19 +0000 (20:28 +0000)
committerKenneth Zadeck <zadeck@gcc.gnu.org>
Sat, 10 May 2008 20:28:19 +0000 (20:28 +0000)
2008-05-10  Kenneth Zadeck  <zadeck@naturalbridge.com>

    * gcse.c (store_killed_in_insn): Negated call to RTL_CONST_CALL_P.

2008-05-10  Kenneth Zadeck  <zadeck@naturalbridge.com>

PR rtl-optimization/36185
* g++.dg/opt/pr36185.C

From-SVN: r135159

gcc/ChangeLog
gcc/gcse.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr36185.C [new file with mode: 0644]

index b6b7521..c010057 100644 (file)
@@ -1,3 +1,7 @@
+2008-05-10  Kenneth Zadeck  <zadeck@naturalbridge.com>
+
+       * gcse.c (store_killed_in_insn): Negated call to RTL_CONST_CALL_P.
+               
 2008-05-10  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386.c (bdesc_ptest): Removed.
index e881e86..77efc44 100644 (file)
@@ -5987,7 +5987,7 @@ store_killed_in_insn (const_rtx x, const_rtx x_regs, const_rtx insn, int after)
     {
       /* A normal or pure call might read from pattern,
         but a const call will not.  */
-      if (RTL_CONST_CALL_P (insn))
+      if (!RTL_CONST_CALL_P (insn))
        return true;
 
       /* But even a const call reads its parameters.  Check whether the
index 395a041..06bfdf4 100644 (file)
@@ -1,9 +1,17 @@
+<<<<<<< .mine
+2008-05-10  Kenneth Zadeck  <zadeck@naturalbridge.com>
+
+       PR rtl-optimization/36185
+       * g++.dg/opt/pr36185.C
+
+=======
 2008-05-10  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
        * write_to_null.f90: Rename to write_to_null.F90.
        * write_to_null.F90: On Windows, "nul" is the equivalent of the
        Unix /dev/null.
 
+>>>>>>> .r135158
 2008-05-10  Richard Sandiford  <rdsandiford@googlemail.com>
 
        PR rtl-optimization/33642
diff --git a/gcc/testsuite/g++.dg/opt/pr36185.C b/gcc/testsuite/g++.dg/opt/pr36185.C
new file mode 100644 (file)
index 0000000..2ffa52f
--- /dev/null
@@ -0,0 +1,24 @@
+// PR rtl-optimization/36185
+// { dg-do run }
+// { dg-options "-O2 -fgcse-sm" }
+
+struct Base {
+        virtual ~Base() {}
+        virtual void f() = 0;
+};
+struct Derived : Base {
+        Derived();
+        virtual void f() {}
+};
+struct Foo {
+        Foo(Base&);
+};
+Derived::Derived() {
+        Foo foo(*this);
+}
+Foo::Foo(Base& base) {
+        base.f();
+}
+int main() {
+        Derived d;
+}