public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/6645: Bad code generation with -O1 and STL
@ 2002-05-13  6:36 jakob
  0 siblings, 0 replies; 3+ messages in thread
From: jakob @ 2002-05-13  6:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6645
>Category:       c++
>Synopsis:       Bad code generation with -O1 and STL
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 13 06:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     jakob@unthought.net
>Release:        3.1 20020507
>Organization:
>Environment:
RedHat Linux 7.2, ia-32
>Description:
g++ generates code causing a segfault in the attached example. It seems to be related to -felide-constructors, at least switching that off seems to fix the problem.

It seems that a std::~vector destructor is called either with it's this pointer set wrong, or simply called once too many (perhaps due to elided constructors?) - but I am guessing here...

Also, this is a regression from egcs-1.0.3.
>How-To-Repeat:
] g++ -O1 -o rc-crash rc-crash.cc 
] ./rc-crash
Before test insert
Segmentation fault (core dumped)
>Fix:
Workaround: Compile with -O1 -fno-elide-constructors
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="rc-crash.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="rc-crash.cc"

I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWFwPgojaW5jbHVkZSA8c3RyaW5nPgojaW5j
bHVkZSA8dmVjdG9yPgoKLy8KLy8gQ29tcGlsZSB3aXRoIC1PMQovLwovLyBTdXJ2aXZhbCB0cmlj
ayAjMToKLy8gIFVzZSAtZm5vLWVsaWRlLWNvbnN0cnVjdG9ycwovLwovLyBTdXJ2aXZhbCB0cmlj
ayAjMjoKLy8gIFVzZSAtRFRSSUNLX1hYWAovLwovLyBTdXJ2aXZhbCB0cmljayAjMzoKLy8gIFVz
ZSAtRFRSSUNLX1lZWQovLwoKCnN0cnVjdCB0aWRfdCB7CiAgaW5saW5lIGJvb2wgb3BlcmF0b3I8
IChjb25zdCB0aWRfdCAmdGhhdCkgY29uc3QKICB7CiAgICByZXR1cm4gZmFsc2U7CiAgfQojaWZk
ZWYgVFJJQ0tfWVlZCiAgaW50IHZhbDsKI2Vsc2UKICBzdGQ6OnZlY3RvcjxpbnQ+IHZhbDsKI2Vu
ZGlmCn07CgpzdHJ1Y3QgcmNfdCB7CiAgfnJjX3QoKSB7CiNpZmRlZiBUUklDS19YWFgKICAgIHN0
ZDo6bWFwPGludCwgaW50Pjo6Y29uc3RfaXRlcmF0b3IgZHVtbXk7CiNlbHNlCiAgICBzdGQ6Om1h
cDxpbnQsIGludD46Oml0ZXJhdG9yIGR1bW15OwojZW5kaWYKICAgIGR1bW15ID0gcHJvcGVydGll
cy5iZWdpbigpOwogICAgZHVtbXkgPSBwcm9wZXJ0aWVzLmVuZCgpOwogIH0KICBzdGQ6Om1hcDxp
bnQsIGludD4gcHJvcGVydGllczsKfTsKCnR5cGVkZWYgc3RkOjptYXA8dGlkX3QsIHJjX3Q+IHJj
X21hcF90OwoKaW50IG1haW4oKQp7CiAgcmNfbWFwX3QgcmVzX21hcDsKICBzdGQ6OmNlcnIgPDwg
IkJlZm9yZSB0ZXN0IGluc2VydCIgPDwgc3RkOjplbmRsOwogIHJlc19tYXAuaW5zZXJ0KHN0ZDo6
bWFrZV9wYWlyKHRpZF90KCksIHJjX3QoKSkpOwogIHN0ZDo6Y2VyciA8PCAiVGVzdCBpbnNlcnQg
ZG9uZSIgPDwgc3RkOjplbmRsOwogIHJldHVybiAwOwp9Cgo=


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

* Re: c++/6645: Bad code generation with -O1 and STL
@ 2002-09-16 12:21 nathan
  0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2002-09-16 12:21 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jakob, nobody

Synopsis: Bad code generation with -O1 and STL

State-Changed-From-To: analyzed->closed
State-Changed-By: nathan
State-Changed-When: Mon Sep 16 12:21:05 2002
State-Changed-Why:
    this is fixed in cvs

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


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

* Re: c++/6645: Bad code generation with -O1 and STL
@ 2002-09-15  4:44 nathan
  0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2002-09-15  4:44 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jakob, nobody

Synopsis: Bad code generation with -O1 and STL

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Sun Sep 15 04:44:52 2002
State-Changed-Why:
    confirmed as a regression, attached a slightly simpler
    test case

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


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

end of thread, other threads:[~2002-09-16 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-13  6:36 c++/6645: Bad code generation with -O1 and STL jakob
2002-09-15  4:44 nathan
2002-09-16 12:21 nathan

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).