diff options
author | Tobias Burnus <burnus@net-b.de> | 2009-08-12 11:03:38 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2009-08-12 11:03:38 +0200 |
commit | c0e18b82d02f04edf9b909a75b93092582480fff (patch) | |
tree | b5306121797a925d9c7fbb3c6d5fe0d288dd6ebc /gcc/fortran/expr.c | |
parent | 64754ed578905416836c748cf442eb380996d980 (diff) | |
download | gcc-c0e18b82d02f04edf9b909a75b93092582480fff.zip gcc-c0e18b82d02f04edf9b909a75b93092582480fff.tar.gz gcc-c0e18b82d02f04edf9b909a75b93092582480fff.tar.bz2 |
re PR fortran/41034 (Wrongly rejected proc pointer assignment with CDECL (compiler-directive_1.f90))
2009-08-12 Tobias Burnus <burnus@net-b.de>
PR fortran/41034
* symbol.c (gfc_copy_attr): Merge bits instead of replace
bits in gfc_copy_attr.
* gfc_check_pointer_assign (gfc_check_pointer_assign):
Initialize ext_attr bits by zero.
From-SVN: r150678
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index b0e58b3..b8d54e7 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3192,16 +3192,15 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) && lvalue->symtree->n.sym->attr.ext_attr != rvalue->symtree->n.sym->attr.ext_attr) { - symbol_attribute cdecl, stdcall, fastcall; - unsigned calls; + symbol_attribute calls; - 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; + calls.ext_attr = 0; + gfc_add_ext_attribute (&calls, EXT_ATTR_CDECL, NULL); + gfc_add_ext_attribute (&calls, EXT_ATTR_STDCALL, NULL); + gfc_add_ext_attribute (&calls, EXT_ATTR_FASTCALL, NULL); - if ((calls & lvalue->symtree->n.sym->attr.ext_attr) - != (calls & rvalue->symtree->n.sym->attr.ext_attr)) + if ((calls.ext_attr & lvalue->symtree->n.sym->attr.ext_attr) + != (calls.ext_attr & rvalue->symtree->n.sym->attr.ext_attr)) { gfc_error ("Mismatch in the procedure pointer assignment " "at %L: mismatch in the calling convention", |