Bug 5956 - selectors aren't matched properly when added to the selector table
selectors aren't matched properly when added to the selector table
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: objc
3.0.3
: P3 normal
: ---
Assigned To: Nicola Pero
: missed-optimization
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2002-03-13 17:36 UTC by Alexander Malmberg
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
gcc_selector_match.patch (527 bytes, application/octet-stream)
2003-05-21 15:17 UTC, Alexander Malmberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Malmberg 2002-03-13 17:36:00 UTC
Due to a simple mixup, build_typed_selector_reference() won't properly match the new selector with existing selectors (TREE_PURPOSE() and TREE_VALUE()) are mixed up).

This doesn't cause incorrect code, but the selector tables are unnecessarily large; it bloats all objective-c code (by approximately 10% in the cases I've measured).

I've attached a patch that fixes this.

Release:
gcc version 3.0.3

How-To-Repeat:
Compile any program that contains two references to the same selector, eg:

[someobject foo];
[someobject foo];

The resulting selector table will have to entries for 'foo'.
Comment 1 Alexander Malmberg 2002-03-13 17:36:00 UTC
Fix:
Apply the patch.
Comment 2 Nicola Pero 2002-09-03 03:41:00 UTC
Responsible-Changed-From-To: unassigned->nicola
Responsible-Changed-Why: I managed it
Comment 3 Nicola Pero 2002-09-03 03:41:00 UTC
State-Changed-From-To: open->closed
State-Changed-Why: Thanks Alex - I had your patch (finally!) applied to GCC 3.3! :-)