public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/66040] New: ICE on misplaced sequence in function
@ 2015-05-06 17:21 gerhard.steinmetz.fortran@t-online.de
  2015-05-06 19:32 ` [Bug fortran/66040] " gerhard.steinmetz.fortran@t-online.de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gerhard.steinmetz.fortran@t-online.de @ 2015-05-06 17:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66040

            Bug ID: 66040
           Summary: ICE on misplaced sequence in function
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fortran@t-online.de
  Target Milestone: ---

An ICE occurs with a misplaced sequence in a function.

$ cat disrupt_2_sequence.f90
   real function f(x)
      sequence
   end

$ gfortran -c disrupt_2_sequence.f90
    sequence
           1
internal compiler error: Unexpected SEQUENCE statement in verify_st_order() at
(1)
Tested with gfortran 5.1.1 on SUSE Linux 13.2 (64 bit)

Kind regards.


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

* [Bug fortran/66040] ICE on misplaced sequence in function
  2015-05-06 17:21 [Bug fortran/66040] New: ICE on misplaced sequence in function gerhard.steinmetz.fortran@t-online.de
@ 2015-05-06 19:32 ` gerhard.steinmetz.fortran@t-online.de
  2015-05-06 21:10 ` kargl at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gerhard.steinmetz.fortran@t-online.de @ 2015-05-06 19:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66040

--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
There are more cases for ICEs on misplaced statements in a function. For
example :

---
   real function f()
      block data
   end
---
   real function f()
      else
   end
---
   real function f()
      program p
   end
---

Prints, respectivly :
internal compiler error: Unexpected ... statement in verify_st_order() at (1)


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

* [Bug fortran/66040] ICE on misplaced sequence in function
  2015-05-06 17:21 [Bug fortran/66040] New: ICE on misplaced sequence in function gerhard.steinmetz.fortran@t-online.de
  2015-05-06 19:32 ` [Bug fortran/66040] " gerhard.steinmetz.fortran@t-online.de
@ 2015-05-06 21:10 ` kargl at gcc dot gnu.org
  2015-05-06 21:39 ` sgk at troutmask dot apl.washington.edu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-06 21:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66040

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
This appears to be an intentional ICE (although I'm not sure why).
The code in question is lines 2427-2430 in parse.c(verify_st_order).


    default:
      gfc_internal_error ("Unexpected %s statement in verify_st_order() at %C",
                          gfc_ascii_statement (st));


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

* [Bug fortran/66040] ICE on misplaced sequence in function
  2015-05-06 17:21 [Bug fortran/66040] New: ICE on misplaced sequence in function gerhard.steinmetz.fortran@t-online.de
  2015-05-06 19:32 ` [Bug fortran/66040] " gerhard.steinmetz.fortran@t-online.de
  2015-05-06 21:10 ` kargl at gcc dot gnu.org
@ 2015-05-06 21:39 ` sgk at troutmask dot apl.washington.edu
  2015-05-16 10:24 ` dominiq at lps dot ens.fr
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2015-05-06 21:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66040

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Wed, May 06, 2015 at 09:09:57PM +0000, kargl at gcc dot gnu.org wrote:
> --- Comment #2 from kargl at gcc dot gnu.org ---
> This appears to be an intentional ICE (although I'm not sure why).
> The code in question is lines 2427-2430 in parse.c(verify_st_order).
> 
> 
>     default:
>       gfc_internal_error ("Unexpected %s statement in verify_st_order() at %C",
>                           gfc_ascii_statement (st));
> 

The code in comments #1 and #, this diff generates an
error message without the ICE>

Index: parse.c
===================================================================
--- parse.c     (revision 222724)
+++ parse.c     (working copy)
@@ -2425,8 +2425,7 @@ verify_st_order (st_state *p, gfc_statem
       break;

     default:
-      gfc_internal_error ("Unexpected %s statement in verify_st_order() at
%C",
-                         gfc_ascii_statement (st));
+      return false;
     }

   /* All is well, record the statement in case we need it next time.  */


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

* [Bug fortran/66040] ICE on misplaced sequence in function
  2015-05-06 17:21 [Bug fortran/66040] New: ICE on misplaced sequence in function gerhard.steinmetz.fortran@t-online.de
                   ` (2 preceding siblings ...)
  2015-05-06 21:39 ` sgk at troutmask dot apl.washington.edu
@ 2015-05-16 10:24 ` dominiq at lps dot ens.fr
  2015-05-18 21:16 ` kargl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-05-16 10:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66040

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-05-16
     Ever confirmed|0                           |1

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Patch posted at https://gcc.gnu.org/ml/fortran/2015-05/msg00081.html.


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

* [Bug fortran/66040] ICE on misplaced sequence in function
  2015-05-06 17:21 [Bug fortran/66040] New: ICE on misplaced sequence in function gerhard.steinmetz.fortran@t-online.de
                   ` (3 preceding siblings ...)
  2015-05-16 10:24 ` dominiq at lps dot ens.fr
@ 2015-05-18 21:16 ` kargl at gcc dot gnu.org
  2015-05-19 17:25 ` kargl at gcc dot gnu.org
  2015-05-19 17:34 ` kargl at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-18 21:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66040

--- Comment #5 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Mon May 18 21:16:05 2015
New Revision: 223318

URL: https://gcc.gnu.org/viewcvs?rev=223318&root=gcc&view=rev
Log:
2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/66040
        * parse.c(verify_st_order): Replace a gfc_internal_error with your
        generic gfc_error.

2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/66040
        * gfortran.dg/misplaced_statement.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/misplaced_statement.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/parse.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/66040] ICE on misplaced sequence in function
  2015-05-06 17:21 [Bug fortran/66040] New: ICE on misplaced sequence in function gerhard.steinmetz.fortran@t-online.de
                   ` (4 preceding siblings ...)
  2015-05-18 21:16 ` kargl at gcc dot gnu.org
@ 2015-05-19 17:25 ` kargl at gcc dot gnu.org
  2015-05-19 17:34 ` kargl at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-19 17:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66040

--- Comment #6 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Tue May 19 17:25:09 2015
New Revision: 223394

URL: https://gcc.gnu.org/viewcvs?rev=223394&root=gcc&view=rev
Log:
2015-05-19  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/66040
        * parse.c(verify_st_order): Replace a gfc_internal_error with your
        generic gfc_error.

2015-05-19  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/66040
        * gfortran.dg/misplaced_statement.f90: New test.

Added:
    branches/gcc-5-branch/gcc/testsuite/gfortran.dg/misplaced_statement.f90
Modified:
    branches/gcc-5-branch/gcc/fortran/ChangeLog
    branches/gcc-5-branch/gcc/fortran/parse.c
    branches/gcc-5-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/66040] ICE on misplaced sequence in function
  2015-05-06 17:21 [Bug fortran/66040] New: ICE on misplaced sequence in function gerhard.steinmetz.fortran@t-online.de
                   ` (5 preceding siblings ...)
  2015-05-19 17:25 ` kargl at gcc dot gnu.org
@ 2015-05-19 17:34 ` kargl at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-19 17:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66040

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.2

--- Comment #7 from kargl at gcc dot gnu.org ---
Fixed on trunk and 5-branch.  Thanks for the bug report.


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

end of thread, other threads:[~2015-05-19 17:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06 17:21 [Bug fortran/66040] New: ICE on misplaced sequence in function gerhard.steinmetz.fortran@t-online.de
2015-05-06 19:32 ` [Bug fortran/66040] " gerhard.steinmetz.fortran@t-online.de
2015-05-06 21:10 ` kargl at gcc dot gnu.org
2015-05-06 21:39 ` sgk at troutmask dot apl.washington.edu
2015-05-16 10:24 ` dominiq at lps dot ens.fr
2015-05-18 21:16 ` kargl at gcc dot gnu.org
2015-05-19 17:25 ` kargl at gcc dot gnu.org
2015-05-19 17:34 ` kargl at gcc dot gnu.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).