X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:mime-version
	:content-type:content-transfer-encoding; q=dns; s=default; b=mPF
	A8IReCEmW+ElZhebFvnrvWOd14+SwkcEL6x+RV3GafVYhKYBybW74Ll53dfXeFlN
	WW99MueUbRsSHOcakLUEB+jvt5ERGGXLPt+kzwHQ6kjMIckfp/8GU98Se1a6HkRp
	ra9oS4nHfpQjOFOhW5jMDpnV6uXY5d2hKLZZC5jA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:mime-version
	:content-type:content-transfer-encoding; s=default; bh=kLjIQaA1Q
	7VqEf0wKfwUxUFXNK0=; b=Tw/YQDhQ1fzbE+VYpvBveCm5ZW13waN8kNxz2oaXn
	wMIaskiItrDkvQ/IrccYl3XGGF+VTdiTBxJ9x4NVRkwc86hdWBKPANPwOniYPlI9
	o5/LfZSkRDsrselYaskYeO+Qlf7AfMMTbBV0mhtkQ0nLTBy45NtMt5LzDddnS5Bd
	hk=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_MX4 autolearn=no version=3.3.2 spammy=H*F:D*ne.jp, D*ne.jp
X-HELO: conssluserg-01.nifty.com
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com v6CDC7Nv023983
X-Nifty-SrcIP: [115.177.40.76]
Date: Wed, 12 Jul 2017 22:12:12 +0900
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Subject: 64 bit g++ 5.4.0 bug
Message-Id: <20170712221212.535f6c54545b1296142bab7c@nifty.ne.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Hello.

I have encountered a weird behaviour of g++ compiler.

If the following code is compiled with -ansi -O flags,
the resulting executable causes core dump.

This is caused only in 64 bit environment. In 32 bit
environment, it works as expected.

$ cat str.cc
#include <string>
int main()
{
        std::string s;
        s = "ABC";
        return 0;
}
$ g++ -ansi -O str.cc -o str
$ ./str
Abort (core dumped)
$

Is this known problem?

My environment is as follows.

uname -a
CYGWIN_NT-10.0 Express5800-S70 2.8.1(0.312/5/3) 2017-07-03 14:11 x86_64 Cygwin

g++ --version
g++ (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thank you in advance.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

