re PR target/63977 (r217769 caused many failures)
authorRichard Henderson <rth@redhat.com>
Thu, 20 Nov 2014 14:13:04 +0000 (06:13 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 20 Nov 2014 14:13:04 +0000 (06:13 -0800)
PR target/63977

 * config/i386/i386.c (ix86_static_chain): Reinstate the check
 for DECL_STATIC_CHAIN.

From-SVN: r217853

gcc/ChangeLog
gcc/config/i386/i386.c

index 9aaac254e9da540ed58462c3f537af9044530fea..1c6a04dcfdc2440b44f307263b326c247f5febcc 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-20  Richard Henderson <rth@redhat.com>
+
+       PR target/63977
+       * config/i386/i386.c (ix86_static_chain): Reinstate the check
+       for DECL_STATIC_CHAIN.
+
 2014-11-20  Tejas Belagod  <tejas.belagod@arm.com>
 
        * config/aarch64/aarch64-protos.h (aarch64_classify_symbol):
index fffddfc7311fe5034920a19f3e96dd882cf58173..6c8dbd66811761ab6e453aed5dfbb32b899dddd8 100644 (file)
@@ -27360,6 +27360,12 @@ ix86_static_chain (const_tree fndecl_or_type, bool incoming_p)
 {
   unsigned regno;
 
+  /* While this function won't be called by the middle-end when a static
+     chain isn't needed, it's also used throughout the backend so it's
+     easiest to keep this check centralized.  */
+  if (DECL_P (fndecl_or_type) && !DECL_STATIC_CHAIN (fndecl_or_type))
+    return NULL;
+
   if (TARGET_64BIT)
     {
       /* We always use R10 in 64-bit mode.  */