public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38936]  New: F2003: ASSOCIATE construct
@ 2009-01-22 14:00 burnus at gcc dot gnu dot org
  2009-01-22 17:27 ` [Bug fortran/38936] " domob at gcc dot gnu dot org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-01-22 14:00 UTC (permalink / raw)
  To: gcc-bugs

ASSOCIATE is a nice Fortran 2003 feature. I found the following at
comp.lang.fortran and I want to make sure it gets tested when ASSOCIATE is
implemented. Thus I opened this PR.
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/ebf1e5abedc91cdc

Test case:

implicit none
integer :: x(5), y(5), a(5), i
 x = [13.0, 23.0, 27.0, 0.0, 37.0 ]
 y = [1.0, 3.0, 5.0, 7.0, 11.0 ]
 a = 0.0
ASSOCIATE (z => x + y)
  do i = 1, 5
     a(i) = z(i)*3.0
  end do
END ASSOCIATE
print *, a
end

Using ifort 11, the result is:
42          78          96          21         144


-- 
           Summary: F2003: ASSOCIATE construct
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 20585
             nThis:


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
@ 2009-01-22 17:27 ` domob at gcc dot gnu dot org
  2009-01-25 10:19 ` tkoenig at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2009-01-22 17:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from domob at gcc dot gnu dot org  2009-01-22 17:27 -------
I always liked the idea of associate...  Maybe I'll volunteer to work on it for
gfortran, but don't take my word on it ;)  And of course, things like CLASS get
higher priority.


-- 

domob at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
  2009-01-22 17:27 ` [Bug fortran/38936] " domob at gcc dot gnu dot org
@ 2009-01-25 10:19 ` tkoenig at gcc dot gnu dot org
  2009-10-09 12:08 ` [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr) burnus at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2009-01-25 10:19 UTC (permalink / raw)
  To: gcc-bugs



-- 

tkoenig 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         |2009-01-25 10:19:44
               date|                            |


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
  2009-01-22 17:27 ` [Bug fortran/38936] " domob at gcc dot gnu dot org
  2009-01-25 10:19 ` tkoenig at gcc dot gnu dot org
@ 2009-10-09 12:08 ` burnus at gcc dot gnu dot org
  2010-05-08 13:24 ` domob at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-10-09 12:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2009-10-09 12:08 -------
  SELECT TYPE (name => expr)
and
  ASSOCIATE (name1 => expr1, name2 => expr2)
have similar syntax and issues. SELECT TYPE (name=>expr) is already implemented
(via creating a new pointer variable), but it has some issues.

The idea is to replace the expression - at least when it is definable - by the
variable (be it in resolve.c or in trans*.c).
Cf. also http://gcc.gnu.org/ml/fortran/2009-10/msg00075.html

Maybe one should do something alike for TYPE IS() and (when implemented) CLASS
IS(), cf. http://gcc.gnu.org/ml/fortran/2009-10/msg00075.html


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|F2003: ASSOCIATE construct  |F2003: ASSOCIATE construct /
                   |                            |improved SELECT TYPE
                   |                            |(a=>expr)


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-10-09 12:08 ` [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr) burnus at gcc dot gnu dot org
@ 2010-05-08 13:24 ` domob at gcc dot gnu dot org
  2010-06-10 14:48 ` domob at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-05-08 13:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from domob at gcc dot gnu dot org  2010-05-08 13:24 -------
Taking this finally.


-- 

domob at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |domob at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-01-25 10:19:44         |2010-05-08 13:24:00
               date|                            |


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-05-08 13:24 ` domob at gcc dot gnu dot org
@ 2010-06-10 14:48 ` domob at gcc dot gnu dot org
  2010-06-10 16:50 ` domob at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-06-10 14:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from domob at gcc dot gnu dot org  2010-06-10 14:48 -------
Subject: Bug 38936

Author: domob
Date: Thu Jun 10 14:47:49 2010
New Revision: 160550

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160550
Log:
2010-06-10  Daniel Kraft  <d@domob.eu>

        PR fortran/38936
        * gfortran.h (enum gfc_statement): Add ST_ASSOCIATE, ST_END_ASSOCIATE.
        (struct gfc_symbol): New field `assoc'.
        (struct gfc_association_list): New struct.
        (struct gfc_code): New struct `block' in union, move `ns' there
        and add association list.
        (gfc_free_association_list): New method.
        (gfc_has_vector_subscript): Made public;
        * match.h (gfc_match_associate): New method.
        * parse.h (enum gfc_compile_state): Add COMP_ASSOCIATE.
        * decl.c (gfc_match_end): Handle ST_END_ASSOCIATE.
        * interface.c (gfc_has_vector_subscript): Made public.
        (compare_actual_formal): Rename `has_vector_subscript' accordingly.
        * match.c (gfc_match_associate): New method.
        (gfc_match_select_type): Change reference to gfc_code's `ns' field.
        * primary.c (match_variable): Don't allow names associated to expr
here.
        * parse.c (decode_statement): Try matching ASSOCIATE statement.
        (case_exec_markers, case_end): Add ASSOCIATE statement.
        (gfc_ascii_statement): Hande ST_ASSOCIATE and ST_END_ASSOCIATE.
        (parse_associate): New method.
        (parse_executable): Handle ST_ASSOCIATE.
        (parse_block_construct): Change reference to gfc_code's `ns' field.
        * resolve.c (resolve_select_type): Ditto.
        (resolve_code): Ditto.
        (resolve_block_construct): Ditto and add comment.
        (resolve_select_type): Set association list in generated BLOCK to NULL.
        (resolve_symbol): Resolve associate names.
        * st.c (gfc_free_statement): Change reference to gfc_code's `ns' field
        and free association list.
        (gfc_free_association_list): New method.
        * symbol.c (gfc_new_symbol): NULL new field `assoc'.
        * trans-stmt.c (gfc_trans_block_construct): Change reference to
        gfc_code's `ns' field.

2010-06-10  Daniel Kraft  <d@domob.eu>

        PR fortran/38936
        * gfortran.dg/associate_1.f03: New test.
        * gfortran.dg/associate_2.f95: New test.
        * gfortran.dg/associate_3.f03: New test.
        * gfortran.dg/associate_4.f08: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/associate_1.f03
    trunk/gcc/testsuite/gfortran.dg/associate_2.f95
    trunk/gcc/testsuite/gfortran.dg/associate_3.f03
    trunk/gcc/testsuite/gfortran.dg/associate_4.f08
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/interface.c
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/match.h
    trunk/gcc/fortran/parse.c
    trunk/gcc/fortran/parse.h
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/st.c
    trunk/gcc/fortran/symbol.c
    trunk/gcc/fortran/trans-stmt.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-06-10 14:48 ` domob at gcc dot gnu dot org
@ 2010-06-10 16:50 ` domob at gcc dot gnu dot org
  2010-08-15 19:46 ` domob at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-06-10 16:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from domob at gcc dot gnu dot org  2010-06-10 16:50 -------
This first commit implements association to scalar expressions as a first step.
 More to follow.


-- 


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-06-10 16:50 ` domob at gcc dot gnu dot org
@ 2010-08-15 19:46 ` domob at gcc dot gnu dot org
  2010-08-15 20:25 ` domob at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-08-15 19:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from domob at gcc dot gnu dot org  2010-08-15 19:46 -------
Subject: Bug 38936

Author: domob
Date: Sun Aug 15 19:46:21 2010
New Revision: 163268

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163268
Log:
2010-08-15  Daniel Kraft  <d@domob.eu>

        PR fortran/38936
        * gfortran.h (gfc_find_proc_namespace): New method.
        * expr.c (gfc_build_intrinsic_call): No need to build symtree messing
        around with namespace.
        * symbol.c (gfc_find_proc_namespace): New method.
        * trans-decl.c (gfc_build_qualified_array): Use it for correct
        value of nest.
        * primary.c (gfc_match_varspec): Handle associate-names as arrays.
        * parse.c (parse_associate): Removed assignment-generation here...
        * resolve.c (resolve_block_construct): ...and added it here.
        (resolve_variable): Handle names that are arrays but were not parsed
        as such because of association.
        (resolve_code): Fix BLOCK resolution.
        (resolve_symbol): Generate array-spec for associate-names.

2010-08-15  Daniel Kraft  <d@domob.eu>

        PR fortran/38936
        * gfortran.dg/associate_1.f03: Enable test for array expressions.
        * gfortran.dg/associate_3.f03: Clarify comment.
        * gfortran.dg/associate_5.f03: New test.
        * gfortran.dg/associate_6.f03: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/associate_5.f03
    trunk/gcc/testsuite/gfortran.dg/associate_6.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/parse.c
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/symbol.c
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/associate_1.f03
    trunk/gcc/testsuite/gfortran.dg/associate_3.f03


-- 


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2010-08-15 19:46 ` domob at gcc dot gnu dot org
@ 2010-08-15 20:25 ` domob at gcc dot gnu dot org
  2010-08-16  8:59 ` domob at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-08-15 20:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from domob at gcc dot gnu dot org  2010-08-15 20:25 -------
This extended the support to array-expressions -- the original example works
now.  Next will be a rework to do the association in the trans phase, which is
probably necessary to get full array support and association to variables
working.


-- 


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2010-08-15 20:25 ` domob at gcc dot gnu dot org
@ 2010-08-16  8:59 ` domob at gcc dot gnu dot org
  2010-08-17  8:20 ` domob at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-08-16  8:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from domob at gcc dot gnu dot org  2010-08-16 08:59 -------
Also one thing to note is that associate-names associated to expressions (which
must not appear in variable definition contexts) are currently accepted as
actual arguments to INTENT([IN]OUT) arguments.  This should probably be checked
and rejected.


-- 


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2010-08-16  8:59 ` domob at gcc dot gnu dot org
@ 2010-08-17  8:20 ` domob at gcc dot gnu dot org
  2010-08-17  8:24 ` domob at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-08-17  8:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from domob at gcc dot gnu dot org  2010-08-17 08:20 -------
Subject: Bug 38936

Author: domob
Date: Tue Aug 17 08:20:03 2010
New Revision: 163295

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163295
Log:
2010-08-17  Daniel Kraft  <d@domob.eu>

        PR fortran/38936
        * gfortran.h (struct gfc_association_list): New member `where'.
        (gfc_is_associate_pointer) New method.
        * match.c (gfc_match_associate): Remember locus for each associate
        name matched and do not try to set variable flag.
        * parse.c (parse_associate): Use remembered locus for symbols.
        * primary.c (match_variable): Instead of variable-flag check for
        associate names set it for all such names used.
        * symbol.c (gfc_is_associate_pointer): New method.
        * resolve.c (resolve_block_construct): Don't generate assignments
        to give associate-names their values.
        (resolve_fl_var_and_proc): Allow associate-names to be deferred-shape.
        (resolve_symbol): Set some more attributes for associate variables,
        set variable flag here and check it and don't try to build an
        explicitely shaped array-spec for array associate variables.
        * trans-expr.c (gfc_conv_variable): Dereference in case of association
        to scalar variable.
        * trans-types.c (gfc_is_nodesc_array): Handle array association
symbols.
        (gfc_sym_type): Return pointer type for association to scalar vars.
        * trans-decl.c (gfc_get_symbol_decl): Defer association symbols.
        (trans_associate_var): New method.
        (gfc_trans_deferred_vars): Handle association symbols.

2010-08-17  Daniel Kraft  <d@domob.eu>

        PR fortran/38936
        * gfortran.dg/associate_1.f03: Extended to test newly supported
        features like association to variables.
        * gfortran.dg/associate_3.f03: Removed check for illegal change
        of associate-name here...
        * gfortran.dg/associate_5.f03: ...and added it here.
        * gfortran.dg/associate_6.f03: No longer XFAIL'ed.
        * gfortran.dg/associate_7.f03: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/associate_7.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/parse.c
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/symbol.c
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/fortran/trans-types.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/associate_1.f03
    trunk/gcc/testsuite/gfortran.dg/associate_3.f03
    trunk/gcc/testsuite/gfortran.dg/associate_5.f03
    trunk/gcc/testsuite/gfortran.dg/associate_6.f03


-- 


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2010-08-17  8:20 ` domob at gcc dot gnu dot org
@ 2010-08-17  8:24 ` domob at gcc dot gnu dot org
  2010-08-21 16:57 ` domob at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-08-17  8:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from domob at gcc dot gnu dot org  2010-08-17 08:23 -------
This implements association to variables and removes the problems that were
still there with array expressions and bounds.  What's still missing is:

* Association to polymorphic entities
* Association to strings (works partially, but has a lot of problems)
* Association to derived types (should work in principle, but the parser does
not like component references on the associate-names)
* More checks for what is and is not a variable definition context and which
associate names may appear in it


-- 


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2010-08-17  8:24 ` domob at gcc dot gnu dot org
@ 2010-08-21 16:57 ` domob at gcc dot gnu dot org
  2010-08-21 16:59 ` domob at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-08-21 16:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from domob at gcc dot gnu dot org  2010-08-21 16:57 -------
*** Bug 45369 has been marked as a duplicate of this bug. ***


-- 

domob at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clerman at fuse dot net


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2010-08-21 16:57 ` domob at gcc dot gnu dot org
@ 2010-08-21 16:59 ` domob at gcc dot gnu dot org
  2010-08-26 19:50 ` domob at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-08-21 16:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from domob at gcc dot gnu dot org  2010-08-21 16:58 -------
See also PR 45369 which has a rather complicated test-case for association to
derived-types (as is currently not yet working).


-- 


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2010-08-21 16:59 ` domob at gcc dot gnu dot org
@ 2010-08-26 19:50 ` domob at gcc dot gnu dot org
  2010-08-26 19:54 ` domob at gcc dot gnu dot org
  2010-09-23  8:38 ` domob at gcc dot gnu dot org
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-08-26 19:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from domob at gcc dot gnu dot org  2010-08-26 19:49 -------
Subject: Bug 38936

Author: domob
Date: Thu Aug 26 19:48:43 2010
New Revision: 163572

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163572
Log:
2010-08-26  Daniel Kraft  <d@domob.eu>

        PR fortran/38936
        PR fortran/44047
        PR fortran/45384
        * gfortran.h (struct gfc_association_list): New flag `dangling'.
        (gfc_build_block_ns): Declared here...
        * parse.h (gfc_build_block_ns): ...instead of here.
        * trans.h (gfc_process_block_locals): Expect additionally the
        gfc_association_list of BLOCK (if present).
        * match.c (select_type_set_tmp): Create sym->assoc for temporary.
        * resolve.c (resolve_variable): Only check for invalid *array*
        references on associate-names.
        (resolve_assoc_var): New method with code previously in resolve_symbol.
        (resolve_select_type): Use association to give the selector and
        temporaries their values instead of ordinary assignment.
        (resolve_fl_var_and_proc): Allow CLASS associate-names.
        (resolve_symbol): Use new `resolve_assoc_var' instead of inlining here.
        * trans-stmt.c (gfc_trans_block_construct): Pass association-list
        to `gfc_process_block_locals' to match new interface.
        * trans-decl.c (gfc_get_symbol_decl): Don't defer associate-names
        here automatically.
        (gfc_process_block_locals): Defer them rather here when linked to
        from the BLOCK's association list.

2010-08-26  Daniel Kraft  <d@domob.eu>

        PR fortran/38936
        PR fortran/44047
        PR fortran/45384
        * gfortran.dg/associate_8.f03: New test.
        * gfortran.dg/select_type_13.f03: New test.
        * gfortran.dg/select_type_14.f03: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/associate_8.f03
    trunk/gcc/testsuite/gfortran.dg/select_type_13.f03
    trunk/gcc/testsuite/gfortran.dg/select_type_14.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/parse.h
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/fortran/trans-stmt.c
    trunk/gcc/fortran/trans.h
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2010-08-26 19:50 ` domob at gcc dot gnu dot org
@ 2010-08-26 19:54 ` domob at gcc dot gnu dot org
  2010-09-23  8:38 ` domob at gcc dot gnu dot org
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-08-26 19:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from domob at gcc dot gnu dot org  2010-08-26 19:54 -------
This fixed association to CLASS entities and also reworked SELECT TYPE to use
the same workings internally.  Still open:  Association to strings and
derived-types, and the extended checks for illegal usage of names associated to
expressions.


-- 


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


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

* [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr)
  2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2010-08-26 19:54 ` domob at gcc dot gnu dot org
@ 2010-09-23  8:38 ` domob at gcc dot gnu dot org
  15 siblings, 0 replies; 17+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-09-23  8:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from domob at gcc dot gnu dot org  2010-09-23 08:38 -------
Subject: Bug 38936

Author: domob
Date: Thu Sep 23 08:37:54 2010
New Revision: 164550

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164550
Log:
2010-09-23  Daniel Kraft  <d@domob.eu>

        PR fortran/38936
        PR fortran/44044
        PR fortran/45474
        * gfortran.h (gfc_check_vardef_context): New method.
        (struct symbol_attribute): New flag `select_type_temporary'.
        * primary.c (gfc_variable_attr): Clarify initialization of ref.
        (match_variable): Remove PROTECTED check and assignment check
        for PARAMETERs (this is now done later).
        * match.c (gfc_match_iterator): Remove INTENT(IN) check.
        (gfc_match_associate): Defer initialization of newAssoc->variable.
        (gfc_match_nullify): Remove PURE definability check.
        (select_type_set_tmp): Set new `select_type_temporary' flag.
        * expr.c (gfc_check_assign): Remove INTENT(IN) check here.
        (gfc_check_pointer_assign): Ditto (and other checks removed).
        (gfc_check_vardef_context): New method.
        * interface.c (compare_parameter_protected): Removed.
        (compare_actual_formal): Use `gfc_check_vardef_context' for checks
        related to INTENT([IN]OUT) arguments.
        * intrinsic.c (check_arglist): Check INTENT for intrinsics.
        * resolve.c (gfc_resolve_iterator): Use `gfc_check_vardef_context'.
        (remove_last_array_ref): New method.
        (resolve_deallocate_expr), (resolve_allocate_expr): Ditto.
        (resolve_allocate_deallocate): Ditto (for STAT and ERRMSG).
        (resolve_assoc_var): Remove checks for definability here.
        (resolve_select_type): Handle resolving of code->block here.
        (resolve_ordinary_assign): Remove PURE check.
        (resolve_code): Do not resolve code->blocks for SELECT TYPE here.
        Use `gfc_check_vardef_context' for assignments and pointer-assignments.

2010-09-23  Daniel Kraft  <d@domob.eu>

        PR fortran/38936
        PR fortran/44044
        PR fortran/45474
        * gfortran.dg/intrinsic_intent_1.f03: New test.
        * gfortran.dg/select_type_17.f03: New test.
        * gfortran.dg/associate_5.f03: More definability tests.
        * gfortran.dg/enum_2.f90: Check definability.
        * gfortran.dg/allocatable_dummy_2.f90: Change expected error message.
        * gfortran.dg/allocate_alloc_opt_2.f90: Ditto.
        * gfortran.dg/char_expr_2.f90: Ditto.
        * gfortran.dg/deallocate_alloc_opt_2.f90: Ditto.
        * gfortran.dg/enum_5.f90: Ditto.
        * gfortran.dg/equiv_constraint_8.f90: Ditto.
        * gfortran.dg/impure_assignment_2.f90: Ditto.
        * gfortran.dg/impure_assignment_3.f90: Ditto.
        * gfortran.dg/intent_out_1.f90: Ditto.
        * gfortran.dg/intent_out_3.f90: Ditto.
        * gfortran.dg/pointer_assign_7.f90: Ditto.
        * gfortran.dg/pointer_intent_3.f90: Ditto.
        * gfortran.dg/pr19936_1.f90: Ditto.
        * gfortran.dg/proc_ptr_comp_3.f90: Ditto.
        * gfortran.dg/simpleif_2.f90: Ditto.
        * gfortran.dg/protected_5.f90: Ditto.
        * gfortran.dg/protected_4.f90: Ditto and remove invalid error check.
        * gfortran.dg/protected_6.f90: Ditto.
        * gfortran.dg/protected_7.f90: Ditto.

Added:
    trunk/gcc/testsuite/gfortran.dg/intrinsic_intent_1.f03
    trunk/gcc/testsuite/gfortran.dg/select_type_17.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/interface.c
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/allocatable_dummy_2.f90
    trunk/gcc/testsuite/gfortran.dg/allocate_alloc_opt_2.f90
    trunk/gcc/testsuite/gfortran.dg/associate_5.f03
    trunk/gcc/testsuite/gfortran.dg/char_expr_2.f90
    trunk/gcc/testsuite/gfortran.dg/deallocate_alloc_opt_2.f90
    trunk/gcc/testsuite/gfortran.dg/enum_2.f90
    trunk/gcc/testsuite/gfortran.dg/enum_5.f90
    trunk/gcc/testsuite/gfortran.dg/equiv_constraint_8.f90
    trunk/gcc/testsuite/gfortran.dg/impure_assignment_2.f90
    trunk/gcc/testsuite/gfortran.dg/impure_assignment_3.f90
    trunk/gcc/testsuite/gfortran.dg/intent_out_1.f90
    trunk/gcc/testsuite/gfortran.dg/intent_out_3.f90
    trunk/gcc/testsuite/gfortran.dg/pointer_assign_7.f90
    trunk/gcc/testsuite/gfortran.dg/pointer_intent_3.f90
    trunk/gcc/testsuite/gfortran.dg/pr19936_1.f90
    trunk/gcc/testsuite/gfortran.dg/proc_ptr_comp_3.f90
    trunk/gcc/testsuite/gfortran.dg/protected_4.f90
    trunk/gcc/testsuite/gfortran.dg/protected_5.f90
    trunk/gcc/testsuite/gfortran.dg/protected_6.f90
    trunk/gcc/testsuite/gfortran.dg/protected_7.f90
    trunk/gcc/testsuite/gfortran.dg/simpleif_2.f90


-- 


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


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

end of thread, other threads:[~2010-09-23  8:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-22 14:00 [Bug fortran/38936] New: F2003: ASSOCIATE construct burnus at gcc dot gnu dot org
2009-01-22 17:27 ` [Bug fortran/38936] " domob at gcc dot gnu dot org
2009-01-25 10:19 ` tkoenig at gcc dot gnu dot org
2009-10-09 12:08 ` [Bug fortran/38936] F2003: ASSOCIATE construct / improved SELECT TYPE (a=>expr) burnus at gcc dot gnu dot org
2010-05-08 13:24 ` domob at gcc dot gnu dot org
2010-06-10 14:48 ` domob at gcc dot gnu dot org
2010-06-10 16:50 ` domob at gcc dot gnu dot org
2010-08-15 19:46 ` domob at gcc dot gnu dot org
2010-08-15 20:25 ` domob at gcc dot gnu dot org
2010-08-16  8:59 ` domob at gcc dot gnu dot org
2010-08-17  8:20 ` domob at gcc dot gnu dot org
2010-08-17  8:24 ` domob at gcc dot gnu dot org
2010-08-21 16:57 ` domob at gcc dot gnu dot org
2010-08-21 16:59 ` domob at gcc dot gnu dot org
2010-08-26 19:50 ` domob at gcc dot gnu dot org
2010-08-26 19:54 ` domob at gcc dot gnu dot org
2010-09-23  8:38 ` domob 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).