This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug target/47822] [4.6 Regression] Multiple test suite failures due to revision 170321


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47822

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |*-darwin*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.02.20 14:48:01
          Component|lto                         |target
   Target Milestone|---                         |4.6.0
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-02-20 14:48:01 UTC ---
Hm.  The target builtins appear in BLOCK_VARs of DECL_INITIAL of the
TRANSLATION_UNIT_DECL.

There is appearantly a builtin for IX86_BUILTIN_MAX, which is obviously bogus.

Does darwin define additional target specific builtins that are not
covered by the builtin_decl target hook (that would be a bug anyway)?
It seems to do via

do {                                                            \
  darwin_init_cfstring_builtins ((unsigned) (IX86_BUILTIN_MAX));\
  darwin_rename_builtins ();                                    \
} while(0)

which will result in all programs using those builtins fail with LTO
in the same way (that all builtins are streamed in now via the
TU decl isn't optimal, but per-se not a bug).  The code doesn't even
save the builtin somewhere retrievable, so the following is obviously
not correct but solves the ICE:

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c    (revision 170336)
+++ config/i386/i386.c    (working copy)
@@ -25821,7 +25821,11 @@
 static tree
 ix86_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
 {
+#ifdef TARGET_MACHO
   if (code >= IX86_BUILTIN_MAX)
+    return implicit_built_in_decls[BUILT_IN_MEMSET];
+#endif
+  if (code >= IX86_BUILTIN_MAX)
     return error_mark_node;

   return ix86_builtins[code];

I think the darwin machinery should simply arrange to append to the
existing array, reserving an enum value if TARGET_MACHO (or sth other
appropriate) and store the decl there.

I will look into stripping out builtins from the TU BLOCK_VARS
(that won't solve the ICE when someone really uses that darwin builtin).


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