public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29373]  New: implicit type declaration and contained function clash
@ 2006-10-06 20:47 tobi at gcc dot gnu dot org
  2006-10-08 20:06 ` [Bug fortran/29373] " pault at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2006-10-06 20:47 UTC (permalink / raw)
  To: gcc-bugs

(this is a spinoff of PR29267)

schluter@pcl247:~/src/pr/29267> cat t.f90
 implicit character*32 (a-z)
  CHARACTER(len=255), DIMENSION(1,2)  :: a
  a = reshape((/ to_string(1.0) /), (/ 1, 2 /))
  print *, a
  CONTAINS
    CHARACTER(32) FUNCTION to_string(x)
      REAL, INTENT(in) :: x
      WRITE(to_string, FMT="(F6.3)") x
    END FUNCTION
END PROGRAM
schluter@pcl247:~/src/pr/29267> gfortran t.f90
 In file t.f90:6

    CHARACTER(32) FUNCTION to_string(x)
                                   1
 In file t.f90:3

  a = reshape((/ to_string(1.0) /), (/ 1, 2 /))
                         2
Error: Procedure 'to_string' at (1) has an explicit interface and must not have
attributes declared at (2)
 In file t.f90:6

    CHARACTER(32) FUNCTION to_string(x)
                         1
Error: Syntax error in data declaration at (1)
 In file t.f90:7

      REAL, INTENT(in) :: x
                          1
Error: Unexpected data declaration statement in CONTAINS section at (1)
 In file t.f90:8

      WRITE(to_string, FMT="(F6.3)") x
                    1
Error: Syntax error in WRITE statement at (1)
 In file t.f90:9

    END FUNCTION
      1
Error: Expecting END PROGRAM statement at (1)
schluter@pcl247:~/src/pr/29267>


-- 
           Summary: implicit type declaration and contained function clash
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobi at gcc dot gnu dot org


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
@ 2006-10-08 20:06 ` pault at gcc dot gnu dot org
  2006-10-09 11:34 ` tobi at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-10-08 20:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pault at gcc dot gnu dot org  2006-10-08 20:06 -------
Tobi,

This is a very unpleasant and venemous bug!  Removing the
 implicit character*32 (a-z)
results in

pr29373.f90: In function 'MAIN__':
pr29373.f90:8: fatal error: gfc_todo: Not Implemented: complex character array
onstructors
compilation terminated.

Uuughhh!

Besides which, did you really want to fold your char*32 into a (1,2) char*255?

Paul


-- 

pault 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         |2006-10-08 20:06:45
               date|                            |


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
  2006-10-08 20:06 ` [Bug fortran/29373] " pault at gcc dot gnu dot org
@ 2006-10-09 11:34 ` tobi at gcc dot gnu dot org
  2006-10-09 20:11 ` paulthomas2 at wanadoo dot fr
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2006-10-09 11:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tobi at gcc dot gnu dot org  2006-10-09 11:34 -------
As I said, I ran into this when playing around with PR29267, and it was ugly
enough to warrant a PR of its own.  Glad you share my opinion :-)  Just to make
this clear: I would never do something this ugly outside bugzilla!

(BTW I added you to the CC list, it is kinda hard to answer in the right place
otherwise)


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu dot org


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
  2006-10-08 20:06 ` [Bug fortran/29373] " pault at gcc dot gnu dot org
  2006-10-09 11:34 ` tobi at gcc dot gnu dot org
@ 2006-10-09 20:11 ` paulthomas2 at wanadoo dot fr
  2006-10-10 12:41 ` pault at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paulthomas2 at wanadoo dot fr @ 2006-10-09 20:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paulthomas2 at wanadoo dot fr  2006-10-09 20:11 -------
Subject: Re:  implicit type declaration and contained function
 clash

tobi at gcc dot gnu dot org wrote:

>(BTW I added you to the CC list, it is kinda hard to answer in the right place
>otherwise)
>  
>
Oh s**t - next thing is that you'll want me to fix it too?

Paul


-- 


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-10-09 20:11 ` paulthomas2 at wanadoo dot fr
@ 2006-10-10 12:41 ` pault at gcc dot gnu dot org
  2006-10-10 12:47 ` pault at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-10-10 12:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2006-10-10 12:41 -------
Created an attachment (id=12403)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12403&action=view)
Fix for the problem

Regtested on FC5/Athlon

Will submit asap.

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-10-10 12:41 ` pault at gcc dot gnu dot org
@ 2006-10-10 12:47 ` pault at gcc dot gnu dot org
  2006-10-11 16:08 ` tobi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-10-10 12:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2006-10-10 12:47 -------
(In reply to comment #4)
> Created an attachment (id=12403)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12403&action=view) [edit]
> Fix for the problem

Sorry, I should have said that this gets rid of the TWO problems that prevent
this from responding in the same way as removing the IMPLICIT NONE:

pr29373.f90:8: fatal error: gfc_todo: Not Implemented: complex character array
constructors
compilation terminated.

I will submit asap and will submit a new PR for this latter.

Paul


-- 


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-10-10 12:47 ` pault at gcc dot gnu dot org
@ 2006-10-11 16:08 ` tobi at gcc dot gnu dot org
  2006-10-11 17:00 ` patchapp at dberlin dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2006-10-11 16:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from tobi at gcc dot gnu dot org  2006-10-11 16:07 -------
You're working too fast, Paul.  Before I even got to read your answer you
already bring forward a patch.


-- 


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-10-11 16:08 ` tobi at gcc dot gnu dot org
@ 2006-10-11 17:00 ` patchapp at dberlin dot org
  2006-10-11 17:05 ` paulthomas2 at wanadoo dot fr
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: patchapp at dberlin dot org @ 2006-10-11 17:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from patchapp at dberlin dot org  2006-10-11 17:00 -------
Subject: Bug number PR29373

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00620.html


-- 


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-10-11 17:00 ` patchapp at dberlin dot org
@ 2006-10-11 17:05 ` paulthomas2 at wanadoo dot fr
  2006-10-13 12:52 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paulthomas2 at wanadoo dot fr @ 2006-10-11 17:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from paulthomas2 at wanadoo dot fr  2006-10-11 17:05 -------
Subject: Re:  implicit type declaration and contained function
 clash

tobi at gcc dot gnu dot org wrote:

>------- Comment #6 from tobi at gcc dot gnu dot org  2006-10-11 16:07 -------
>You're working too fast, Paul.  Before I even got to read your answer you
>already bring forward a patch.
>
>
>  
>
Better still, I just submitted it! :-D

I have been child-minding today. Since the poor little soul is sick, I 
have insisted that she be properly sick in bed; meanwhile, I have had 
the portable on my lap in the garden, catching up on pending submissions.

How are you?  That resubmitted PR29431 has an interesting effect on 
other compilers - only g95 gets it right.  ifort seems to make it up as 
it's going along and pgf crashes in cloud of smoke,

Paul


-- 


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-10-11 17:05 ` paulthomas2 at wanadoo dot fr
@ 2006-10-13 12:52 ` pault at gcc dot gnu dot org
  2006-10-14  8:17 ` pault at gcc dot gnu dot org
  2006-11-06 17:19 ` pault at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-10-13 12:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pault at gcc dot gnu dot org  2006-10-13 12:51 -------
Subject: Bug 29373

Author: pault
Date: Fri Oct 13 12:51:07 2006
New Revision: 117692

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117692
Log:
2006-10-13 Paul Thomas <pault@gcc.gnu.org>

        PR fortran/29373
        * decl.c (get_proc_name, gfc_match_function_decl): Add
        attr.implicit_type to conditions that throw error for
        existing explicit interface and that allow new type-
        spec to be applied.

        PR fortran/29407
        * resolve.c (resolve_fl_namelist): Do not check for
        namelist/procedure conflict, if the symbol corresponds
        to a good local variable declaration.

        PR fortran/27701
        * decl.c (get_proc_name): Replace the detection of a declared
        procedure by the presence of a formal argument list by the
        attributes of the symbol and the presence of an explicit
        interface.

        PR fortran/29232
        * resolve.c (resolve_fl_variable): See if the host association
        of a derived type is blocked by the presence of another type I
        object in the current namespace.

        PR fortran/29364
        * resolve.c (resolve_fl_derived): Check for the presence of
        the derived type for a derived type component.

        PR fortran/24398
        * module.c (gfc_use_module): Check that the first words in a
        module file are 'GFORTRAN module'.

        PR fortran/29422
        * resolve.c (resolve_transfer): Test functions for suitability
        for IO, as well as variables.

        PR fortran/29428
        * trans-expr.c (gfc_trans_scalar_assign): Remove nullify of
        rhs expression.


2006-10-13 Paul Thomas <pault@gcc.gnu.org>

        PR fortran/29373
        * gfortran.dg/implicit_9.f90: New test.

        PR fortran/29407
        * gfortran.dg/namelist_25.f90: New test.

        PR fortran/27701
        * gfortran.dg/same_name_2.f90: New test.

        PR fortran/29232
        * gfortran.dg/host_assoc_types_1.f90: New test.

        PR fortran/29364
        * gfortran.dg/missing_derived_type_1.f90: New test.
        * gfortran.dg/implicit_actual.f90: Comment out USE GLOBAL.

        PR fortran/29422
        * gfortran.dg/alloc_comp_constraint_4.f90: New test.

        PR fortran/29428
        * gfortran.dg/alloc_comp_assign_5.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/alloc_comp_assign_5.f90
    trunk/gcc/testsuite/gfortran.dg/alloc_comp_constraint_4.f90
    trunk/gcc/testsuite/gfortran.dg/host_assoc_types_1.f90
    trunk/gcc/testsuite/gfortran.dg/implicit_9.f90
    trunk/gcc/testsuite/gfortran.dg/missing_derived_type_1.f90
    trunk/gcc/testsuite/gfortran.dg/namelist_25.f90
    trunk/gcc/testsuite/gfortran.dg/same_name_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/module.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/implicit_actual.f90


-- 


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2006-10-13 12:52 ` pault at gcc dot gnu dot org
@ 2006-10-14  8:17 ` pault at gcc dot gnu dot org
  2006-11-06 17:19 ` pault at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-10-14  8:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pault at gcc dot gnu dot org  2006-10-14 08:17 -------
Fixed in trunk

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/29373] implicit type declaration and contained function clash
  2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2006-10-14  8:17 ` pault at gcc dot gnu dot org
@ 2006-11-06 17:19 ` pault at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-06 17:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pault at gcc dot gnu dot org  2006-11-06 17:18 -------
Subject: Bug 29373

Author: pault
Date: Mon Nov  6 17:18:03 2006
New Revision: 118522

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118522
Log:
2006-11-06  Paul Thomas  <pault@gcc.gnu.org>


        PR fortran/29373
        * decl.c (get_proc_name, gfc_match_function_decl): Add
        attr.implicit_type to conditions that throw error for
        existing explicit interface and that allow new type-
        spec to be applied.

        PR fortran/29407
        * resolve.c (resolve_fl_namelist): Do not check for
        namelist/procedure conflict, if the symbol corresponds
        to a good local variable declaration.

        PR fortran/27701
        * decl.c (get_proc_name): Replace the detection of a declared
        procedure by the presence of a formal argument list by the
        attributes of the symbol and the presence of an explicit
        interface.

        PR fortran/29232
        * resolve.c (resolve_fl_variable): See if the host association
        of a derived type is blocked by the presence of another type I
        object in the current namespace.

        PR fortran/29364
        * resolve.c (resolve_fl_derived): Check for the presence of
        the derived type for a derived type component.

        PR fortran/24398
        * module.c (gfc_use_module): Check that the first words in a
        module file are 'GFORTRAN module'.

        PR fortran/29115
        * resolve.c (resolve_structure_cons): It is an error if the
        pointer component elements of a derived type constructor are
        not pointer or target.

        PR fortran/29211
        * trans-stmt.c (generate_loop_for_temp_to_lhs,
        generate_loop_for_rhs_to_temp): Provide a string length for
        the temporary by copying that of the other side of the scalar
        assignment.

        PR fortran/29098
        * resolve.c (resolve_structure_cons): Do not return FAILURE if
        component expression is NULL.


2006-11-06  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/29373
        * gfortran.dg/implicit_9.f90: New test.

        PR fortran/29407
        * gfortran.dg/namelist_25.f90: New test.

        PR fortran/27701
        * gfortran.dg/same_name_2.f90: New test.

        PR fortran/29232
        * gfortran.dg/host_assoc_types_1.f90: New test.

        PR fortran/29364
        * gfortran.dg/missing_derived_type_1.f90: New test.
        * gfortran.dg/implicit_actual.f90: Comment out USE GLOBAL.

        PR fortran/29115
        * gfortran.dg/derived_constructor_comps_2.f90: New test.

        PR fortran/29211
        * gfortran.dg/forall_char_dependencies_1.f90: New test.

        PR fortran/29098
        * gfortran.dg/default_initialization_2.f90: New test.

Added:
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/default_initialization_2.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/derived_constructor_comps_2.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/forall_char_dependencies_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/host_assoc_types_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/implicit_9.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/missing_derived_type_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/namelist_25.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/same_name_2.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/decl.c
    branches/gcc-4_1-branch/gcc/fortran/module.c
    branches/gcc-4_1-branch/gcc/fortran/resolve.c
    branches/gcc-4_1-branch/gcc/fortran/trans-stmt.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/implicit_actual.f90


-- 


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


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

end of thread, other threads:[~2006-11-06 17:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-06 20:47 [Bug fortran/29373] New: implicit type declaration and contained function clash tobi at gcc dot gnu dot org
2006-10-08 20:06 ` [Bug fortran/29373] " pault at gcc dot gnu dot org
2006-10-09 11:34 ` tobi at gcc dot gnu dot org
2006-10-09 20:11 ` paulthomas2 at wanadoo dot fr
2006-10-10 12:41 ` pault at gcc dot gnu dot org
2006-10-10 12:47 ` pault at gcc dot gnu dot org
2006-10-11 16:08 ` tobi at gcc dot gnu dot org
2006-10-11 17:00 ` patchapp at dberlin dot org
2006-10-11 17:05 ` paulthomas2 at wanadoo dot fr
2006-10-13 12:52 ` pault at gcc dot gnu dot org
2006-10-14  8:17 ` pault at gcc dot gnu dot org
2006-11-06 17:19 ` pault 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).