Author: pallavimathew
Date: 2011-06-02 13:13:11 -0400 (Thu, 02 Jun 2011)
New Revision: 3637

Modified:
   trunk/osprey-gcc-4.2.0/gcc/tree-inline.c
Log:
Failing testcase when compiled with 'openCC -Winline'

#include <xmmintrin.h>
typedef __m64 m64;

m64 add(const m64 &a, const m64 &b) {
                      return _mm_adds_pu16 (a, b);
}
int main()
{
                m64 a,b;
                add(a,b);
                return 0;
}


Problem/Fix Description

When compiled with -Winline, the above testcase gives the message

...lib/gcc/x86_64-redhat-linux/4.2.0/include/mmintrin.h: In function 'int 
__vector__ add(const int __vector__&, const int __vector__&)'
 .../lib/gcc/x86_64-redhat-linux/4.2.0/include/mmintrin.h:361: sorry, 
unimplemented: inlining failed in call to 'int __vector__ _mm_adds_pu16(int 
__vector__, int __vector__)': function not inlinable
<testcase>.cpp:5: sorry, unimplemented: called from here

gcc does not give and error message.

The problem is in file osprey-gcc-4.2.0/gcc/tree-inline.c, function
expand_call_inline.  The fix is to emit no (error or warning) message if the
function marked for inlining is declared in a system header file.

C.R. by Jian-Xin Lai and C. Bergstrom.


Modified: trunk/osprey-gcc-4.2.0/gcc/tree-inline.c
===================================================================
--- trunk/osprey-gcc-4.2.0/gcc/tree-inline.c    2011-06-01 18:06:08 UTC (rev 
3636)
+++ trunk/osprey-gcc-4.2.0/gcc/tree-inline.c    2011-06-02 17:13:11 UTC (rev 
3637)
@@ -2028,6 +2028,7 @@
     {
       if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn))
          /* Avoid warnings during early inline pass. */
+         && !DECL_IN_SYSTEM_HEADER (fn)
          && (!flag_unit_at_a_time || cgraph_global_info_ready))
        {
          sorry ("inlining failed in call to %q+F: %s", fn, reason);


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to