This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] for target/PR1704: ICE for tail call of regparm 3 and dllimport


Dllimport'd functions are called indirectly.  This patch checks that we
have a call-clobbered register available for the address of the
function when deciding if ok for sibcall..

Tested i686-pc-mingw32.

OK for mainline?


2005-01-30  Danny Smith  <>

        PR target/19704
        * config/i386/i386.c (ix86_function_ok_for_sibcall):  Also check
        that dllimport'd functions do not use all call-clobbered registers
        to pass parameters.

Index: config/i386/i386.c
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.792
diff -c -3 -p -r1.792 i386.c
*** config/i386/i386.c 28 Jan 2005 09:16:50 -0000 1.792
--- config/i386/i386.c 30 Jan 2005 19:32:09 -0000
*************** ix86_function_ok_for_sibcall (tree decl,
*** 1678,1683 ****
--- 1678,1690 ----
+   /* Dllimport'd functions are also called indirectly.  */
+   if (decl && lookup_attribute ("dllimport", DECL_ATTRIBUTES (decl))
+       && ix86_function_regparm (TREE_TYPE (decl), NULL) >= 3)
+     return false;
+ #endif
    /* Otherwise okay.  That also includes certain types of indirect calls.  */
    return true;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]