]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/gcc-tumbl.git/commitdiff
PR c++/52582
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Mar 2012 14:21:12 +0000 (14:21 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Mar 2012 14:21:12 +0000 (14:21 +0000)
* config/rs6000/rs6000.c (call_ABI_of_interest): Return true
if c_node is NULL.

* g++.dg/opt/pr52582.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@185383 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr52582.C [new file with mode: 0644]

index 09240e1d2dc36dd90e71513ad239dcdbdae4033e..d85cd95557261921dac456273d55d7ecb9f63b40 100644 (file)
@@ -1,3 +1,9 @@
+2012-03-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/52582
+       * config/rs6000/rs6000.c (call_ABI_of_interest): Return true
+       if c_node is NULL.
+
 2012-03-13  Joseph Myers  <joseph@codesourcery.com>
 
        * doc/invoke.texi (-std=c99), doc/standards.texi (C language):
index c582c6f59ec3788af99d9eb8f6f8f57866d6064e..423adb22758886f674b948fc741342766d5b9313 100644 (file)
@@ -7452,6 +7452,9 @@ call_ABI_of_interest (tree fndecl)
       /* Interesting functions that we are emitting in this object file.  */
       c_node = cgraph_get_node (fndecl);
       c_node = cgraph_function_or_thunk_node (c_node, NULL);
+      if (c_node == NULL)
+       return true;
+
       return !cgraph_only_called_directly_p (c_node);
     }
   return false;
index 972616a15362f8c5a094b663f90a77f563e2f23a..6804db5e50d8d9b5793059f0ce0b3a0e86f8e520 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/52582
+       * g++.dg/opt/pr52582.C: New test.
+
 2012-03-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR target/52450
diff --git a/gcc/testsuite/g++.dg/opt/pr52582.C b/gcc/testsuite/g++.dg/opt/pr52582.C
new file mode 100644 (file)
index 0000000..4ba8a26
--- /dev/null
@@ -0,0 +1,28 @@
+// PR c++/52582
+// { dg-do compile }
+// { dg-options "-O2" }
+
+inline void *operator new (__SIZE_TYPE__, void *p) throw ()
+{
+  return p;
+}
+
+struct B
+{
+  virtual ~B ();
+  B ();
+};
+
+struct A : B
+{
+  A () : B () {}
+  virtual void bar ();
+};
+
+void
+foo ()
+{
+  char a[64];
+  B *b = new (&a) A ();
+  b->~B ();
+}