OSDN Git Service

* trans.h (gfc_inline_intrinsic_function_p): Move prototype...
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Nov 2011 23:58:20 +0000 (23:58 +0000)
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Nov 2011 23:58:20 +0000 (23:58 +0000)
* gfortran.h (gfc_inline_intrinsic_function_p): ... here.
* dependency.c (gfc_check_argument_var_dependency): Check dependencies
of inline intrinsics' arguments.

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

gcc/fortran/ChangeLog
gcc/fortran/dependency.c
gcc/fortran/gfortran.h
gcc/fortran/trans.h

index f8a8366..a1faa78 100644 (file)
@@ -1,5 +1,12 @@
 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
 
+       * trans.h (gfc_inline_intrinsic_function_p): Move prototype...
+       * gfortran.h (gfc_inline_intrinsic_function_p): ... here.
+       * dependency.c (gfc_check_argument_var_dependency): Check dependencies
+       of inline intrinsics' arguments.
+
+2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
+
        * trans-array.c (gfc_trans_preloop_setup): New pointers to outer
        dimension's ss and loop. Use them.
 
index c43af00..fd7fa73 100644 (file)
@@ -713,6 +713,17 @@ gfc_check_argument_var_dependency (gfc_expr *var, sym_intent intent,
            return gfc_check_fncall_dependency (var, intent, NULL,
                                                expr->value.function.actual,
                                                ELEM_CHECK_VARIABLE);
+
+         if (gfc_inline_intrinsic_function_p (expr))
+           {
+             /* The TRANSPOSE case should have been caught in the
+                noncopying intrinsic case above.  */
+             gcc_assert (expr->value.function.isym->id != GFC_ISYM_TRANSPOSE);
+
+             return gfc_check_fncall_dependency (var, intent, NULL,
+                                                 expr->value.function.actual,
+                                                 ELEM_CHECK_VARIABLE);
+           }
        }
       return 0;
 
index da3477d..b869ca3 100644 (file)
@@ -2880,6 +2880,9 @@ void gfc_generate_code (gfc_namespace *);
 void gfc_generate_module_code (gfc_namespace *);
 void gfc_init_coarray_decl (bool);
 
+/* trans-intrinsic.c */
+bool gfc_inline_intrinsic_function_p (gfc_expr *);
+
 /* bbt.c */
 typedef int (*compare_fn) (void *, void *);
 void gfc_insert_bbt (void *, void *, compare_fn);
index 4d745f1..5757865 100644 (file)
@@ -396,9 +396,6 @@ tree gfc_builtin_decl_for_float_kind (enum built_in_function, int);
 tree gfc_conv_intrinsic_subroutine (gfc_code *);
 void gfc_conv_intrinsic_function (gfc_se *, gfc_expr *);
 
-/* Is the intrinsic expanded inline.  */
-bool gfc_inline_intrinsic_function_p (gfc_expr *);
-
 /* Does an intrinsic map directly to an external library call
    This is true for array-returning intrinsics, unless
    gfc_inline_intrinsic_function_p returns true.  */