public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: jakob@unthought.net
To: gcc-gnats@gcc.gnu.org
Subject: c++/6645: Bad code generation with -O1 and STL
Date: Mon, 13 May 2002 06:36:00 -0000	[thread overview]
Message-ID: <20020513133359.12794.qmail@sources.redhat.com> (raw)


>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=


             reply	other threads:[~2002-05-13 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-13  6:36 jakob [this message]
2002-09-15  4:44 nathan
2002-09-16 12:21 nathan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020513133359.12794.qmail@sources.redhat.com \
    --to=jakob@unthought.net \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).