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 b6b752159335ac63487c86c0ac2213b864e6c943..c01005769f0a361630b419304f97fa7d9c06b42d 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 e881e86764eef708849af881408a885b6e2a6917..77efc44769bc981a4268f1253269874854970d1f 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 395a041abe1bbb184c067709f0fa30e8fcf39d7b..06bfdf40277a7ba2d0476497e3da8f00a58c198e 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;
+}