From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15794 invoked by alias); 14 May 2011 15:50:38 -0000 Received: (qmail 15772 invoked by uid 22791); 14 May 2011 15:50:36 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-pw0-f47.google.com (HELO mail-pw0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 May 2011 15:50:22 +0000 Received: by pwj9 with SMTP id 9so1795797pwj.20 for ; Sat, 14 May 2011 08:50:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.36.234 with SMTP id t10mr3830514pbj.361.1305388221340; Sat, 14 May 2011 08:50:21 -0700 (PDT) Received: by 10.68.42.197 with HTTP; Sat, 14 May 2011 08:50:21 -0700 (PDT) In-Reply-To: <4DCEA141.20205@net-b.de> References: <4DCE58A9.3030409@net-b.de> <4DCEA141.20205@net-b.de> Date: Sat, 14 May 2011 19:44:00 -0000 Message-ID: Subject: Re: [Patch, libfortran] PR 48915 Fix incorrect return code with -fdump-core, error handling changes From: Janne Blomqvist To: Tobias Burnus Cc: Fortran List , GCC Patches Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01053.txt.bz2 On Sat, May 14, 2011 at 18:35, Tobias Burnus wrote: > Janne Blomqvist wrote: >> >> > =C2=A0I disagree with the ERROR STOP change. >> My thinking is that the spirit of ERROR STOP is that the program >> noticed something went seriously wrong (e.g. program state corrupted >> in some way), and =C2=A0hence a backtrace and/or core dump might help >> figure out what went wrong. For less serious errors, there's the plain >> STOP. Similar to how in C there's exit() and abort(). > > Well, typical usages would be: > =C2=A0STOP "Calculation finished" > and > =C2=A0ERROR STOP "No input file found" > > Admittedly, STOP is also used for the latter as there was no ERROR STOP > until Fortran 2008 - and when using numerical arguments, the value is also > used as exit status code - with string values, which are rather common, S= TOP > has always the success exit status code 0. > > Especially with coarrays, one cannot easily prevent the usage of ERROR ST= OP: > Assume that this_image() > 1 processes wait for process 1 ("SYNC IMAGES(1= )") > to read in the data and to broadcast it. Now, process 1 sees that there is > no input file - what shell it do? A STOP would cause a dead lock. Thus, o= ne > simply calls ERROR STOP "No input file" - and does not want to have a > backtrace ... Good point. Color me convinced. --=20 Janne Blomqvist