public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57435] New: Ice on invalid: check_for_ambiguous
@ 2013-05-27 16:09 bugs at stellardeath dot org
  2013-05-27 16:10 ` [Bug fortran/57435] " bugs at stellardeath dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bugs at stellardeath dot org @ 2013-05-27 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57435
           Summary: Ice on invalid: check_for_ambiguous
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugs at stellardeath dot org

Created attachment 30205
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30205&action=edit
Minimal test case

When trying to reduce a test-case with "delta", I stumbled upon this
(unrelated) invalid code-snippet that triggers an ICE:

> cat gfortran_check_for_ambiguous.f90
> ~/sys/bin/gfortran gfortran_check_for_ambiguous.f90
gfortran_check_for_ambiguous.f90:4.15:

  use precision
               1
Error: Unexpected USE statement in CONTAINS section at (1)
gfortran_check_for_ambiguous.f90:5.19:

module stressten_rt
                   1
Error: Unexpected MODULE statement in CONTAINS section at (1)
gfortran_check_for_ambiguous.f90:6.15:

  use precision
               1
Error: Unexpected USE statement in CONTAINS section at (1)
f951: internal compiler error: Segmentation fault
0x9b710f crash_signal
        ../.././gcc/toplev.c:333
0x5b4f13 check_for_ambiguous
        ../.././gcc/fortran/module.c:4535
0x5b4f13 read_module
        ../.././gcc/fortran/module.c:4731
0x5b4f13 gfc_use_module
        ../.././gcc/fortran/module.c:6406
0x5b73d3 gfc_use_modules()
        ../.././gcc/fortran/module.c:6530
0x5bc267 use_modules
        ../.././gcc/fortran/parse.c:86
0x5bdaf4 decode_statement
        ../.././gcc/fortran/parse.c:301
0x5bedf4 next_free
        ../.././gcc/fortran/parse.c:784
0x5bedf4 next_statement
        ../.././gcc/fortran/parse.c:977
0x5c165f parse_contained
        ../.././gcc/fortran/parse.c:4006
0x5c159e parse_progunit
        ../.././gcc/fortran/parse.c:4192
0x5c212a gfc_parse_file()
        ../.././gcc/fortran/parse.c:4597
0x5fe5a5 gfc_be_parse_file
        ../.././gcc/fortran/f95-lang.c:189
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
>


The gfortran version I used was a self-compiled version from trunk:

> ~/sys/bin/gfortran --version
GNU Fortran (GCC) 4.9.0 20130517 (experimental)
Copyright (C) 2013 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING


It also seems to trigger an ICE in 4.8.0, but behaves correctly in 4.7.2.


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

* [Bug fortran/57435] Ice on invalid: check_for_ambiguous
  2013-05-27 16:09 [Bug fortran/57435] New: Ice on invalid: check_for_ambiguous bugs at stellardeath dot org
@ 2013-05-27 16:10 ` bugs at stellardeath dot org
  2013-05-27 16:48 ` [Bug fortran/57435] [4.8/4.9 Regression] " dominiq at lps dot ens.fr
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugs at stellardeath dot org @ 2013-05-27 16:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Lorenz Hüdepohl <bugs at stellardeath dot org> ---
Seems the output of "cat" got dropped, for those who do not want to look at the
attached file:

> cat gfortran_check_for_ambiguous.f90
module precision
end module precision
  contains
  use precision
module stressten_rt
  use precision
  implicit none
>

Ciao,
  Lorenz
>From gcc-bugs-return-423233-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon May 27 16:32:28 2013
Return-Path: <gcc-bugs-return-423233-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19997 invoked by alias); 27 May 2013 16:32:27 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19933 invoked by uid 48); 27 May 2013 16:32:16 -0000
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57435] [4.8/4.9 Regression] Ice on invalid: check_for_ambiguous
Date: Mon, 27 May 2013 16:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: minor
X-Bugzilla-Who: dominiq at lps dot ens.fr
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on short_desc everconfirmed
Message-ID: <bug-57435-4-R0dnCQZDuQ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57435-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57435-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-05/txt/msg01906.txt.bz2
Content-length: 765

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW435

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-05-27
            Summary|Ice on invalid:             |[4.8/4.9 Regression] Ice on
                   |check_for_ambiguous         |invalid:
                   |                            |check_for_ambiguous
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Revision 194897 (2013-01-04) is OK, revision 195140 (2013-01-14) gives the ICE.


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

* [Bug fortran/57435] [4.8/4.9 Regression] Ice on invalid: check_for_ambiguous
  2013-05-27 16:09 [Bug fortran/57435] New: Ice on invalid: check_for_ambiguous bugs at stellardeath dot org
  2013-05-27 16:10 ` [Bug fortran/57435] " bugs at stellardeath dot org
@ 2013-05-27 16:48 ` dominiq at lps dot ens.fr
  2013-05-27 20:12 ` dominiq at lps dot ens.fr
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-05-27 16:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Likely due to revision 195065:

Program received signal SIGSEGV, Segmentation fault.
0x000000010007279b in gfc_use_module (module=<value optimized out>) at
../../work/gcc/fortran/module.c:4535
4535      if (st_sym->name == gfc_current_ns->proc_name->name)
(gdb) p st_sym->name
$1 = 0x14282a260 "precision"
(gdb) p gfc_current_ns->proc_name->name
Cannot access memory at address 0x0


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

* [Bug fortran/57435] [4.8/4.9 Regression] Ice on invalid: check_for_ambiguous
  2013-05-27 16:09 [Bug fortran/57435] New: Ice on invalid: check_for_ambiguous bugs at stellardeath dot org
  2013-05-27 16:10 ` [Bug fortran/57435] " bugs at stellardeath dot org
  2013-05-27 16:48 ` [Bug fortran/57435] [4.8/4.9 Regression] " dominiq at lps dot ens.fr
@ 2013-05-27 20:12 ` dominiq at lps dot ens.fr
  2013-05-31 10:57 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-05-27 20:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The following patch restores the 4.7 behavior:

--- ../_clean/gcc/fortran/module.c    2013-04-17 12:21:20.000000000 +0200
+++ gcc/fortran/module.c    2013-05-27 21:55:20.000000000 +0200
@@ -4532,7 +4532,7 @@ check_for_ambiguous (gfc_symbol *st_sym,
   module_locus locus;
   symbol_attribute attr;

-  if (st_sym->name == gfc_current_ns->proc_name->name)
+  if (gfc_current_ns->proc_name && st_sym->name ==
gfc_current_ns->proc_name->name)
     {
       gfc_error ("'%s' of module '%s', imported at %C, is also the name of the
"
          "current program unit", st_sym->name, module_name);


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

* [Bug fortran/57435] [4.8/4.9 Regression] Ice on invalid: check_for_ambiguous
  2013-05-27 16:09 [Bug fortran/57435] New: Ice on invalid: check_for_ambiguous bugs at stellardeath dot org
                   ` (2 preceding siblings ...)
  2013-05-27 20:12 ` dominiq at lps dot ens.fr
@ 2013-05-31 10:57 ` jakub at gcc dot gnu.org
  2013-07-28 13:46 ` [Bug fortran/57435] [4.8 " pault at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-31 10:57 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.1                       |4.8.2

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.1 has been released.


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

* [Bug fortran/57435] [4.8 Regression] Ice on invalid: check_for_ambiguous
  2013-05-27 16:09 [Bug fortran/57435] New: Ice on invalid: check_for_ambiguous bugs at stellardeath dot org
                   ` (3 preceding siblings ...)
  2013-05-31 10:57 ` jakub at gcc dot gnu.org
@ 2013-07-28 13:46 ` pault at gcc dot gnu.org
  2013-07-28 14:14 ` burnus at gcc dot gnu.org
  2013-07-28 14:15 ` burnus at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu.org @ 2013-07-28 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu.org
            Summary|[4.8/4.9 Regression] Ice on |[4.8 Regression] Ice on
                   |invalid:                    |invalid:
                   |check_for_ambiguous         |check_for_ambiguous

--- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> ---
Hi Tobias,

Were you going to backport the patch now that 4.8.1 has been released?

Cheers

Paul


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

* [Bug fortran/57435] [4.8 Regression] Ice on invalid: check_for_ambiguous
  2013-05-27 16:09 [Bug fortran/57435] New: Ice on invalid: check_for_ambiguous bugs at stellardeath dot org
                   ` (4 preceding siblings ...)
  2013-07-28 13:46 ` [Bug fortran/57435] [4.8 " pault at gcc dot gnu.org
@ 2013-07-28 14:14 ` burnus at gcc dot gnu.org
  2013-07-28 14:15 ` burnus at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-07-28 14:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Sun Jul 28 14:13:17 2013
New Revision: 201293

URL: http://gcc.gnu.org/viewcvs?rev=201293&root=gcc&view=rev
Log:
2013-07-28  Tobias Burnus  <burnus@net-b.de>

        Backport from mainline
        2013-05-28  Dominique d'Humieres  <dominiq@lps.ens.fr>

        PR fortran/57435
        * module.c (check_for_ambiguous): Avoid null pointer deref.

2013-07-28  Tobias Burnus  <burnus@net-b.de>

        Backport from mainline
        2013-05-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57435
        * gfortran.dg/use_29.f90: New.


Added:
    branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/use_29.f90
Modified:
    branches/gcc-4_8-branch/gcc/fortran/ChangeLog
    branches/gcc-4_8-branch/gcc/fortran/module.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/57435] [4.8 Regression] Ice on invalid: check_for_ambiguous
  2013-05-27 16:09 [Bug fortran/57435] New: Ice on invalid: check_for_ambiguous bugs at stellardeath dot org
                   ` (5 preceding siblings ...)
  2013-07-28 14:14 ` burnus at gcc dot gnu.org
@ 2013-07-28 14:15 ` burnus at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-07-28 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

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

--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Paul Thomas from comment #8)
> Were you going to backport the patch now that 4.8.1 has been released?

Good point! I did so now.

Close as FIXED.

Lorenz: Thanks for the bug report!


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

end of thread, other threads:[~2013-07-28 14:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-27 16:09 [Bug fortran/57435] New: Ice on invalid: check_for_ambiguous bugs at stellardeath dot org
2013-05-27 16:10 ` [Bug fortran/57435] " bugs at stellardeath dot org
2013-05-27 16:48 ` [Bug fortran/57435] [4.8/4.9 Regression] " dominiq at lps dot ens.fr
2013-05-27 20:12 ` dominiq at lps dot ens.fr
2013-05-31 10:57 ` jakub at gcc dot gnu.org
2013-07-28 13:46 ` [Bug fortran/57435] [4.8 " pault at gcc dot gnu.org
2013-07-28 14:14 ` burnus at gcc dot gnu.org
2013-07-28 14:15 ` burnus 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).