public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/23420] New: ICE on invalid print statement
@ 2005-08-16 12:09 tkoenig at gcc dot gnu dot org
  2005-08-16 12:29 ` [Bug fortran/23420] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2005-08-16 12:09 UTC (permalink / raw)
  To: gcc-bugs

>From a typo of mine...

$ cat ice-print.f
      program main
      print precision(1.2_8)
      end
$ gfortran ice-print.f
ice-print.f: In function 'MAIN__':
ice-print.f:2: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$ gfortran -v
Using built-in specs.
Target: ia64-unknown-linux-gnu
Configured with: ../gcc-4.1-20050806/configure --prefix=/home/zfkts --enable-
languages=c,f95
Thread model: posix
gcc version 4.1.0 20050806 (experimental)

-- 
           Summary: ICE on invalid print statement
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: minor
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug fortran/23420] ICE on invalid print statement
  2005-08-16 12:09 [Bug fortran/23420] New: ICE on invalid print statement tkoenig at gcc dot gnu dot org
@ 2005-08-16 12:29 ` pinskia at gcc dot gnu dot org
  2005-09-09 15:20 ` tobi at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-16 12:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-16 12:12 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |4.0.0 4.1.0
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-16 12:12:30
               date|                            |


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


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

* [Bug fortran/23420] ICE on invalid print statement
  2005-08-16 12:09 [Bug fortran/23420] New: ICE on invalid print statement tkoenig at gcc dot gnu dot org
  2005-08-16 12:29 ` [Bug fortran/23420] " pinskia at gcc dot gnu dot org
@ 2005-09-09 15:20 ` tobi at gcc dot gnu dot org
  2005-09-09 15:32 ` tobi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-09-09 15:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2005-09-09 15:20 -------
Backtrace:

(gdb) run pr23420.f90
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /home/pcl331/schluter/src/gcc/build/gcc/f951 pr23420.f90

Program received signal SIGSEGV, Segmentation fault.
0x0806dfb8 in match_io (k=M_PRINT) at ../../gcc/fortran/io.c:2144
2144              if ((gfc_match_name (name) == MATCH_YES)
(gdb) bt
#0  0x0806dfb8 in match_io (k=M_PRINT) at ../../gcc/fortran/io.c:2144
#1  0x0806e1be in gfc_match_print () at ../../gcc/fortran/io.c:2342
#2  0x0807b23a in match_word (str=Variable "str" is not available.
) at ../../gcc/fortran/parse.c:65
#3  0x0807b4b9 in decode_statement () at ../../gcc/fortran/parse.c:251
#4  0x0807bd85 in next_statement () at ../../gcc/fortran/parse.c:356
#5  0x0807c895 in parse_spec (st=ST_NONE) at ../../gcc/fortran/parse.c:1530
#6  0x0807d6f9 in parse_progunit (st=ST_ARITHMETIC_IF)
    at ../../gcc/fortran/parse.c:2295
#7  0x0807d9e4 in gfc_parse_file () at ../../gcc/fortran/parse.c:2581
#8  0x08097455 in gfc_be_parse_file (set_yydebug=0)
    at ../../gcc/fortran/f95-lang.c:256
#9  0x0836b89a in toplev_main (argc=2, argv=0xbffff9d4)
    at ../../gcc/toplev.c:971
#10 0x40065db6 in __libc_start_main () from /lib/libc.so.6
#11 0x0804ab91 in _start ()
(gdb) 


-- 


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


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

* [Bug fortran/23420] ICE on invalid print statement
  2005-08-16 12:09 [Bug fortran/23420] New: ICE on invalid print statement tkoenig at gcc dot gnu dot org
  2005-08-16 12:29 ` [Bug fortran/23420] " pinskia at gcc dot gnu dot org
  2005-09-09 15:20 ` tobi at gcc dot gnu dot org
@ 2005-09-09 15:32 ` tobi at gcc dot gnu dot org
  2005-09-09 15:58 ` tobi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-09-09 15:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2005-09-09 15:32 -------
Working on a fix.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tobi at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-08-16 12:12:30         |2005-09-09 15:32:14
               date|                            |


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


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

* [Bug fortran/23420] ICE on invalid print statement
  2005-08-16 12:09 [Bug fortran/23420] New: ICE on invalid print statement tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-09-09 15:32 ` tobi at gcc dot gnu dot org
@ 2005-09-09 15:58 ` tobi at gcc dot gnu dot org
  2005-09-09 16:01 ` tobi at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-09-09 15:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2005-09-09 15:58 -------
This patch fixes the problem in match_io.c, but leaves us with a preexisting
deficiency in I/O statement parsing:
  PRINT I+I
  END
will now segfault in trans-io.c.

Index: io.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/io.c,v
retrieving revision 1.31
diff -c -3 -p -r1.31 io.c
*** io.c        4 Sep 2005 12:08:40 -0000       1.31
--- io.c        9 Sep 2005 15:38:07 -0000
*************** match_io (io_kind k)
*** 2133,2169 ****
  
    if (gfc_match_char ('(') == MATCH_NO)
      {
        if (k == M_WRITE)
        goto syntax;
!       else if (k == M_PRINT 
!              && (gfc_current_form == FORM_FIXED
!                  || gfc_peek_char () == ' '))
        {
          /* Treat the non-standard case of PRINT namelist.  */
!         where = gfc_current_locus;
!         if ((gfc_match_name (name) == MATCH_YES)
!             && !gfc_find_symbol (name, NULL, 1, &sym)
!             && sym->attr.flavor == FL_NAMELIST)
            {
!             if (gfc_notify_std (GFC_STD_GNU, "PRINT namelist at "
!                                 "%C is an extension") == FAILURE)
                {
!                 m = MATCH_ERROR;
!                 goto cleanup;
                }
!             if (gfc_match_eos () == MATCH_NO)
!               {
!                 gfc_error ("Namelist followed by I/O list at %C");
!                 m = MATCH_ERROR;
!                 goto cleanup;
!               }
! 
!             dt->io_unit = default_unit (k);
!             dt->namelist = sym;
!             goto get_io_list;
            }
-         else
-           gfc_current_locus = where;
        }
  
        if (gfc_current_form == FORM_FREE)
--- 2133,2170 ----
  
    if (gfc_match_char ('(') == MATCH_NO)
      {
+       where = gfc_current_locus
        if (k == M_WRITE)
        goto syntax;
!       else if (k == M_PRINT)
        {
          /* Treat the non-standard case of PRINT namelist.  */
!         if ((gfc_current_form == FORM_FIXED || gfc_peek_char () == ' ')
!             && gfc_match_name (name) == MATCH_YES)
            {
!             gfc_find_symbol (name, NULL, 1, &sym);
!             if (sym && sym->attr.flavor == FL_NAMELIST)
                {
!                 if (gfc_notify_std (GFC_STD_GNU, "PRINT namelist at "
!                                     "%C is an extension") == FAILURE)
!                   {
!                     m = MATCH_ERROR;
!                     goto cleanup;
!                   }
!                 if (gfc_match_eos () == MATCH_NO)
!                   {
!                     gfc_error ("Namelist followed by I/O list at %C");
!                     m = MATCH_ERROR;
!                     goto cleanup;
!                   }
! 
!                 dt->io_unit = default_unit (k);
!                 dt->namelist = sym;
!                 goto get_io_list;
                }
!             else
!               gfc_current_locus = where;
            }
        }
  
        if (gfc_current_form == FORM_FREE)


-- 


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


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

* [Bug fortran/23420] ICE on invalid print statement
  2005-08-16 12:09 [Bug fortran/23420] New: ICE on invalid print statement tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-09-09 15:58 ` tobi at gcc dot gnu dot org
@ 2005-09-09 16:01 ` tobi at gcc dot gnu dot org
  2005-09-15 12:00 ` tobi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-09-09 16:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2005-09-09 16:01 -------
The new segfault's here:
(gdb) run pr23420.f90                  
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /home/pcl331/schluter/src/gcc/build/gcc/f951 pr23420.f90
 MAIN__
Program received signal SIGSEGV, Segmentation fault.
0x080b56a7 in set_string (block=0xbfffda24, postblock=0xbfffda1c, var=Variable
"var" is not available.
)
    at ../../gcc/fortran/trans-io.c:456
456       if (e->ts.type == BT_INTEGER && e->symtree->n.sym->attr.assign == 1)
(gdb) bt
#0  0x080b56a7 in set_string (block=0xbfffda24, postblock=0xbfffda1c,
var=Variable "var" is not available.
)
    at ../../gcc/fortran/trans-io.c:456
#1  0x080b6343 in build_dt (function=0x85d6078, code=0x868d2f0)
    at ../../gcc/fortran/trans-io.c:1170
#2  0x080987da in gfc_trans_code (code=0x868d2f0)
    at ../../gcc/fortran/trans.c:593
#3  0x080a82ae in gfc_generate_function_code (ns=0x868cd08)
    at ../../gcc/fortran/trans-decl.c:2415
#4  0x08097e54 in gfc_generate_code (ns=0x868cd08)
    at ../../gcc/fortran/trans.c:683
#5  0x0807df21 in gfc_parse_file () at ../../gcc/fortran/parse.c:2642
#6  0x08097815 in gfc_be_parse_file (set_yydebug=0)
    at ../../gcc/fortran/f95-lang.c:256
#7  0x0836c275 in toplev_main (argc=2, argv=0xbfffdc44)
    at ../../gcc/toplev.c:990
#8  0x40065db6 in __libc_start_main () from /lib/libc.so.6
#9  0x0804ab91 in _start ()


-- 


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


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

* [Bug fortran/23420] ICE on invalid print statement
  2005-08-16 12:09 [Bug fortran/23420] New: ICE on invalid print statement tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-09-09 16:01 ` tobi at gcc dot gnu dot org
@ 2005-09-15 12:00 ` tobi at gcc dot gnu dot org
  2005-09-20 15:07 ` cvs-commit at gcc dot gnu dot org
  2005-09-20 15:27 ` tobi at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-09-15 12:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2005-09-15 12:00 -------
PAtch here: http://gcc.gnu.org/ml/fortran/2005-09/msg00314.html

-- 


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


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

* [Bug fortran/23420] ICE on invalid print statement
  2005-08-16 12:09 [Bug fortran/23420] New: ICE on invalid print statement tkoenig at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-09-15 12:00 ` tobi at gcc dot gnu dot org
@ 2005-09-20 15:07 ` cvs-commit at gcc dot gnu dot org
  2005-09-20 15:27 ` tobi at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-20 15:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-20 15:06 -------
Subject: Bug 23420

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2005-09-20 15:05:33

Modified files:
	gcc/fortran    : ChangeLog io.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: print_fmt_4.f 

Log message:
	fortran/
	PR fortran/23420
	* io.c (resolve_tag): Don't allow non-CHARACTER constants as formats.
	(match_io): Fix usage of gfc_find_symbol.
	testsuite/
	PR fortran/23420
	* gfortran.dg/print_fmt_4.f: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.562&r2=1.563
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/io.c.diff?cvsroot=gcc&r1=1.33&r2=1.34
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6082&r2=1.6083
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/print_fmt_4.f.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug fortran/23420] ICE on invalid print statement
  2005-08-16 12:09 [Bug fortran/23420] New: ICE on invalid print statement tkoenig at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2005-09-20 15:07 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-20 15:27 ` tobi at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-09-20 15:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2005-09-20 15:27 -------
The segfault from numbers 4 and 5 remains.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|tobi at gcc dot gnu dot org |unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW


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


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

end of thread, other threads:[~2005-09-20 15:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-16 12:09 [Bug fortran/23420] New: ICE on invalid print statement tkoenig at gcc dot gnu dot org
2005-08-16 12:29 ` [Bug fortran/23420] " pinskia at gcc dot gnu dot org
2005-09-09 15:20 ` tobi at gcc dot gnu dot org
2005-09-09 15:32 ` tobi at gcc dot gnu dot org
2005-09-09 15:58 ` tobi at gcc dot gnu dot org
2005-09-09 16:01 ` tobi at gcc dot gnu dot org
2005-09-15 12:00 ` tobi at gcc dot gnu dot org
2005-09-20 15:07 ` cvs-commit at gcc dot gnu dot org
2005-09-20 15:27 ` tobi 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).