This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, libfortran] PR 48915 Fix incorrect return code with -fdump-core, error handling changes


On Sat, May 14, 2011 at 18:35, Tobias Burnus <burnus@net-b.de> wrote:
> Janne Blomqvist wrote:
>>
>> > ÂI 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 Âhence 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:
> ÂSTOP "Calculation finished"
> and
> ÂERROR 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, STOP
> has always the success exit status code 0.
>
> Especially with coarrays, one cannot easily prevent the usage of ERROR STOP:
> 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, one
> simply calls ERROR STOP "No input file" - and does not want to have a
> backtrace ...

Good point.

Color me convinced.



-- 
Janne Blomqvist


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]