objc/5956: selectors aren't matched properly when added to the selector table
alexander@malmberg.org
alexander@malmberg.org
Wed Mar 13 17:36:00 GMT 2002
>Number: 5956
>Category: objc
>Synopsis: selectors aren't matched properly when added to the selector table
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: pessimizes-code
>Submitter-Id: net
>Arrival-Date: Wed Mar 13 17:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Alexander Malmberg
>Release: gcc version 3.0.3
>Organization:
>Environment:
>Description:
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.
>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'.
>Fix:
Apply the patch.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gcc_selector_match.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcc_selector_match.patch"
SW5kZXg6IG9iamMtYWN0LmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2c3Jvb3QvZ2NjL2djYy9n
Y2Mvb2JqYy9vYmpjLWFjdC5jLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjY2LjIuNwpkaWZmIC11
IC1yMS42Ni4yLjcgb2JqYy1hY3QuYwotLS0gb2JqYy1hY3QuYwkyOSBKdW4gMjAwMSAxOToyMDo0
MyAtMDAwMAkxLjY2LjIuNworKysgb2JqYy1hY3QuYwk0IE1hciAyMDAyIDE1OjU4OjUyIC0wMDAw
CkBAIC0yMjM1LDcgKzIyMzUsNyBAQAogCiAgIHdoaWxlICgqY2hhaW4pCiAgICAgewotICAgICAg
aWYgKFRSRUVfUFVSUE9TRSAoKmNoYWluKSA9PSBpZGVudCAmJiBUUkVFX1ZBTFVFICgqY2hhaW4p
ID09IHByb3RvKQorICAgICAgaWYgKFRSRUVfUFVSUE9TRSAoKmNoYWluKSA9PSBwcm90byAmJiBU
UkVFX1ZBTFVFICgqY2hhaW4pID09IGlkZW50KQogCWdvdG8gcmV0dXJuX2F0X2luZGV4OwogCiAg
ICAgICBpbmRleCsrOwo=
More information about the Gcc-prs
mailing list