From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77803 invoked by alias); 16 Sep 2015 11:37:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 77739 invoked by uid 48); 16 Sep 2015 11:37:23 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/67600] [5/6 Regression] Segfault when assigning only one char to ostreambuf_iterator compiled with -O2 or -O3 Date: Wed, 16 Sep 2015 11:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-09/txt/msg01309.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67600 --- Comment #2 from Richard Biener --- It must conclude that : std::basic_ostringstream::basic_ostringstream (&ostr, 16); _52 = MEM[(char_type * *)&ostr + 48B]; _53 = MEM[(char_type * *)&ostr + 56B]; if (_52 < _53) goto ; else goto ; : *_52 = 88; _57 = MEM[(char_type * *)&ostr + 48B]; _58 = _57 + 1; MEM[(char_type * *)&ostr + 48B] = _58; goto ; : _65 = MEM[(struct basic_streambuf *)&ostr + 8B]._vptr.basic_streambuf; _66 = MEM[(int (*__vtbl_ptr_type) () *)_65 + 104B]; OBJ_TYPE_REF(_66;(struct basic_streambuf)&ostr._M_stringbuf->13) (&ostr._M_stringbuf, 88); the call in bb 4 is not possible thus the block gets unreachable.