OSDN Git Service

2009-08-05 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Aug 2009 08:35:36 +0000 (08:35 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Aug 2009 08:35:36 +0000 (08:35 +0000)
        PR fortran/40955
        * gfortran.h (ext_attr_id_t): Add typedef for this enum.
        (gfc_add_ext_attribute): Use it.
        * decl.c (gfc_match_gcc_attributes): Ditto.
        * expr.c (gfc_check_pointer_assign): Ditto.
        * symbol.c (gfc_add_ext_attribute): Ditto.
        (gfc_copy_attr): Copy also ext_attr.
        * resolve.c (resolve_fl_derived,resolve_symbol): Ditto.
        * module.c (mio_symbol_attribute): Save ext_attr in the mod
        * file.

2009-08-05  Tobias Burnus  <burnus@net-b.de>

        PR fortran/40955
        * gfortran.dg/module_md5_1.f90: Update MD5 check sum.

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

gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/expr.c
gcc/fortran/gfortran.h
gcc/fortran/module.c
gcc/fortran/resolve.c
gcc/fortran/symbol.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/module_md5_1.f90

index a34b2c2..a064c8a 100644 (file)
@@ -1,5 +1,17 @@
 2009-08-05  Tobias Burnus  <burnus@net-b.de>
 
+       PR fortran/40955
+       * gfortran.h (ext_attr_id_t): Add typedef for this enum.
+       (gfc_add_ext_attribute): Use it.
+       * decl.c (gfc_match_gcc_attributes): Ditto.
+       * expr.c (gfc_check_pointer_assign): Ditto.
+       * symbol.c (gfc_add_ext_attribute): Ditto.
+       (gfc_copy_attr): Copy also ext_attr.
+       * resolve.c (resolve_fl_derived,resolve_symbol): Ditto.
+       * module.c (mio_symbol_attribute): Save ext_attr in the mod file.
+
+2009-08-05  Tobias Burnus  <burnus@net-b.de>
+
        PR fortran/40969
        Revert:
        2009-08-04  Tobias Burnus  <burnus@net-b.de>
index 86f41a3..67ccfda 100644 (file)
@@ -7678,7 +7678,7 @@ gfc_match_gcc_attributes (void)
          return MATCH_ERROR;
        }
 
-      if (gfc_add_ext_attribute (&attr, id, &gfc_current_locus)
+      if (gfc_add_ext_attribute (&attr, (ext_attr_id_t) id, &gfc_current_locus)
          == FAILURE)
        return MATCH_ERROR;
 
index df399b9..b0e58b3 100644 (file)
@@ -3195,9 +3195,9 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
          symbol_attribute cdecl, stdcall, fastcall;
          unsigned calls;
 
-         gfc_add_ext_attribute (&cdecl, (unsigned) EXT_ATTR_CDECL, NULL);
-         gfc_add_ext_attribute (&stdcall, (unsigned) EXT_ATTR_STDCALL, NULL);
-         gfc_add_ext_attribute (&fastcall, (unsigned) EXT_ATTR_FASTCALL, NULL);
+         gfc_add_ext_attribute (&cdecl, EXT_ATTR_CDECL, NULL);
+         gfc_add_ext_attribute (&stdcall, EXT_ATTR_STDCALL, NULL);
+         gfc_add_ext_attribute (&fastcall, EXT_ATTR_FASTCALL, NULL);
          calls = cdecl.ext_attr | stdcall.ext_attr | fastcall.ext_attr;
 
          if ((calls & lvalue->symtree->n.sym->attr.ext_attr)
index da3d5f0..cefe3ec 100644 (file)
@@ -621,7 +621,7 @@ extern CInteropKind_t c_interop_kinds_table[];
 
 
 /* Structure and list of supported extension attributes.  */
-enum
+typedef enum
 {
   EXT_ATTR_DLLIMPORT = 0,
   EXT_ATTR_DLLEXPORT,
@@ -629,7 +629,8 @@ enum
   EXT_ATTR_CDECL,
   EXT_ATTR_FASTCALL,
   EXT_ATTR_LAST, EXT_ATTR_NUM = EXT_ATTR_LAST
-};
+}
+ext_attr_id_t;
 
 typedef struct
 {
@@ -2334,7 +2335,7 @@ gfc_try gfc_set_default_type (gfc_symbol *, int, gfc_namespace *);
 void gfc_set_sym_referenced (gfc_symbol *);
 
 gfc_try gfc_add_attribute (symbol_attribute *, locus *);
-gfc_try gfc_add_ext_attribute (symbol_attribute *, unsigned, locus *);
+gfc_try gfc_add_ext_attribute (symbol_attribute *, ext_attr_id_t, locus *);
 gfc_try gfc_add_allocatable (symbol_attribute *, locus *);
 gfc_try gfc_add_dimension (symbol_attribute *, const char *, locus *);
 gfc_try gfc_add_external (symbol_attribute *, locus *);
index eff482c..5d64fd1 100644 (file)
@@ -1752,6 +1752,7 @@ static void
 mio_symbol_attribute (symbol_attribute *attr)
 {
   atom_type t;
+  unsigned ext_attr;
 
   mio_lparen ();
 
@@ -1760,6 +1761,9 @@ mio_symbol_attribute (symbol_attribute *attr)
   attr->proc = MIO_NAME (procedure_type) (attr->proc, procedures);
   attr->if_source = MIO_NAME (ifsrc) (attr->if_source, ifsrc_types);
   attr->save = MIO_NAME (save_state) (attr->save, save_status);
+  ext_attr = attr->ext_attr;
+  mio_integer ((int *) &ext_attr);
+  attr->ext_attr = ext_attr;
 
   if (iomode == IO_OUTPUT)
     {
index 14a111e..39f3cdc 100644 (file)
@@ -9217,6 +9217,7 @@ resolve_fl_derived (gfc_symbol *sym)
              c->attr.elemental = ifc->attr.elemental;
              c->attr.recursive = ifc->attr.recursive;
              c->attr.always_explicit = ifc->attr.always_explicit;
+             c->attr.ext_attr |= ifc->attr.ext_attr;
              /* Replace symbols in array spec.  */
              if (c->as)
                {
@@ -9712,6 +9713,7 @@ resolve_symbol (gfc_symbol *sym)
          sym->attr.dimension = ifc->attr.dimension;
          sym->attr.recursive = ifc->attr.recursive;
          sym->attr.always_explicit = ifc->attr.always_explicit;
+          sym->attr.ext_attr |= ifc->attr.ext_attr;
          /* Copy array spec.  */
          sym->as = gfc_copy_array_spec (ifc->as);
          if (sym->as)
index ec4afbe..b86afc0 100644 (file)
@@ -810,7 +810,7 @@ duplicate_attr (const char *attr, locus *where)
 
 
 gfc_try
-gfc_add_ext_attribute (symbol_attribute *attr, unsigned ext_attr,
+gfc_add_ext_attribute (symbol_attribute *attr, ext_attr_id_t ext_attr,
                       locus *where ATTRIBUTE_UNUSED)
 {
   attr->ext_attr |= 1 << ext_attr;
@@ -1641,6 +1641,8 @@ gfc_copy_attr (symbol_attribute *dest, symbol_attribute *src, locus *where)
 {
   int is_proc_lang_bind_spec;
   
+  dest->ext_attr = src->ext_attr;
+
   if (src->allocatable && gfc_add_allocatable (dest, where) == FAILURE)
     goto fail;
 
index 0619270..c45d289 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-05  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/40955
+       * gfortran.dg/module_md5_1.f90: Update MD5 check sum.
+
 2009-08-09  Bernd Schmidt  <bernd.schmidt@analog.com>
 
        * gcc.target/bfin/loop-autoinc.c: New file.
 
 2009-08-08  Laurent GUERBY  <laurent@guerby.net>
 
-        * ada/acats/support/impdef.a: Tweak timing constants. Add
-        Long_Minimum_Task_Switch and Long_Switch_To_New_Task.
-        * ada/acats/tests/c9/c940005.a: Use new timing constants.
-        * ada/acats/tests/c9/c940007.a: Likewise.
-        * ada/acats/tests/c9/c94001c.ada: Likewise.
-        * ada/acats/tests/c9/c94006a.ada: Likewise.
-        * ada/acats/tests/c9/c94008c.ada: Likewise.
-        * ada/acats/tests/c9/c951002.a: Likewise.
-        * ada/acats/tests/c9/c954a01.a: Likewise.
-        * ada/acats/tests/c9/c96001a.ada: Likewise.
-        * ada/acats/tests/c9/c97307a.ada: Likewise.
+       * ada/acats/support/impdef.a: Tweak timing constants. Add
+       Long_Minimum_Task_Switch and Long_Switch_To_New_Task.
+       * ada/acats/tests/c9/c940005.a: Use new timing constants.
+       * ada/acats/tests/c9/c940007.a: Likewise.
+       * ada/acats/tests/c9/c94001c.ada: Likewise.
+       * ada/acats/tests/c9/c94006a.ada: Likewise.
+       * ada/acats/tests/c9/c94008c.ada: Likewise.
+       * ada/acats/tests/c9/c951002.a: Likewise.
+       * ada/acats/tests/c9/c954a01.a: Likewise.
+       * ada/acats/tests/c9/c96001a.ada: Likewise.
+       * ada/acats/tests/c9/c97307a.ada: Likewise.
 
 2009-08-07  Richard Guenther  <rguenther@suse.de>
 
index f52426f..7aeeb80 100644 (file)
@@ -10,5 +10,5 @@ program test
   use foo
   print *, pi
 end program test
-! { dg-final { scan-module "foo" "MD5:596df8f39d3ddc0b847771cadcb26274" } }
+! { dg-final { scan-module "foo" "MD5:dc2fd1358dcaddc25e3c89dae859ef32" } }
 ! { dg-final { cleanup-modules "foo" } }