From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12386 invoked by alias); 24 Sep 2013 20:28:30 -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 12343 invoked by uid 48); 24 Sep 2013 20:28:26 -0000 From: "su at cs dot ucdavis.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/58522] New: ICE with segfault at -O3 on x86_64-linux-gnu Date: Tue, 24 Sep 2013 20:28:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: su at cs dot ucdavis.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-09/txt/msg01726.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58522 Bug ID: 58522 Summary: ICE with segfault at -O3 on x86_64-linux-gnu Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu The following code causes an ICE when compiled with the current gcc trunk at -O3 on x86_64-linux in both 32-bit and 64-bit modes.=20 This is a regression from 4.8.x.=20 $ gcc-trunk -v Using built-in specs. COLLECT_GCC=3Dgcc-trunk COLLECT_LTO_WRAPPER=3D/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux= -gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --enable-languages=3Dc,c++,objc,obj-c++,fortran,lto --enable-checking=3Drel= ease --with-gmp=3D/usr/local/gcc-trunk --with-mpfr=3D/usr/local/gcc-trunk --with-mpc=3D/usr/local/gcc-trunk --with-cloog=3D/usr/local/gcc-trunk --prefix=3D/usr/local/gcc-trunk Thread model: posix gcc version 4.9.0 20130924 (experimental) [trunk revision 202859] (GCC)=20 $=20 $ gcc-trunk -O2 small.c=20=20=20 $ gcc-4.8 -O3 small.c=20=20 $ gcc-trunk -O3 small.c small.c: In function =E2=80=98main=E2=80=99: small.c:13:1: internal compiler error: Segmentation fault main () ^ 0x8108ef crash_signal ../../gcc-trunk/gcc/toplev.c:335 0x83b957 ssa_default_def(function*, tree_node*) ../../gcc-trunk/gcc/tree-dfa.c:310 0x83bcc0 get_or_create_ssa_default_def(function*, tree_node*) ../../gcc-trunk/gcc/tree-dfa.c:362 0x8569ec get_reaching_def ../../gcc-trunk/gcc/tree-into-ssa.c:1184 0x85ca82 maybe_replace_use ../../gcc-trunk/gcc/tree-into-ssa.c:1791 0x85ca82 rewrite_update_stmt ../../gcc-trunk/gcc/tree-into-ssa.c:1974 0x85ca82 rewrite_update_dom_walker::before_dom_children(basic_block_def*) ../../gcc-trunk/gcc/tree-into-ssa.c:2150 0xb99ed7 dom_walker::walk(basic_block_def*) ../../gcc-trunk/gcc/domwalk.c:176 0x85560c rewrite_blocks ../../gcc-trunk/gcc/tree-into-ssa.c:2209 0x85bce6 update_ssa(unsigned int) ../../gcc-trunk/gcc/tree-into-ssa.c:3294 0x9826bd insert_range_assertions ../../gcc-trunk/gcc/tree-vrp.c:6103 0x9826bd execute_vrp ../../gcc-trunk/gcc/tree-vrp.c:9572 0x9826bd execute ../../gcc-trunk/gcc/tree-vrp.c:9673 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. $=20 ------------------------------------------- static int a, b; char *c; short *d, e; int f; short foo (int p1, int p2) { return p2 >=3D 0 || p1 > 1 >> p2 ? p1 : p1 << p2; } int main () { int *g =3D &f, h; for (b =3D 4; b; b--) { for (a =3D 0; a < 5; a++) { e =3D foo (h !=3D 0, *d); *g |=3D e; *d =3D 0; } *c =3D 0; } return 0; } >>From gcc-bugs-return-430487-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Sep 24 21:23:08 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 32007 invoked by alias); 24 Sep 2013 21:23:08 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 31938 invoked by uid 48); 24 Sep 2013 21:23:03 -0000 From: "schaub.johannes at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/36587] Feature: add warning for constructor call with discarded return. Date: Tue, 24 Sep 2013 21:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: schaub.johannes at googlemail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: 2013-09/txt/msg01727.txt.bz2 Content-length: 882 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587 Johannes Schaub changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schaub.johannes@googlemail. | |com --- Comment #7 from Johannes Schaub --- (In reply to Jonathan Wakely from comment #3) > This would have prevented bugs I've dealt with where critical sections where > not protected: > { > lock_guard (mutex); > // mutex NOT locked here! > } > Jonathan, unfortunately that code won't create and discard a temporary object, so I am not sure whether this patch would have caught the mistake of creating a default constructed lock_guard (whatever that means).