[llvm-branch-commits] [llvm-gcc-branch] r75693 - /llvm-gcc-4.2/branches/Apple/Bender-SWB/gcc/function.c

Bill Wendling isanbard at gmail.com
Tue Jul 14 15:52:43 PDT 2009

Author: void
Date: Tue Jul 14 17:52:43 2009
New Revision: 75693

URL: http://llvm.org/viewvc/llvm-project?rev=75693&view=rev
--- Merging r74475 into 'gcc/function.c':
U    gcc/function.c

LLVM's optimizer does the inlining of "always_inline" functions. A function that
returns an aggregate value may not be a problem in this case. The GCC inliner
would normally inline these functions, and, if there are no more uses of said
function, remove it entirely so that it would never hit this warning.

For LLVM, check that the function is *not* marked "always_inline" before issuing
the warning.


Modified: llvm-gcc-4.2/branches/Apple/Bender-SWB/gcc/function.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Bender-SWB/gcc/function.c?rev=75693&r1=75692&r2=75693&view=diff

--- llvm-gcc-4.2/branches/Apple/Bender-SWB/gcc/function.c (original)
+++ llvm-gcc-4.2/branches/Apple/Bender-SWB/gcc/function.c Tue Jul 14 17:52:43 2009
@@ -3985,7 +3985,13 @@
   /* LLVM LOCAL end */
   /* Warn if this value is an aggregate type,
      regardless of which calling convention we are using for it.  */
+  /* LLVM LOCAL begin - <rdar://problem/7011331> */
+      && !lookup_attribute ("always_inline", DECL_ATTRIBUTES (subr))
+      )
+  /* LLVM LOCAL end - <rdar://problem/7011331> */
     warning (OPT_Waggregate_return, "function returns an aggregate");

More information about the llvm-branch-commits mailing list