From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11172 invoked by alias); 14 Aug 2014 18:55:55 -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 11144 invoked by uid 48); 14 Aug 2014 18:55:52 -0000 From: "ondrej.certik at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/62142] internal compiler error: Segmentation fault (X = X - L*floor(X/L)) Date: Thu, 14 Aug 2014 18:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ondrej.certik at gmail 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: Message-ID: In-Reply-To: References: 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: 2014-08/txt/msg00995.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D62142 --- Comment #1 from Ond=C5=99ej =C4=8Cert=C3=ADk --- One can actually isolate it even further (the same stacktrace): program test_segfault implicit none real, allocatable :: X(:) X =3D floor(X) end program >>From gcc-bugs-return-458499-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Aug 14 19:03:23 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 16292 invoked by alias); 14 Aug 2014 19:03:22 -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 16233 invoked by uid 48); 14 Aug 2014 19:03:15 -0000 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/62142] internal compiler error: Segmentation fault (X = X - L*floor(X/L)) Date: Thu, 14 Aug 2014 19:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org 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: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-08/txt/msg00996.txt.bz2 Content-length: 2049 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D62142 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #2 from kargl at gcc dot gnu.org --- (In reply to Ond=C5=99ej =C4=8Cert=C3=ADk from comment #0) > Created attachment 33327 [details] > Source file to reproduce the segfault >=20 > $ cat test_segfault.f90=20 > program test_segfault > implicit none > integer, parameter :: dp=3Dkind(0.d0) > real(dp) :: L > real(dp), allocatable :: X(:) > X =3D X - L*floor(X/L) > end program >=20 (snip) > When I execute "gfortran -v -save-temps test_segfault.f90", it doesn't > produce preprocessed sources, I assume the segfault happens in the parser= . I > have isolated the segfault, it happens in a large codebase and prevents i= ts > compilation (the array is allocated in our code, the above is the simplest > code to reproduce the problem). >=20 > This is my first bug report, please let me know if you need further > information. For such a short program, we don't necessarily need -save-temps. Note, your reduce test case is nonconforming code because it=20 uses L and X in a RHS expression without being defined. With the small change program test_segfault implicit none integer, parameter :: dp=3Dkind(0.d0) real(dp) :: L real(dp), allocatable :: X(:) L =3D 42 X =3D [1, 2] X =3D X - L*floor(X/L) end program the code is now conforming and it still exhibits the bug. I suspect that the bug is due to a combination of -frealloc-lhs and that floor is generated as inline code. With -frealloc-lhs, I get the same ICE that you find. With -fno-realloc-lhs, I get a compiled executable but it segfaults at runtime because x =3D [1,2] obviously won't work. If I add an allocate(x(2)) prior to=20 x =3D [1,2], then -fno-realloc-lhs produced executable runs as expected. So, as a workaround explicitly allocate memory and use -fno-realloc-lhs. >>From gcc-bugs-return-458500-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Aug 14 19:07:29 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 19719 invoked by alias); 14 Aug 2014 19:07: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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 19669 invoked by uid 48); 14 Aug 2014 19:07:23 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/62091] [5 Regression] ice in before_dom_children Date: Thu, 14 Aug 2014 19:07:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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: 2014-08/txt/msg00997.txt.bz2 Content-length: 538 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62091 --- Comment #5 from Jan Hubicka --- Created attachment 33329 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33329&action=edit Path I am testing The disagreemeng actually turned out to be subtle bug in tree-ssa-alias.c where function_entry_reached was incorrectly incorrectly initialized to false during recursive walk :( I am testing the following patch that makes us to not devirtualize in this case. We still ought to solve the visibility issues