From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 750 invoked by alias); 31 May 2012 19:41:30 -0000 Received: (qmail 740 invoked by uid 22791); 31 May 2012 19:41:29 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_BG,TW_GM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 May 2012 19:41:16 +0000 From: "anlauf at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/53379] [4.7/4.8 Regression] No backtrace generated for array bounds violation Date: Thu, 31 May 2012 19:46: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gmx dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.1 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-05/txt/msg02967.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53379 --- Comment #7 from Harald Anlauf 2012-05-31 19:41:03 UTC --- (In reply to comment #2) > FWIW, if it is decided to change this, one could also consider changing > runtime_error() and internal_error() in the same way, though one would need to > audit the usage in libgfortran so that we don't generate a backtrace for a > "file not found" or similar "benign" error. Or in other words, "error > termination", as specified in the Fortran standard, should not lead to a > backtrace. See also the comment in runtime/error.c that talks about this. The patch in comment #1 changes only runtime_error_at, which appears to be generated by the front-end only. BTW: The program program test open(unit=10, file="/no/such/file", action='read') end program test gives with 4.7 and the patch in comment #1: At line 2 of file test.f90 (unit = 10, file = '') Fortran runtime error: File '/no/such/file' does not exist while 4.6.2 with -fbacktrace produces: At line 2 of file test.f90 (unit = 10, file = '') Fortran runtime error: File '/no/such/file' does not exist Backtrace for this error: + function test (0x80485F9) at line 3 of file test.f90 + /lib/libc.so.6(__libc_start_main+0xf3) [0xb73be003] The latter error is generated by a call to runtime_error_at in the compiled program, while the former error in open must be generated somewhere in st_open and descendants. Not relevant here, but note the missing file name in the first line of the error message.