]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cif-code.def (OVERWRITABLE): Correct the comment for overwritable function.
authorZhouyi Zhou <yizhouzhou@ict.ac.cn>
Wed, 10 Apr 2013 09:22:04 +0000 (09:22 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 10 Apr 2013 09:22:04 +0000 (09:22 +0000)
2013-04-10  Zhouyi Zhou <yizhouzhou@ict.ac.cn>

* cif-code.def (OVERWRITABLE): Correct the comment for overwritable
function.
* ipa-inline.c (can_inline_edge_p): Let dump mechanism report the
inline fail caused by overwritable functions.

* gcc.dg/tree-ssa/inline-11.c: New test

From-SVN: r197667

gcc/ChangeLog
gcc/cif-code.def
gcc/ipa-inline.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/inline-11.c [new file with mode: 0644]

index 3e3e3b7243f7f061550ed39857e1f2111a31053c..b8a67893a0a91668d0fb65433fa12e7057a98775 100644 (file)
@@ -1,3 +1,10 @@
+2013-04-10  Zhouyi Zhou <yizhouzhou@ict.ac.cn>
+
+       * cif-code.def (OVERWRITABLE): Correct the comment for overwritable
+       function.
+       * ipa-inline.c (can_inline_edge_p): Let dump mechanism report the
+       inline fail caused by overwritable functions.
+
 2013-04-10  Chung-Ju Wu  <jasonwucj@gmail.com>
 
        * combine.c (simplify_compare_const): Use GET_MODE_MASK to filter out
index 55e0ef45b3bba61a1f7507ec13fcce5a7cbe6a73..d1c4941732532a6626786969cbb17f072a84a352 100644 (file)
@@ -48,7 +48,7 @@ DEFCIFCODE(REDEFINED_EXTERN_INLINE,
 /* Function is not inlinable.  */
 DEFCIFCODE(FUNCTION_NOT_INLINABLE, N_("function not inlinable"))
 
-/* Function is not overwritable.  */
+/* Function is overwritable.  */
 DEFCIFCODE(OVERWRITABLE, N_("function body can be overwritten at link time"))
 
 /* Function is not an inlining candidate.  */
index 90b2a13fce9d58c5f4a1734118ee554df68ada9e..171d6a2266c560bdf562a4b42dd8db39da35d8b3 100644 (file)
@@ -266,7 +266,7 @@ can_inline_edge_p (struct cgraph_edge *e, bool report)
   else if (avail <= AVAIL_OVERWRITABLE)
     {
       e->inline_failed = CIF_OVERWRITABLE;
-      return false;
+      inlinable = false;
     }
   else if (e->call_stmt_cannot_inline_p)
     {
index 6b44c64351e18e3c386d8c8f173bdeaa3af9835e..13585fc07584321bb8c3cbead4fe6e588cb2300a 100644 (file)
@@ -1,3 +1,7 @@
+2013-04-10  Zhouyi Zhou <yizhouzhou@ict.ac.cn>
+
+       * gcc.dg/tree-ssa/inline-11.c: New test
+
 2013-04-10  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/56895
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c
new file mode 100644 (file)
index 0000000..7d45ec1
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-O2 -fdump-tree-einline" } */
+int w;
+int bar (void) __attribute__ ((weak));
+int bar (){
+  w++;
+}
+void foo()
+{
+  bar();
+}
+/* { dg-final { scan-tree-dump-times "function body can be overwritten at link time" 1 "einline" } } */
+/* { dg-final { cleanup-tree-dump "einline" } } */