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 objc/55572] New: -fobjc-direct-dispatch is not really implemented


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

             Bug #: 55572
           Summary: -fobjc-direct-dispatch is not really implemented
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tobias.netzel@googlemail.com


Created attachment 28858
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28858
Implementations for _objc_msgSend_Fast and _objc_assign_ivar_Fast

The switch causes the compiler to generate calls to builtins named
"_objc_msgSend_Fast" and "_objc_assign_ivar_Fast" but an implementation is
missing. Reading the comments those builtins were never meant to be implemented
but in Apple's PowerPC version of gcc those calls were replaced with simple
branch instructions to the hardcoded addresses 0xFFFEFF00 or 0xFFFEFEC0.

Now to me it seems there are two possibilites:
- do it the way Apple intented it to be done - maximum performance
- provide implementations for the builtins in the static libgcc

I tried the latter by simply adding the object file resulting from the attached
assembler code to the static libgcc using the "ar" command. That turns out to
work, although there's one additional branch instruction needed (and maybe
address loading instructions also).
In case that latter way is the preferred solution, the code that adds the call
to the builtin functions should be cleaned up.

I had this problem using gcc 4.7.2 but I'm quite sure this bug has been there
since -fobjc-direct-dispatch was merged from Apple's gcc branch.
Would be nice to have that corrected in the final version of gcc 4.6!


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