public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/37507]  New: Print location in (DE)ALLOCATION errors
@ 2008-09-13  9:10 burnus at gcc dot gnu dot org
  2008-09-13  9:24 ` [Bug fortran/37507] " domob at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-09-13  9:10 UTC (permalink / raw)
  To: gcc-bugs

Currently, one prints a simple message e.g. when deallocating already
deallocated memory:

Fortran runtime error: Attempt to DEALLOCATE unallocated memory.

  if (a.data == 0B)
    {
      _gfortran_runtime_error (&"Attempt to DEALLOCATE unallocated
memory."[1]{lb: 1 sz: 1});
    }

Expected: Either by default or with some option ("-g", -f... ?) the message
should also include the file name/line number.

One could use -fbacktrace, however, this does not work for mixed language
programming with, e.g., a "main()" written in C - or if no glibc is used, which
is needed to get backtraces.


-- 
           Summary: Print location in (DE)ALLOCATION errors
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          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=37507


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

* [Bug fortran/37507] Print location in (DE)ALLOCATION errors
  2008-09-13  9:10 [Bug fortran/37507] New: Print location in (DE)ALLOCATION errors burnus at gcc dot gnu dot org
@ 2008-09-13  9:24 ` domob at gcc dot gnu dot org
  2008-09-13 10:10 ` tkoenig at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-09-13  9:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from domob at gcc dot gnu dot org  2008-09-13 09:23 -------
This shouldn't be too hard to do, I think.  I'll look into this one.


-- 


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


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

* [Bug fortran/37507] Print location in (DE)ALLOCATION errors
  2008-09-13  9:10 [Bug fortran/37507] New: Print location in (DE)ALLOCATION errors burnus at gcc dot gnu dot org
  2008-09-13  9:24 ` [Bug fortran/37507] " domob at gcc dot gnu dot org
@ 2008-09-13 10:10 ` tkoenig at gcc dot gnu dot org
  2008-09-14 13:49 ` domob at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-09-13 10:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tkoenig at gcc dot gnu dot org  2008-09-13 10:09 -------
Confirmed.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-09-13 10:09:35
               date|                            |


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


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

* [Bug fortran/37507] Print location in (DE)ALLOCATION errors
  2008-09-13  9:10 [Bug fortran/37507] New: Print location in (DE)ALLOCATION errors burnus at gcc dot gnu dot org
  2008-09-13  9:24 ` [Bug fortran/37507] " domob at gcc dot gnu dot org
  2008-09-13 10:10 ` tkoenig at gcc dot gnu dot org
@ 2008-09-14 13:49 ` domob at gcc dot gnu dot org
  2008-09-18 12:05 ` domob at gcc dot gnu dot org
  2008-09-18 12:07 ` domob at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-09-14 13:49 UTC (permalink / raw)
  To: gcc-bugs



-- 

domob at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |domob at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-09-13 10:09:35         |2008-09-14 13:48:35
               date|                            |


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


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

* [Bug fortran/37507] Print location in (DE)ALLOCATION errors
  2008-09-13  9:10 [Bug fortran/37507] New: Print location in (DE)ALLOCATION errors burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-09-14 13:49 ` domob at gcc dot gnu dot org
@ 2008-09-18 12:05 ` domob at gcc dot gnu dot org
  2008-09-18 12:07 ` domob at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-09-18 12:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from domob at gcc dot gnu dot org  2008-09-18 12:04 -------
Subject: Bug 37507

Author: domob
Date: Thu Sep 18 12:02:50 2008
New Revision: 140451

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140451
Log:
2008-09-18  Daniel Kraft  <d@domob.eu>

        PR fortran/37507
        * trans.h (gfc_trans_runtime_error): New method.
        (gfc_trans_runtime_error_vararg): New method.
        (gfc_allocate_array_with_status): New argument `expr' for
locus/varname.
        (gfc_deallocate_array_with_status): Ditto.
        * trans-array.h (gfc_array_deallocate): Ditto.
        * trans.c (gfc_trans_runtime_error): New method.
        (gfc_trans_runtime_error_vararg): New method, moved parts of the code
        from gfc_trans_runtime_check here.
        (gfc_trans_runtime_error_check): Moved code partly to new method.
        (gfc_call_malloc): Fix tab-indentation.
        (gfc_allocate_array_with_status): New argument `expr' and call
        gfc_trans_runtime_error for error reporting to include locus.
        (gfc_deallocate_with_status): Ditto.
        * trans-stmt.c (gfc_trans_deallocate): Pass expr as new argument.
        * trans-array.c (gfc_array_allocate): Ditto.
        (gfc_array_deallocate): New argument `expr', passed on.
        (gfc_trans_dealloc_allocated): Pass NULL for expr.
        * trans-openmp.c (gfc_omp_clause_default): Ditto.

2008-09-18  Daniel Kraft  <d@domob.eu>

        PR fortran/37507
        * gfortran.dg/allocate_error_1.f90: New test.
        * gfortran.dg/deallocate_error_1.f90: New test.
        * gfortran.dg/deallocate_error_2.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/allocate_error_1.f90
    trunk/gcc/testsuite/gfortran.dg/deallocate_error_1.f90
    trunk/gcc/testsuite/gfortran.dg/deallocate_error_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/fortran/trans-array.h
    trunk/gcc/fortran/trans-openmp.c
    trunk/gcc/fortran/trans-stmt.c
    trunk/gcc/fortran/trans.c
    trunk/gcc/fortran/trans.h
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/37507] Print location in (DE)ALLOCATION errors
  2008-09-13  9:10 [Bug fortran/37507] New: Print location in (DE)ALLOCATION errors burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-09-18 12:05 ` domob at gcc dot gnu dot org
@ 2008-09-18 12:07 ` domob at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-09-18 12:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from domob at gcc dot gnu dot org  2008-09-18 12:06 -------
Fixed for trunk.


-- 

domob at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-09-18 12:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-13  9:10 [Bug fortran/37507] New: Print location in (DE)ALLOCATION errors burnus at gcc dot gnu dot org
2008-09-13  9:24 ` [Bug fortran/37507] " domob at gcc dot gnu dot org
2008-09-13 10:10 ` tkoenig at gcc dot gnu dot org
2008-09-14 13:49 ` domob at gcc dot gnu dot org
2008-09-18 12:05 ` domob at gcc dot gnu dot org
2008-09-18 12:07 ` domob 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).