public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50379] New: ICE in gfc_typenode_for_spec at fortran/trans-types.c
@ 2011-09-13  9:05 zeccav at gmail dot com
  2011-09-13  9:16 ` [Bug fortran/50379] " burnus at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zeccav at gmail dot com @ 2011-09-13  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50379
           Summary: ICE in gfc_typenode_for_spec at fortran/trans-types.c
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zeccav@gmail.com


Created attachment 25258
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25258
just compile it

ICE in gfc_typenode_for_spec at fortran/trans-types.c


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

* [Bug fortran/50379] ICE in gfc_typenode_for_spec at fortran/trans-types.c
  2011-09-13  9:05 [Bug fortran/50379] New: ICE in gfc_typenode_for_spec at fortran/trans-types.c zeccav at gmail dot com
@ 2011-09-13  9:16 ` burnus at gcc dot gnu.org
  2011-09-13 10:57 ` janus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-09-13  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |janus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-09-13 09:12:31 UTC ---
With GCC 4.3::

      interface res
                   1
Error: VARIABLE attribute of 'res' conflicts with PROCEDURE attribute at (1)

Having a generic name which is the same as the result variable looks wrong ...


I think gfortran stopped rejecting the code in decl.c/symbol.c since 4.4 when
procedure-pointer (results) were allowed - such as in the following valid
example:

      function f() result(res)
        interface
          subroutine res
          end subroutine
        end interface
        pointer :: res
        res => null()
      end


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

* [Bug fortran/50379] ICE in gfc_typenode_for_spec at fortran/trans-types.c
  2011-09-13  9:05 [Bug fortran/50379] New: ICE in gfc_typenode_for_spec at fortran/trans-types.c zeccav at gmail dot com
  2011-09-13  9:16 ` [Bug fortran/50379] " burnus at gcc dot gnu.org
@ 2011-09-13 10:57 ` janus at gcc dot gnu.org
  2011-09-13 13:14 ` janus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2011-09-13 10:57 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-09-13
     Ever Confirmed|0                           |1

--- Comment #2 from janus at gcc dot gnu.org 2011-09-13 10:39:40 UTC ---
Note: We get the correct error message (twice, unfortunately) for:

  function f() result(res)
    interface res
      subroutine sub
      end subroutine
    end interface
  end 


  function f() result(res)
                          1
Error: PROCEDURE attribute conflicts with RESULT attribute in 'res' at (1)



but not when the interface is empty:

    interface res
    end interface


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

* [Bug fortran/50379] ICE in gfc_typenode_for_spec at fortran/trans-types.c
  2011-09-13  9:05 [Bug fortran/50379] New: ICE in gfc_typenode_for_spec at fortran/trans-types.c zeccav at gmail dot com
  2011-09-13  9:16 ` [Bug fortran/50379] " burnus at gcc dot gnu.org
  2011-09-13 10:57 ` janus at gcc dot gnu.org
@ 2011-09-13 13:14 ` janus at gcc dot gnu.org
  2011-09-13 14:28 ` janus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2011-09-13 13:14 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

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

--- Comment #3 from janus at gcc dot gnu.org 2011-09-13 13:08:53 UTC ---
One way to reject it would be:


Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 178778)
+++ gcc/fortran/resolve.c       (working copy)
@@ -10567,6 +10567,12 @@
                     "in '%s' at %L", sym->name, &sym->declared_at);
          return FAILURE;
        }
+      if (sym->attr.generic && sym->attr.result)
+       {
+         gfc_error ("GENERIC attribute conflicts with RESULT attribute "
+                    "in '%s' at %L", sym->name, &sym->declared_at);
+         return FAILURE;
+       }
       if (sym->attr.external && sym->attr.function
          && ((sym->attr.if_source == IFSRC_DECL && !sym->attr.procedure)
              || sym->attr.contained))


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

* [Bug fortran/50379] ICE in gfc_typenode_for_spec at fortran/trans-types.c
  2011-09-13  9:05 [Bug fortran/50379] New: ICE in gfc_typenode_for_spec at fortran/trans-types.c zeccav at gmail dot com
                   ` (2 preceding siblings ...)
  2011-09-13 13:14 ` janus at gcc dot gnu.org
@ 2011-09-13 14:28 ` janus at gcc dot gnu.org
  2011-09-13 18:38 ` janus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2011-09-13 14:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from janus at gcc dot gnu.org 2011-09-13 14:02:53 UTC ---
Or better:


Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c    (revision 178778)
+++ gcc/fortran/symbol.c    (working copy)
@@ -373,7 +373,7 @@ check_conflict (symbol_attribute *attr, const char
     *volatile_ = "VOLATILE", *is_protected = "PROTECTED",
     *is_bind_c = "BIND(C)", *procedure = "PROCEDURE",
     *asynchronous = "ASYNCHRONOUS", *codimension = "CODIMENSION",
-    *contiguous = "CONTIGUOUS";
+    *contiguous = "CONTIGUOUS", *generic = "GENERIC";
   static const char *threadprivate = "THREADPRIVATE";

   const char *a1, *a2;
@@ -490,8 +490,6 @@ check_conflict (symbol_attribute *attr, const char
   conf (in_common, codimension);
   conf (in_common, result);

-  conf (dummy, result);
-
   conf (in_equivalence, use_assoc);
   conf (in_equivalence, codimension);
   conf (in_equivalence, dummy);
@@ -503,7 +501,9 @@ check_conflict (symbol_attribute *attr, const char
   conf (in_equivalence, allocatable);
   conf (in_equivalence, threadprivate);

+  conf (dummy, result);
   conf (entry, result);
+  conf (generic, result);

   conf (function, subroutine);


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

* [Bug fortran/50379] ICE in gfc_typenode_for_spec at fortran/trans-types.c
  2011-09-13  9:05 [Bug fortran/50379] New: ICE in gfc_typenode_for_spec at fortran/trans-types.c zeccav at gmail dot com
                   ` (3 preceding siblings ...)
  2011-09-13 14:28 ` janus at gcc dot gnu.org
@ 2011-09-13 18:38 ` janus at gcc dot gnu.org
  2011-09-13 18:40 ` janus at gcc dot gnu.org
  2011-09-13 19:27 ` janus at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2011-09-13 18:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from janus at gcc dot gnu.org 2011-09-13 18:19:18 UTC ---
The patch in comment #4 regtests cleanly. Will commit as obvious.


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

* [Bug fortran/50379] ICE in gfc_typenode_for_spec at fortran/trans-types.c
  2011-09-13  9:05 [Bug fortran/50379] New: ICE in gfc_typenode_for_spec at fortran/trans-types.c zeccav at gmail dot com
                   ` (4 preceding siblings ...)
  2011-09-13 18:38 ` janus at gcc dot gnu.org
@ 2011-09-13 18:40 ` janus at gcc dot gnu.org
  2011-09-13 19:27 ` janus at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2011-09-13 18:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from janus at gcc dot gnu.org 2011-09-13 18:37:41 UTC ---
Author: janus
Date: Tue Sep 13 18:37:33 2011
New Revision: 178829

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178829
Log:
2011-09-13  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/50379
    * symbol.c (check_conflict): Check conflict between GENERIC and RESULT
    attributes.


2011-09-13  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/50379
    * gfortran.dg/result_2.f90: New.

Added:
    trunk/gcc/testsuite/gfortran.dg/result_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/symbol.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/50379] ICE in gfc_typenode_for_spec at fortran/trans-types.c
  2011-09-13  9:05 [Bug fortran/50379] New: ICE in gfc_typenode_for_spec at fortran/trans-types.c zeccav at gmail dot com
                   ` (5 preceding siblings ...)
  2011-09-13 18:40 ` janus at gcc dot gnu.org
@ 2011-09-13 19:27 ` janus at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2011-09-13 19:27 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

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

--- Comment #7 from janus at gcc dot gnu.org 2011-09-13 18:39:33 UTC ---
Fixed on trunk with r178829. Closing.

Thanks for the report!


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

end of thread, other threads:[~2011-09-13 18:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13  9:05 [Bug fortran/50379] New: ICE in gfc_typenode_for_spec at fortran/trans-types.c zeccav at gmail dot com
2011-09-13  9:16 ` [Bug fortran/50379] " burnus at gcc dot gnu.org
2011-09-13 10:57 ` janus at gcc dot gnu.org
2011-09-13 13:14 ` janus at gcc dot gnu.org
2011-09-13 14:28 ` janus at gcc dot gnu.org
2011-09-13 18:38 ` janus at gcc dot gnu.org
2011-09-13 18:40 ` janus at gcc dot gnu.org
2011-09-13 19:27 ` janus 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).