public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* objc/6960: Compiler doesn't correct allocate object from -fconstant-string-class=
@ 2002-06-07  9:46 daa
  0 siblings, 0 replies; 2+ messages in thread
From: daa @ 2002-06-07  9:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6960
>Category:       objc
>Synopsis:       Compiler doesn't correct allocate object from -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:01 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=


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: objc/6960: Compiler doesn't correct allocate object from -fconstant-string-class=
@ 2002-09-01  5:22 nicola
  0 siblings, 0 replies; 2+ messages in thread
From: nicola @ 2002-09-01  5:22 UTC (permalink / raw)
  To: daa, gcc-bugs, gcc-prs, nicola, nobody

Synopsis: Compiler doesn't correct allocate object from -fconstant-string-class=

Responsible-Changed-From-To: unassigned->nicola
Responsible-Changed-By: nicola
Responsible-Changed-When: Sun Sep  1 05:22:13 2002
Responsible-Changed-Why:
    Looking at it
State-Changed-From-To: open->closed
State-Changed-By: nicola
State-Changed-When: Sun Sep  1 05:22:13 2002
State-Changed-Why:
    The compiler is working properly.  In the testcase, the
    NSObject class contains an additional field _info in the
    ivar layout, which causes NSConstantString to have an
    additional ivar in the layout, which is not allowed.  
    I understand the point, but unfortunately this is not 
    supposed to work - the NSConstantString class ivar layout 
    is fixed.  I also agree it should be documented better,
    but that's it.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6960


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-01 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-07  9:46 objc/6960: Compiler doesn't correct allocate object from -fconstant-string-class= daa
2002-09-01  5:22 nicola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).