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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-28 
07:51:02 UTC ---
(In reply to comment #2)
> -      conf2 (is_bind_c);
> +      if (!(name && (strcmp(name, "c_null_ptr") == 0 || strcmp(name,
> "c_null_funptr") == 0)))
> +    conf2 (is_bind_c);

I think one should use "if (!is_iso_c)". And why do you keep the save
attribute? I think the following should work as well.

(Actually, reading it again, the "Set up the symbol's important fields." is not
really a useful comment - and could thus go.)

--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -744,5 +744,6 @@ check_conflict (symbol_attribute *attr, const char *name,
locus *where)
       conf2 (value);
-      conf2 (is_bind_c);
       conf2 (codimension);
       conf2 (result);
+      if (!attr->is_iso_c)
+       conf2 (is_bind_c);
       break;
@@ -3765,5 +3766,3 @@ gen_special_c_interop_ptr (int ptr_id, const char 

-  /* Set up the symbol's important fields.  Save attr required so we can
-     initialize the ptr to NULL.  */
-  tmp_sym->attr.save = SAVE_EXPLICIT;
+  /* Set up the symbol's important fields. */
   tmp_sym->ts.is_c_interop = 1;
@@ -3772,2 +3771,3 @@ gen_special_c_interop_ptr (int ptr_id, const char 
   tmp_sym->ts.type = BT_DERIVED;
+  tmp_sym->attr.flavor = FL_PARAMETER;

@@ -3819,5 +3819,2 @@ gen_special_c_interop_ptr (int ptr_id, const char 
   c->expr->ts.is_iso_c = 1;
-  /* Must declare c_null_ptr and c_null_funptr as having the
-     PARAMETER attribute so they can be used in init expressions.  */
-  tmp_sym->attr.flavor = FL_PARAMETER;

Reply via email to