OSDN Git Service

2010-04-06 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Apr 2010 16:26:02 +0000 (16:26 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:16:52 +0000 (14:16 +0900)
        PR fortran/39997
        * intrinsic.c (add_functions): Add num_images.
        * decl.c (gfc_match_end): Handle END CRITICAL.
        * intrinsic.h (gfc_simplify_num_images): Add prototype.
        * dump-parse-tree.c (show_code_node): Dump CRITICAL, ERROR STOP,
        and SYNC.
        * gfortran.h (gfc_statement): Add enum items for those.
        (gfc_exec_op) Ditto.
        (gfc_isym_id): Add num_images.
        * trans-stmt.c (gfc_trans_stop): Handle ERROR STOP.
        (gfc_trans_sync,gfc_trans_critical): New functions.
        * trans-stmt.h (gfc_trans_stop,gfc_trans_sync,
        gfc_trans_critical): Add/update prototypes.
        * trans.c (gfc_trans_code): Handle CRITICAL, ERROR STOP,
        and SYNC statements.
        * trans.h (gfor_fndecl_error_stop_string) Add variable.
        * resolve.c (resolve_sync): Add function.
        (gfc_resolve_blocks): Handle CRITICAL.
        (resolve_code): Handle CRITICAL, ERROR STOP,
        (resolve_branch): Add CRITICAL constraint check.
        and SYNC statements.
        * st.c (gfc_free_statement): Add new statements.
        * trans-decl.c (gfor_fndecl_error_stop_string): Global variable.
        (gfc_build_builtin_function_decls): Initialize it.
        * match.c (gfc_match_if): Handle ERROR STOP and SYNC.
        (gfc_match_critical, gfc_match_error_stop, sync_statement,
        gfc_match_sync_all, gfc_match_sync_images,
gfc_match_sync_memory):
        New functions.
        (match_exit_cycle): Handle CRITICAL constraint.
        (gfc_match_stopcode): Handle ERROR STOP.
        * match.h (gfc_match_critical, gfc_match_error_stop,
        gfc_match_sync_all, gfc_match_sync_images,
        gfc_match_sync_memory): Add prototype.
        * parse.c (decode_statement, gfc_ascii_statement,
        parse_executable): Handle new statements.
        (parse_critical_block): New function.
        * parse.h (gfc_compile_state): Add COMP_CRITICAL.
        * intrinsic.texi (num_images): Document new function.
        * simplify.c (gfc_simplify_num_images): Add function.

2010-04-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/39997
        * gfortran.dg/coarray_1.f90: New test.
        * gfortran.dg/coarray_2.f90: New test.
        * gfortran.dg/coarray_3.f90: New test.

2010-04-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/39997
        * runtime/stop.c (error_stop_string): New function.
        * gfortran.map (_gfortran_error_stop_string): Add.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158008 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/intrinsic.texi
gcc/fortran/match.c
gcc/fortran/resolve.c
gcc/fortran/simplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/coarray_1.f90
gcc/testsuite/gfortran.dg/coarray_2.f90
gcc/testsuite/gfortran.dg/coarray_3.f90
libgfortran/ChangeLog

index 97a2fca..8af3668 100644 (file)
@@ -1,5 +1,47 @@
 2010-04-06  Tobias Burnus  <burnus@net-b.de>
 
+       PR fortran/39997
+       * intrinsic.c (add_functions): Add num_images.
+       * decl.c (gfc_match_end): Handle END CRITICAL.
+       * intrinsic.h (gfc_simplify_num_images): Add prototype.
+       * dump-parse-tree.c (show_code_node): Dump CRITICAL, ERROR STOP,
+       and SYNC.
+       * gfortran.h (gfc_statement): Add enum items for those.
+       (gfc_exec_op) Ditto.
+       (gfc_isym_id): Add num_images.
+       * trans-stmt.c (gfc_trans_stop): Handle ERROR STOP.
+       (gfc_trans_sync,gfc_trans_critical): New functions.
+       * trans-stmt.h (gfc_trans_stop,gfc_trans_sync,
+       gfc_trans_critical): Add/update prototypes.
+       * trans.c (gfc_trans_code): Handle CRITICAL, ERROR STOP,
+       and SYNC statements.
+       * trans.h (gfor_fndecl_error_stop_string) Add variable.
+       * resolve.c (resolve_sync): Add function.
+       (gfc_resolve_blocks): Handle CRITICAL.
+       (resolve_code): Handle CRITICAL, ERROR STOP,
+       (resolve_branch): Add CRITICAL constraint check.
+       and SYNC statements.
+       * st.c (gfc_free_statement): Add new statements.
+       * trans-decl.c (gfor_fndecl_error_stop_string): Global variable.
+       (gfc_build_builtin_function_decls): Initialize it.
+       * match.c (gfc_match_if): Handle ERROR STOP and SYNC.
+       (gfc_match_critical, gfc_match_error_stop, sync_statement,
+       gfc_match_sync_all, gfc_match_sync_images, gfc_match_sync_memory):
+       New functions.
+       (match_exit_cycle): Handle CRITICAL constraint.
+       (gfc_match_stopcode): Handle ERROR STOP.
+       * match.h (gfc_match_critical, gfc_match_error_stop,
+       gfc_match_sync_all, gfc_match_sync_images,
+       gfc_match_sync_memory): Add prototype.
+       * parse.c (decode_statement, gfc_ascii_statement,
+       parse_executable): Handle new statements.
+       (parse_critical_block): New function.
+       * parse.h (gfc_compile_state): Add COMP_CRITICAL.
+       * intrinsic.texi (num_images): Document new function.
+       * simplify.c (gfc_simplify_num_images): Add function.
+
+2010-04-06  Tobias Burnus  <burnus@net-b.de>
+
        PR fortran/43178
        * trans-array.c (gfc_conv_expr_descriptor): Update
        gfc_trans_scalar_assign call.
index d8456e8..53f656a 100644 (file)
@@ -8575,7 +8575,7 @@ END IF
 @end smallexample
 
 @item @emph{See also}:
-@ref{THIS_IMAGE}, @ref{IMAGE_INDEX}
+@c FIXME: ref{THIS_IMAGE}
 @end table
 
 
index 3dfe088..5886691 100644 (file)
@@ -1,6 +1,5 @@
 /* Matching subroutines in all sizes, shapes and colors.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-   2009, 2010
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
    2010 Free Software Foundation, Inc.
    Contributed by Andy Vaught
 
@@ -1751,12 +1750,6 @@ gfc_match_critical (void)
       == FAILURE)
     return MATCH_ERROR;
 
-  if (gfc_option.coarray == GFC_FCOARRAY_NONE)
-    {
-       gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
-       return MATCH_ERROR;
-    }
-
   if (gfc_find_state (COMP_CRITICAL) == SUCCESS)
     {
       gfc_error ("Nested CRITICAL block at %C");
@@ -2152,12 +2145,6 @@ sync_statement (gfc_statement st)
       == FAILURE)
     return MATCH_ERROR;
 
-  if (gfc_option.coarray == GFC_FCOARRAY_NONE)
-    {
-       gfc_fatal_error ("Coarrays disabled at %C, use -fcoarray= to enable");
-       return MATCH_ERROR;
-    }
-
   if (gfc_find_state (COMP_CRITICAL) == SUCCESS)
     {
       gfc_error ("Image control statement SYNC at %C in CRITICAL block");
index ce7140f..1197792 100644 (file)
@@ -7617,8 +7617,7 @@ resolve_sync (gfc_code *code)
               && gfc_simplify_expr (code->expr1, 0) == SUCCESS)
        {
           gfc_constructor *cons;
-          cons = gfc_constructor_first (code->expr1->value.constructor);
-          for (; cons; cons = gfc_constructor_next (cons))
+          for (cons = code->expr1->value.constructor; cons; cons = cons->next)
             if (cons->expr->expr_type == EXPR_CONSTANT
                 &&  mpz_cmp_si (cons->expr->value.integer, 1) < 0)
               gfc_error ("Imageset argument at %L must between 1 and "
index 743c463..60fbf01 100644 (file)
@@ -3868,6 +3868,17 @@ gfc_simplify_num_images (void)
 
 
 gfc_expr *
+gfc_simplify_num_images (void)
+{
+  gfc_expr *result;
+  /* FIXME: gfc_current_locus is wrong.  */
+  result = gfc_constant_result (BT_INTEGER, gfc_default_integer_kind, &gfc_current_locus);
+  mpz_set_si (result->value.integer, 1);
+  return result;
+}
+
+
+gfc_expr *
 gfc_simplify_or (gfc_expr *x, gfc_expr *y)
 {
   gfc_expr *result;
index b32b730..35fd733 100644 (file)
@@ -1,3 +1,10 @@
+2010-04-06  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/39997
+       * gfortran.dg/coarray_1.f90: New test.
+       * gfortran.dg/coarray_2.f90: New test.
+       * gfortran.dg/coarray_3.f90: New test.
+
 2010-04-06  Jason Merrill  <jason@redhat.com>
 
        PR c++/43648
index 7fd4c84..ba10d64 100644 (file)
@@ -13,6 +13,6 @@ sync memory  ! { dg-error "Fortran 2008:" }
 sync images(*)  ! { dg-error "Fortran 2008:" }
 
 ! num_images is implicitly defined:
-n = num_images()  ! { dg-error "has no IMPLICIT type" }
+n = num_images()  ! { dg-error "convert UNKNOWN to INTEGER" }
 error stop 'stop'  ! { dg-error "Fortran 2008:" }
 end
index 902a0dd..1fcb9b8 100644 (file)
@@ -1,5 +1,4 @@
 ! { dg-do run }
-! { dg-options "-fcoarray=single" }
 ! { dg-shouldfail "error stop" }
 ! 
 ! Coarray support
index 63c3bd3..648f2fa 100644 (file)
@@ -1,5 +1,4 @@
 ! { dg-do compile }
-! { dg-options "-fcoarray=single" }
 ! 
 ! Coarray support
 ! PR fortran/18918
index 70700a3..78c6b04 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-06  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/39997
+       * runtime/stop.c (error_stop_string): New function.
+       * gfortran.map (_gfortran_error_stop_string): Add.
+
 2010-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * Makefile.in: Regenerate.
@@ -7,7 +13,7 @@
 
        PR libfortran/43605
        * io/intrinsics.c (gf_ftell): New function, seek to correct offset.
-        (ftell): Call gf_ftell.
+       (ftell): Call gf_ftell.
        (FTELL_SUB): Likewise.
 
 2010-04-01  Paul Thomas  <pault@gcc.gnu.org>