public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43851]  New: Add _gfortran_error_stop_numeric
@ 2010-04-22 13:23 burnus at gcc dot gnu dot org
  2010-04-22 13:31 ` [Bug fortran/43851] " burnus at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-04-22 13:23 UTC (permalink / raw)
  To: gcc-bugs

There are two STOP statements in Fortran:
  STOP <constant default-integer-expr> or <constant string-expr>
  ERROR STOP <constant default-integer-expr> or <constant string-expr>

The first one is for normal stopping of the program, the second one for error
abort. This works in so far that ERROR STOP "string" returns a non-zero exit
status code and STOP "string" returns zero. (The numeric version returns the
number.)

However, the text output is different. For string one gets:
  STOP my string
  ERROR STOP my string
but for numeric output one just gets
  STOP 1
i.e. always "STOP" and never "ERROR STOP". The reason is that a
_gfortran_error_stop_numeric function is missing.


-- 
           Summary: Add _gfortran_error_stop_numeric
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
@ 2010-04-22 13:31 ` burnus at gcc dot gnu dot org
  2010-05-08 13:06 ` jvdelisle at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-04-22 13:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2010-04-22 13:30 -------
Additionally, the (ERROR) STOP output should be printed to STDERR and not to
STDOUT per:

"8.4 STOP and ERROR STOP statements" (F2008 FDIS):

"If any exception (cf. 14 Exceptions and IEEE arithmetic) is signaling on that
image, the processor shall issue a warning indicating which exceptions are
signaling; this warning shall be on the unit identified by the named constant
ERROR_UNIT (13.8.2.8). It is recommended that the stop code is made available
by formatted output to the same unit."


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
  2010-04-22 13:31 ` [Bug fortran/43851] " burnus at gcc dot gnu dot org
@ 2010-05-08 13:06 ` jvdelisle at gcc dot gnu dot org
  2010-05-13 16:58 ` jvdelisle at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-05-08 13:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2010-05-08 13:06 -------
Working on it.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-05-08 13:06:11
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
  2010-04-22 13:31 ` [Bug fortran/43851] " burnus at gcc dot gnu dot org
  2010-05-08 13:06 ` jvdelisle at gcc dot gnu dot org
@ 2010-05-13 16:58 ` jvdelisle at gcc dot gnu dot org
  2010-05-20  4:45 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-05-13 16:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2010-05-13 16:58 -------
I have a revised patch that handles default integer and negative error codes.

It is testing and I will submit when I get an opportunity.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-05-13 16:58 ` jvdelisle at gcc dot gnu dot org
@ 2010-05-20  4:45 ` jvdelisle at gcc dot gnu dot org
  2010-05-20  7:40 ` burnus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-05-20  4:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2010-05-20 04:44 -------
Subject: Bug 43851

Author: jvdelisle
Date: Thu May 20 04:44:11 2010
New Revision: 159609

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159609
Log:
2010-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>

        PR fortran/43851
        * runtime/stop.c (error_stop_numeric): New function and updated
comment.
        Add declaration for stop_numeric and remove declaration for
stop_string.
        (stop_string): Use for blank STOP.
        (stop_numeric): Remove use of special -1 stop code.
        * runtime/pause.c (do_pause): Use stop_string for blank stop.
        (pause_numeric): Remove use of special -1 pause code.
        * gfortran.map: Add new symbol to run-time library.
        * libgfortran.h: Move declaration for stop_string to here to make
        function visible for do_pause. Remove declaration for stop_numeric.

2010-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>

        PR fortran/43851
        * trans-stmt.c (gfc_trans_stop): Add generation of call to
        gfortran_error_stop_numeric. Fix up some whitespace. Use stop_string
for
        blank STOP, handling a null expression. (gfc_trans_pause): Use
        pause_string for blank PAUSE.
        * trans.h: Add external function declaration for error_stop_numeric.
        * trans-decl.c (gfc_build_builtin_function_decls): Add the building of
        the declaration for the library call. Adjust whitespaces.
        * match.c (gfc_match_stopcode): Remove use of the actual stop code to
        signal no stop code. Match the expression following the stop and pass
        that to the translators. Remove the old use of digit matching.  Add
        checks that the stop_code expression is INTEGER or CHARACTER, constant,
        and if CHARACTER, default character KIND.

2010-05-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>

        PR fortran/43851
        * gfortran.dg/label_1.f90: Update test.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/fortran/trans-stmt.c
    trunk/gcc/fortran/trans.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/label_1.f90
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/gfortran.map
    trunk/libgfortran/libgfortran.h
    trunk/libgfortran/runtime/pause.c
    trunk/libgfortran/runtime/stop.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-05-20  4:45 ` jvdelisle at gcc dot gnu dot org
@ 2010-05-20  7:40 ` burnus at gcc dot gnu dot org
  2010-05-20 13:33 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-05-20  7:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from burnus at gcc dot gnu dot org  2010-05-20 07:40 -------
TODO: Constraint checks are missing and partially incorrect,
cf. http://gcc.gnu.org/ml/fortran/2010-05/msg00225.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-05-20  7:40 ` burnus at gcc dot gnu dot org
@ 2010-05-20 13:33 ` jvdelisle at gcc dot gnu dot org
  2010-05-20 19:40 ` jvdelisle at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-05-20 13:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2010-05-20 13:33 -------
Also have one tweak to do for blank STOP which I will fix shortly and add some
test cases.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-05-20 13:33 ` jvdelisle at gcc dot gnu dot org
@ 2010-05-20 19:40 ` jvdelisle at gcc dot gnu dot org
  2010-05-23  0:01 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-05-20 19:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jvdelisle at gcc dot gnu dot org  2010-05-20 19:40 -------
Subject: Bug 43851

Author: jvdelisle
Date: Thu May 20 19:40:30 2010
New Revision: 159638

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159638
Log:
2010-05-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>

        PR fortran/43851
        * runtime/stop.c (stop_string): Make sure nothing is emitted for
        blank stop.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/runtime/stop.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2010-05-20 19:40 ` jvdelisle at gcc dot gnu dot org
@ 2010-05-23  0:01 ` jvdelisle at gcc dot gnu dot org
  2010-06-06  6:10 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-05-23  0:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jvdelisle at gcc dot gnu dot org  2010-05-23 00:00 -------
Subject: Bug 43851

Author: jvdelisle
Date: Sun May 23 00:00:17 2010
New Revision: 159747

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159747
Log:
2010-05-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>

        PR fortran/43851
        * match.c (gfc_match_stopcode): Use gfc_match_init_expr. Go to cleanup
        before returning MATCH_ERROR. Add check for scalar. Add check for
        default integer kind.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/match.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2010-05-23  0:01 ` jvdelisle at gcc dot gnu dot org
@ 2010-06-06  6:10 ` jvdelisle at gcc dot gnu dot org
  2010-07-19 13:48 ` burnus at gcc dot gnu dot org
  2010-07-20  1:08 ` jvdelisle at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-06-06  6:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jvdelisle at gcc dot gnu dot org  2010-06-06 06:10 -------
There is one last improvement we can do here.  Currently we are using
gfc_match_init_expr.  This works fine, but the error messages are worded toward
initialization expressions and not stop codes.  We could generalize the
messages in gfc_match_init_expr or come up with a way to either signal a
different message for a stop code or create a new function such as
gfc_match_stopcode_expr.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2010-06-06  6:10 ` jvdelisle at gcc dot gnu dot org
@ 2010-07-19 13:48 ` burnus at gcc dot gnu dot org
  2010-07-20  1:08 ` jvdelisle at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-19 13:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from burnus at gcc dot gnu dot org  2010-07-19 13:47 -------
(In reply to comment #9)
> There is one last improvement we can do here.  Currently we are using
> gfc_match_init_expr.  This works fine, but the error messages are worded toward
> initialization expressions and not stop codes.  We could generalize the
> messages in gfc_match_init_expr or come up with a way to either signal a
> different message for a stop code or create a new function such as
> gfc_match_stopcode_expr.

Is this needed? The standard essentially says that is an initialization
expression is required for STOP.

(To be more precises: Fortran 2003's term "initialization expression" has been
changed to "constant expression" in F2008 and STOP takes constant expressions
as argument.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/43851] Add _gfortran_error_stop_numeric
  2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2010-07-19 13:48 ` burnus at gcc dot gnu dot org
@ 2010-07-20  1:08 ` jvdelisle at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-07-20  1:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jvdelisle at gcc dot gnu dot org  2010-07-20 01:07 -------
Not needed.  Closing.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43851


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-07-20  1:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-22 13:23 [Bug fortran/43851] New: Add _gfortran_error_stop_numeric burnus at gcc dot gnu dot org
2010-04-22 13:31 ` [Bug fortran/43851] " burnus at gcc dot gnu dot org
2010-05-08 13:06 ` jvdelisle at gcc dot gnu dot org
2010-05-13 16:58 ` jvdelisle at gcc dot gnu dot org
2010-05-20  4:45 ` jvdelisle at gcc dot gnu dot org
2010-05-20  7:40 ` burnus at gcc dot gnu dot org
2010-05-20 13:33 ` jvdelisle at gcc dot gnu dot org
2010-05-20 19:40 ` jvdelisle at gcc dot gnu dot org
2010-05-23  0:01 ` jvdelisle at gcc dot gnu dot org
2010-06-06  6:10 ` jvdelisle at gcc dot gnu dot org
2010-07-19 13:48 ` burnus at gcc dot gnu dot org
2010-07-20  1:08 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).