[Bug fortran/59107] [4.8/4.9/5 Regression] Spurious Type specified for intrinsic function 'command_argument_count' at (1) is ignored under -Wsurprising.

2015-03-21 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59107

--- Comment #12 from Dominique d'Humieres dominiq at lps dot ens.fr ---
@@ -6930,7 +6931,9 @@ resolve_allocate_expr (gfc_expr *e, gfc_
   goto failure;
 }

-  if (code-ext.alloc.ts.type == BT_CHARACTER  !e-ts.deferred)
+  /* Check F08:C632.  */
+  if (code-ext.alloc.ts.type == BT_CHARACTER  !e-ts.deferred
+   !UNLIMITED_POLY (e))
 {
   int cmp = gfc_dep_compare_expr (e-ts.u.cl-length,
   code-ext.alloc.ts.u.cl-length);

in comment 11 is a left over of another patch.


[Bug fortran/59107] [4.8/4.9/5 Regression] Spurious Type specified for intrinsic function 'command_argument_count' at (1) is ignored under -Wsurprising.

2015-01-22 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59107

--- Comment #11 from Dominique d'Humieres dominiq at lps dot ens.fr ---
Updated patch for 5.0

--- ../_clean/gcc/fortran/gfortran.h2015-01-19 02:01:40.0 +0100
+++ gcc/fortran/gfortran.h2015-01-22 11:42:56.0 +0100
@@ -1451,7 +1451,7 @@ typedef struct gfc_symbol
   /* Set if this variable is used as an index name in a FORALL.  */
   unsigned forall_index:1;
   /* Used to avoid multiple resolutions of a single symbol.  */
-  unsigned resolved:1;
+  unsigned resolve_symbol_called:2;

   int refs;
   struct gfc_namespace *ns;/* namespace containing this symbol */
--- ../_clean/gcc/fortran/resolve.c2015-01-18 17:58:11.0 +0100
+++ gcc/fortran/resolve.c2015-01-22 11:41:38.0 +0100
@@ -1625,8 +1625,9 @@ gfc_resolve_intrinsic (gfc_symbol *sym, 
   gfc_intrinsic_sym* isym = NULL;
   const char* symstd;

-  if (sym-formal)
+  if (sym-resolve_symbol_called = 2)
 return true;
+  sym-resolve_symbol_called = 2;

   /* Already resolved.  */
   if (sym-from_intmod  sym-ts.type != BT_UNKNOWN)
@@ -6930,7 +6931,9 @@ resolve_allocate_expr (gfc_expr *e, gfc_
   goto failure;
 }

-  if (code-ext.alloc.ts.type == BT_CHARACTER  !e-ts.deferred)
+  /* Check F08:C632.  */
+  if (code-ext.alloc.ts.type == BT_CHARACTER  !e-ts.deferred
+   !UNLIMITED_POLY (e))
 {
   int cmp = gfc_dep_compare_expr (e-ts.u.cl-length,
   code-ext.alloc.ts.u.cl-length);
@@ -13082,9 +13085,9 @@ resolve_symbol (gfc_symbol *sym)
   gfc_array_spec *as;
   bool saved_specification_expr;

-  if (sym-resolved)
+  if (sym-resolve_symbol_called = 1)
 return;
-  sym-resolved = 1;
+  sym-resolve_symbol_called = 1;

   if (sym-attr.artificial)
 return;

It regtest cleanly.

If it helps, I can take this PR.


[Bug fortran/59107] [4.8/4.9/5 Regression] Spurious Type specified for intrinsic function 'command_argument_count' at (1) is ignored under -Wsurprising.

2014-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59107

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|4.8.4   |4.8.5

--- Comment #10 from Jakub Jelinek jakub at gcc dot gnu.org ---
GCC 4.8.4 has been released.