re PR target/66655 (miscompilation due to ipa-ra on MinGW)
authorNick Clifton <nickc@redhat.com>
Tue, 26 Jan 2016 14:02:11 +0000 (14:02 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Tue, 26 Jan 2016 14:02:11 +0000 (14:02 +0000)
PR target/66655
* config/i386/winnt.c (i386_pe_binds_local_p): If a function has
been marked as DECL_ONE_ONLY but we do not the means to make it
so, then do not allow it to bind locally.

From-SVN: r232828

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

index e84acc123acaa6ee62716fdf119b645849cbff75..4dba48fa477f7d83a193e87b523e422aa3a25ac4 100644 (file)
@@ -1,3 +1,10 @@
+2016-01-26  Nick Clifton  <nickc@redhat.com>
+
+       PR target/66655
+       * config/i386/winnt.c (i386_pe_binds_local_p): If a function has
+       been marked as DECL_ONE_ONLY but we do not the means to make it
+       so, then do not allow it to bind locally.
+
 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
 
        PR lto/69254
index 53abf475bce961a1149adf09ae402d1d1d7e6abd..e2b2f4b516c0660247fcdb4cea53c7dc403ee413 100644 (file)
@@ -341,6 +341,20 @@ i386_pe_binds_local_p (const_tree exp)
       && TREE_PUBLIC (exp)
       && DECL_EXTERNAL (exp))
     return true;
+
+#ifndef MAKE_DECL_ONE_ONLY
+  /* PR target/66655: If a function has been marked as DECL_ONE_ONLY
+     but we do not the means to make it so, then do not allow it to
+     bind locally.  */
+  if (DECL_P (exp)
+      && TREE_CODE (exp) == FUNCTION_DECL
+      && TREE_PUBLIC (exp)
+      && DECL_ONE_ONLY (exp)
+      && ! DECL_EXTERNAL (exp)
+      && DECL_DECLARED_INLINE_P (exp))
+    return false;
+#endif
+  
   return default_binds_local_p_1 (exp, 0);
 }