This is the mail archive of the gcc-prs@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]

objc/6962: Compiler doesn't correct allocate object for -fconstant-string-class=


>Number:         6962
>Category:       objc
>Synopsis:       Compiler doesn't correct allocate object for -fconstant-string-class=
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 07 09:46:03 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Aleksey Dukhnyakov
>Release:        unknown-1.0
>Organization:
>Environment:
Redhat Linux
>Description:
Compiler doesn't correct allocate object :

Please see minimized testcase bug1.m:

$ gcc -v
Reading specs from /home/daa/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ./configure  : (reconfigured) ./configure
Thread model: single
gcc version 3.1
$ gcc bug2.m -fconstant-string-class=NSConstantString -lobjc
bug2.m:1:2: warning: #import is obsolete, use an #ifndef wrapper in the header f
ile
$ a.out
isa=0x8055c40
_info=134556911
buffer=0x5
length=0
str=Hello len=5

As you can see compiler writes buffer to _info and length to buffer.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bug2.m"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug2.m"

I2ltcG9ydCA8b2JqYy9vYmpjLmg+DQoNCkBpbnRlcmZhY2UgTlNPYmplY3Qgew0KQHB1YmxpYyAN
CiAgICBDbGFzcyAgIGlzYTsNCiAgICB1bnNpZ25lZCBpbnQgX2luZm87IA0KfQ0KQGVuZA0KDQpA
aW50ZXJmYWNlIE5TQ29uc3RhbnRTdHJpbmcgOiBOU09iamVjdCB7DQpAcHVibGljDQogICBjaGFy
ICpidWZmZXI7DQogICB1bnNpZ25lZCBpbnQgbGVuZ3RoOw0KfQ0KLSAodW5zaWduZWQgaW50KSBs
ZW5ndGg7DQotIChjaGFyICopIGNTdHJpbmc7DQpAZW5kDQoNCkBpbXBsZW1lbnRhdGlvbiBOU09i
amVjdA0KQGVuZA0KDQpAaW1wbGVtZW50YXRpb24gTlNDb25zdGFudFN0cmluZw0KLSAodW5zaWdu
ZWQgaW50KSBsZW5ndGggeyByZXR1cm4gc2VsZi0+bGVuZ3RoIDsgfQ0KLSAoY2hhciAqKSBjU3Ry
aW5nIHsgcmV0dXJuIHNlbGYtPmJ1ZmZlciA7IH0NCkBlbmQNCg0KaW50IG1haW4oKQ0Kew0KICAg
IE5TQ29uc3RhbnRTdHJpbmcgKiBzdHIgPSBAIkhlbGxvIjsgDQogICAgcHJpbnRmKCJpc2E9MHgl
eFxuX2luZm89JWRcbmJ1ZmZlcj0weCV4XG5sZW5ndGg9JWRcbiIsc3RyLT5pc2Esc3RyLT5faW5m
byxzdHItPmJ1ZmZlcixzdHItPmxlbmd0aCk7DQoNCiAgICBwcmludGYoInN0cj0lcyBsZW49JWRc
biIsKGNoYXIgKilzdHItPl9pbmZvLCh1bnNpZ25lZCBpbnQpc3RyLT5idWZmZXIpOw0KICAgIA0K
ICAgIHJldHVybiAwOw0KfQ0KDQo=


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