aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans.h
AgeCommit message (Collapse)AuthorFilesLines
2013-07-15re PR fortran/37336 ([F03] Finish derived-type finalization)Tobias Burnus1-0/+2
2013-07-15 Tobias Burnus <burnus@net-b.de> PR fortran/37336 * trans.c (gfc_add_comp_finalizer_call): New function. * trans.h (gfc_add_comp_finalizer_call): New prototype. * trans-array.c (structure_alloc_comps): Call it. 2013-07-15 Tobias Burnus <burnus@net-b.de> PR fortran/37336 * gfortran.dg/finalize_18.f90: New. From-SVN: r200954
2013-06-04re PR fortran/37336 ([F03] Finish derived-type finalization)Tobias Burnus1-2/+1
2013-06-03 Tobias Burnus <burnus@net-b.de> PR fortran/37336 * trans.h (gfc_build_final_call): Remove prototype. (gfc_add_finalizer_call): Add prototype. * trans-array.c (gfc_trans_dealloc_allocated): Support * finalization. (structure_alloc_comps): Update caller. (gfc_trans_deferred_array): Call finalizer. * trans-array.h (gfc_trans_dealloc_allocated): Update prototype. * trans-decl.c (gfc_trans_deferred_vars): Don't * deallocate/finalize variables of the main program. * trans-expr.c (gfc_conv_procedure_call): Support finalization. * trans-openmp.c (gfc_omp_clause_dtor, gfc_trans_omp_array_reduction): Update calls. * trans-stmt.c (gfc_trans_deallocate): Avoid double deallocation of alloc components. * trans.c (gfc_add_finalizer_call): New function. (gfc_deallocate_with_status, gfc_deallocate_scalar_with_status): Call it (gfc_build_final_call): Fix handling of scalar coarrays, move up in the file and make static. 2013-06-03 Tobias Burnus <burnus@net-b.de> PR fortran/37336 * gfortran.dg/finalize_12.f90: New. * gfortran.dg/alloc_comp_basics_1.f90: Add BLOCK for end of scope finalization. * gfortran.dg/alloc_comp_constructor_1.f90: Ditto. * gfortran.dg/allocatable_scalar_9.f90: Ditto. * gfortran.dg/auto_dealloc_2.f90: Ditto. * gfortran.dg/class_19.f03: Ditto. * gfortran.dg/coarray_lib_alloc_1.f90: Ditto. * gfortran.dg/coarray_lib_alloc_2.f90: Ditto. * gfortran.dg/extends_14.f03: Ditto. * gfortran.dg/move_alloc_4.f90: Ditto. * gfortran.dg/typebound_proc_27.f03: Ditto. From-SVN: r199643
2013-05-28trans-expr.c (gfc_conv_procedure_call): Deallocate polymorphic arrays for ↵Tobias Burnus1-0/+1
allocatable intent(out) dummies. 2013-05-28 Tobias Burnus <burnus@net-b.de> * trans-expr.c (gfc_conv_procedure_call): Deallocate polymorphic arrays for allocatable intent(out) dummies. (gfc_reset_vptr): New function, moved from trans-stmt.c and extended. * trans-stmt.c (reset_vptr): Remove. (gfc_trans_deallocate): Update calls. * trans.h (gfc_reset_vptr): New prototype. 2013-05-28 Tobias Burnus <burnus@net-b.de> * gfortran.dg/class_array_16.f90: New. From-SVN: r199383
2013-04-12re PR fortran/56845 ([OOP] _vptr not set to declared type for CLASS + SAVE)Tobias Burnus1-0/+1
2013-04-12 Tobias Burnus <burnus@net-b.de> PR fortran/56845 * trans-decl.c (gfc_trans_deferred_vars): Set _vptr for allocatable static BT_CLASS. * trans-expr.c (gfc_class_set_static_fields): New function. * trans.h (gfc_class_set_static_fields): New prototype. 2013-04-12 Tobias Burnus <burnus@net-b.de> PR fortran/56845 * gfortran.dg/class_allocate_14.f90: New. * gfortran.dg/coarray_lib_alloc_2.f90: Update * scan-tree-dump-times. * gfortran.dg/coarray_lib_alloc_3.f90: New. From-SVN: r197844
2013-01-10Update copyright years in gcc/Richard Sandiford1-3/+1
From-SVN: r195098
2013-01-04trans.c (gfc_build_final_call): New function.Tobias Burnus1-1/+6
2013-01-04 Tobias Burnus <burnus@net-b.de> * trans.c (gfc_build_final_call): New function. * trans.h (gfc_build_final_call, gfc_conv_scalar_to_descriptor): New function prototypes. * trans-expr.c (gfc_conv_scalar_to_descriptor): Renamed from conv_scalar_to_descriptor, removed static attribute. (gfc_conv_procedure_call): Honor renaming. From-SVN: r194919
2012-12-03re PR fortran/37336 ([F03] Finish derived-type finalization)Tobias Burnus1-0/+1
2012-12-03 Tobias Burnus <burnus@net-b.de> Janus Weil <janus@gcc.gnu.org> PR fortran/37336 * class.c (gfc_is_finalizable): New function. * gfortran.h (gfc_is_finalizable): Its prototype. * module.c (mio_component): Read initializer for vtype's _final. * resolve.c (resolve_fl_derived0): Call gfc_is_finalizable. * trans-expr.c (gfc_vtable_final_get): New function. (conv_parent_component_references): Fix comment. (gfc_conv_variable): Fix for scalar coarray components. * trans-intrinsic.c (conv_intrinsic_move_alloc): For BT_CLASS, pass the BT_CLASS type and not the declared type to gfc_deallocate_scalar_with_status. * trans.h (gfc_vtable_final_get): New prototype. Co-Authored-By: Janus Weil <janus@gcc.gnu.org> From-SVN: r194104
2012-11-17This patch rewrites the old VEC macro-based interface into a new one based ↵Diego Novillo1-1/+1
on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-10-31re PR fortran/53718 ([OOP] gfortran generates asm label twice in the same ↵Janus Weil1-1/+0
output file) 2012-10-31 Janus Weil <janus@gcc.gnu.org> PR fortran/53718 * trans.h (GFC_DECL_PUSH_TOPLEVEL): Removed. * trans-decl.c (gfc_get_symbol_decl,gfc_generate_function_code): Remove GFC_DECL_PUSH_TOPLEVEL. (build_function_decl): Do not push __copy procedure to toplevel. 2012-10-31 Janus Weil <janus@gcc.gnu.org> PR fortran/53718 * gfortran.dg/class_54.f90: New. From-SVN: r193048
2012-10-16re PR fortran/50981 ([OOP] Wrong-code for scalarizing ELEMENTAL call with ↵Tobias Burnus1-2/+4
absent OPTIONAL argument) 2012-10-16 Tobias Burnus <burnus@net-b.de> PR fortran/50981 PR fortran/54618 * trans.h (gfc_conv_derived_to_class, gfc_conv_class_to_class): Update prototype. * trans-stmt.c (trans_associate_var,gfc_trans_allocate): Update calls to those functions. * trans-expr.c (gfc_conv_derived_to_class, * gfc_conv_class_to_class, gfc_conv_expr_present): Handle absent polymorphic arguments. (class_scalar_coarray_to_class): New function. (gfc_conv_procedure_call): Update calls. 2012-10-16 Tobias Burnus <burnus@net-b.de> PR fortran/50981 PR fortran/54618 * gfortran.dg/class_optional_1.f90: New. * gfortran.dg/class_optional_2.f90: New. From-SVN: r192495
2012-07-25trans-types.c (gfc_real16_is_float128): Fix spelling in a comment.Tobias Burnus1-1/+1
2012-07-25 Tobias Burnus <burnus@net-b.de> * trans-types.c (gfc_real16_is_float128): Fix spelling in a comment. * trans.h (struct gfc_array_info): Ditto. * gfortran.h (gfc_expr): Ditto. * simplify.c (gfc_count): Ditto. * trans-expr.c (gfc_copy_class_to_class, conv_parent_component_references, gfc_trans_pointer_assignment): Ditto. * expr.c (check_pointer_assign): Fix diagnostic spelling. * interface.c (compare_parameter): Ditto. * parse.c (use_modules, parse_associate): Ditto. * decl.c (match_char_length): Fix spelling of the an function argument. From-SVN: r189859
2012-07-20re PR fortran/48820 (TR 29113: Implement parts needed for MPI 3)Tobias Burnus1-0/+2
2012-07-20 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * array.c (match_array_element_spec, gfc_match_array_spec, spec_size, gfc_array_dimen_size): Add support for assumed-rank arrays. * check.c (dim_rank_check): Ditto. * class.c (gfc_add_component_ref): Ditto. (gfc_build_class_symbol): Regard assumed-rank arrays as having GFC_MAX_DIMENSIONS. And build extra class container for a scalar pointer class. * decl.c (merge_array_spec): Add assert. * dump-parse-tree.c (show_array_spec): Add support for assumed-rank arrays. * expr.c (gfc_is_simply_contiguous): Ditto. * gfortran.h (array_type): Ditto. (gfc_array_spec, gfc_expr): Add comment to "rank" field. * interface.c (compare_type_rank, argument_rank_mismatch, compare_parameter, gfc_procedure_use): Ditto. (compare_actual_formal): Fix NULL() to optional-dummy handling for polymorphic dummies. * module.c (mio_typespec): Add support for assumed-rank arrays. * resolve.c (resolve_formal_arglist, resolve_actual_arglist, resolve_elemental_actual, resolve_global_procedure, expression_shape, resolve_variable, update_ppc_arglist, check_typebound_baseobject, gfc_resolve_expr, resolve_fl_var_and_proc, gfc_resolve_finalizers, resolve_typebound_procedure, resolve_symbol): Ditto. (assumed_type_expr_allowed): Remove static variable. (actual_arg, first_actual_arg): New static variables. * simplify.c (simplify_bound, gfc_simplify_range): Add support for assumed-rank arrays. * trans-array.c (gfc_conv_array_parameter): Ditto. (gfc_get_descriptor_dimension): New function, which returns the descriptor. (gfc_conv_descriptor_dimension): Use it. (gfc_conv_descriptor_stride_get, gfc_conv_array_parameter): Handle GFC_ARRAY_ASSUMED_RANK_CONT and AS_ASSUMED_RANK. * trans-array.h (gfc_get_descriptor_dimension): New prototype. * trans-decl. (gfc_build_dummy_array_decl, gfc_trans_deferred_vars, add_argument_checking): Add support for assumed-rank arrays. * trans-expr.c (gfc_conv_expr_present, gfc_conv_variable, gfc_conv_procedure_call): Ditto. (get_scalar_to_descriptor_type, class_array_data_assign, conv_scalar_to_descriptor): New static functions. (gfc_conv_derived_to_class, gfc_conv_class_to_class): Use them. * trans-intrinsic.c (get_rank_from_desc): New function. (gfc_conv_intrinsic_rank, gfc_conv_associated): Use it. * trans-types.c (gfc_array_descriptor_base_caf, gfc_array_descriptor_base): Make space for scalar array. (gfc_is_nodesc_array, gfc_is_nodesc_array, gfc_build_array_type, gfc_get_array_descriptor_base): Add support for assumed-rank arrays. * trans.h (gfc_array_kind): Add GFC_ARRAY_ASSUMED_RANK and GFC_ARRAY_ASSUMED_RANK_CONT. 2012-07-20 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * gfortran.dg/assumed_type_3.f90: Update dg-error. * gfortran.dg/assumed_rank_1.f90: New. * gfortran.dg/assumed_rank_1_c.c: New. * gfortran.dg/assumed_rank_2.f90: New. * gfortran.dg/assumed_rank_4.f90: New. * gfortran.dg/assumed_rank_5.f90: New. * gfortran.dg/assumed_rank_6.f90: New. * gfortran.dg/assumed_rank_7.f90: New. * gfortran.dg/assumed_rank_8.f90: New. * gfortran.dg/assumed_rank_8_c.c: New. * gfortran.dg/assumed_rank_9.f90: New. * gfortran.dg/assumed_rank_10.f90: New. * gfortran.dg/assumed_rank_12.f90: New. From-SVN: r189700
2012-05-05re PR fortran/41600 ([OOP] SELECT TYPE with associate-name => exp: Arrays ↵Paul Thomas1-0/+4
not supported) 2012-05-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/41600 * trans-array.c (build_array_ref): New static function. (gfc_conv_array_ref, gfc_get_dataptr_offset): Call it. * trans-expr.c (gfc_get_vptr_from_expr): New function. (gfc_conv_derived_to_class): Add a new argument for a caller supplied vptr and use it if it is not NULL. (gfc_conv_procedure_call): Add NULL to call to above. symbol.c (gfc_is_associate_pointer): Return true if symbol is a class object. * trans-stmt.c (trans_associate_var): Handle class associate- names. * expr.c (gfc_get_variable_expr): Supply the array-spec if possible. * trans-types.c (gfc_typenode_for_spec): Set GFC_CLASS_TYPE_P for class types. * trans.h : Add prototypes for gfc_get_vptr_from_expr and gfc_conv_derived_to_class. Define GFC_CLASS_TYPE_P. * resolve.c (resolve_variable): For class arrays, ensure that the target expression has all the necessary _data references. (resolve_assoc_var): Throw a "not yet implemented" error for class array selectors that need a temporary. * match.c (copy_ts_from_selector_to_associate, select_derived_set_tmp, select_class_set_tmp): New functions. (select_type_set_tmp): Call one of last two new functions. (gfc_match_select_type): Copy_ts_from_selector_to_associate is called if associate-name is typed. PR fortran/53191 * resolve.c (resolve_ref): C614 applied to class expressions. 2012-05-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/41600 * gfortran.dg/select_type_26.f03 : New test. * gfortran.dg/select_type_27.f03 : New test. PR fortran/53191 * gfortran.dg/select_type_28.f03 : New test. From-SVN: r187192
2012-03-06f95-lang.c (yyerror, yylex): Remove.Steven Bosscher1-6/+2
* f95-lang.c (yyerror, yylex): Remove. (clear_binding_stack): Remove, fold into its only user. (LANG_HOOKS_PRINT_IDENTIFIER): Do not re-define. (ridpointers): Remove. (gfc_eh_initialized_p): Make static. (gfc_truthvalue_conversion): Move to convert.c. (gfc_be_parse_file): Clear binding level stack when done. (gfc_print_identifier): Remove. (pushlevel): Remove ignored 'ignore' argument. Update all callers. (poplevel): Remove unused 'reverse' argument. Update all callers. (ggc_p): Remove. (gfc_builtin_function): Make static. Do not attempt to make RTL for builtin functions. * convert.c (gfc_truthvalue_conversion): Moved here from f95-lang.c, and made static. * trans.h (pushlevel, poplevel): Adjust prototypes. (gfc_truthvalue_conversion, gfc_builtin_function): Remove prototypes. * trans-openmp.c: Update calls to pushlevel and poplevel. * trans.c: Likewise. * trans-decl.c: Likewise. From-SVN: r185015
2012-03-04trans.h (struct gfc_ss_info): Move can_be_null_ref component from the ↵Mikael Morin1-3/+5
data::scalar subcomponent to the toplevel. fortran/ * trans.h (struct gfc_ss_info): Move can_be_null_ref component from the data::scalar subcomponent to the toplevel. * trans-expr.c (gfc_conv_expr): Update component reference. * trans-array.c (gfc_add_loop_ss_code): Ditto. (gfc_walk_elemental_function_args): Ditto. Move the conditional setting the field out of the scalar-only block. From-SVN: r184893
2012-01-27re PR fortran/48705 ([OOP] ALLOCATE with non-trivial SOURCE)Paul Thomas1-0/+3
2012-01-27 Paul Thomas <pault@gcc.gnu.org> Tobias Burnus <burnus@gcc.gnu.org> PR fortran/48705 PR fortran/51870 PR fortran/51943 PR fortran/51946 * trans-array.c (gfc_array_init_size): Add two extra arguments to convey the dynamic element size of a calls object and to return the number of elements that have been allocated. (gfc_array_allocate): Add the same arguments and use them to call gfc_array_init_size. Before the allocation dereference the data pointer, if necessary. Set the allocated array to zero if the class element size or expr3 are non-null. * trans-expr.c (gfc_conv_class_to_class): Give this function global scope. (get_class_array_ref): New function. (gfc_copy_class_to_class): New function. * trans-array.h : Update prototype for gfc_array_allocate. * trans-stmt.c (gfc_trans_allocate): For non-variable class STATUS expressions extract the class object and the dynamic element size. Use the latter to call gfc_array_allocate and the former for setting the vptr and, via gfc_copy_class_to_clasfc_cs, to copy to the allocated data. * trans.h : Prototypes for gfc_get_class_array_ref, gfc_copy_class_to_class and gfc_conv_class_to_class. 2012-01-27 Paul Thomas <pault@gcc.gnu.org> Tobias Burnus <burnus@gcc.gnu.org> PR fortran/48705 * gfortran.dg/class_allocate_11.f03: New. PR fortran/51870 PR fortran/51943 PR fortran/51946 * gfortran.dg/class_allocate_7.f03: New. * gfortran.dg/class_allocate_8.f03: New. * gfortran.dg/class_allocate_9.f03: New. * gfortran.dg/class_allocate_10.f03: New. Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org> From-SVN: r183613
2012-01-062012-01-06 Tobias Burnus <burnus@net-b.de>Tobias Burnus1-3/+6
* trans-openmp.c (gfc_omp_clause_dtor, * gfc_trans_omp_array_reduction): Update call to gfc_trans_dealloc_allocated. * trans.c (gfc_allocate_using_malloc): Fix spacing. (gfc_allocate_allocatable): For gfc_allocate_using_lib, jump to label_finish when an error occurs. (gfc_deallocate_with_status): Call caf_deregister for -fcoarray=lib. * trans.h (gfc_allocate_allocatable, * gfc_deallocate_with_status): Update prototype. (gfor_fndecl_caf_deregister): New tree symbol. * trans-expr.c (gfc_conv_procedure_call): Update gfc_deallocate_with_status and gfc_trans_dealloc_allocated calls. * trans-array.c (gfc_array_allocate, * gfc_trans_dealloc_allocated, structure_alloc_comps, gfc_trans_deferred_array): Ditto. (gfc_array_deallocate): Handle coarrays with -fcoarray=lib. * trans-array.h (gfc_array_deallocate, gfc_array_allocate, gfc_trans_dealloc_allocated): Update prototypes. * trans-stmt.c (gfc_trans_sync): Fix indentation. (gfc_trans_allocate): Fix errmsg padding and label handling. (gfc_trans_deallocate): Ditto and handle -fcoarray=lib. * expr.c (gfc_is_coarray): Fix algorithm for BT_CLASS. * libgfortran.h (GFC_STAT_STOPPED_IMAGE): Use large value to avoid other stats accidentally matching this one. * trans-decl.c (gfor_fndecl_caf_deregister): New global var. (gfc_build_builtin_function_decls): Fix prototype decl of caf_register and add decl for caf_deregister. (gfc_trans_deferred_vars): Handle CAF vars with -fcoarrays=lib. * trans-intrinsic.c (conv_intrinsic_move_alloc): Update call to gfc_deallocate_with_status. 2012-01-06 Tobias Burnus <burnus@net-b.de> * caf/single.c (_gfortran_caf_register, * _gfortran_caf_deregister): Fix token handling. * caf/mpi.c (_gfortran_caf_register, _gfortran_caf_deregister): * Ditto. * caf/libcaf.h (STAT_STOPPED_IMAGE): Sync with libgfortran.h. (_gfortran_caf_register, _gfortran_caf_deregister): Update prototype. 2012-01-06 Tobias Burnus <burnus@net-b.de> * gfortran.dg/deallocate_stat_2.f90: New. * coarray/allocate_errgmsg.f90: New. * gfortran.dg/coarray_lib_alloc_1.f90: New. * gfortran.dg/coarray_lib_alloc_2.f90: New. * coarray/subobject_1.f90: Fix for num_images > 1. * gfortran.dg/deallocate_stat.f90: Update due to changed stat= handling. From-SVN: r182951
2012-01-04re PR fortran/50981 ([OOP] Wrong-code for scalarizing ELEMENTAL call with ↵Mikael Morin1-2/+6
absent OPTIONAL argument) PR fortran/50981 * trans.h (struct gfc_ss_info): New field data::scalar::can_be_null_ref * trans-array.c: If the reference can be NULL, save the reference instead of the value. * trans-expr.c (gfc_conv_expr): If we have saved a reference, dereference it. From-SVN: r182874
2011-12-11re PR fortran/41539 ([OOP] Calling function which takes CLASS: Rank ↵Paul Thomas1-0/+9
comparison does not work) 2011-12-11 Paul Thomas <pault@gcc.gnu.org> Tobias Burnus <burnus@gcc.gnu.org> PR fortran/41539 PR fortran/43214 PR fortran/43969 PR fortran/44568 PR fortran/46356 PR fortran/46990 PR fortran/49074 * interface.c(symbol_rank): Return the rank of the _data component of class objects. (compare_parameter): Also compare the derived type of the class _data component for type mismatch. Similarly, return 1 if the formal and _data ranks match. (compare_actual_formal): Do not compare storage sizes for class expressions. It is an error if an actual class array, passed to a formal class array is not full. * trans-expr.c (gfc_class_data_get, gfc_class_vptr_get, gfc_vtable_field_get, gfc_vtable_hash_get, gfc_vtable_size_get, gfc_vtable_extends_get, gfc_vtable_def_init_get, gfc_vtable_copy_get): New functions for class API. (gfc_conv_derived_to_class): For an array reference in an elemental procedure call retain the ss to provide the scalarized array reference. Moved in file. (gfc_conv_class_to_class): New function. (gfc_conv_subref_array_arg): Use the type of the class _data component as a basetype. (gfc_conv_procedure_call): Ensure that class array expressions have both the _data reference and an array reference. Use gfc_conv_class_to_class to handle class arrays for elemental functions in scalarized loops, class array elements and full class arrays. Use a call to gfc_conv_subref_array_arg in order that the copy-in/copy-out for passing class arrays to derived type arrays occurs correctly. (gfc_conv_expr): If it is missing, add the _data component between a class object or component and an array reference. (gfc_trans_class_array_init_assign): New function. (gfc_trans_class_init_assign): Call it for array expressions. * trans-array.c (gfc_add_loop_ss_code): Do not use a temp for class scalars since their size will depend on the dynamic type. (build_class_array_ref): New function. (gfc_conv_scalarized_array_ref): Call build_class_array_ref. (gfc_array_init_size): Add extra argument, expr3, that represents the SOURCE argument. If present,use this for the element size. (gfc_array_allocate): Also add argument expr3 and use it when calling gfc_array_init_size. (structure_alloc_comps): Enable class arrays. * class.c (gfc_add_component_ref): Carry over the derived type of the _data component. (gfc_add_class_array_ref): New function. (class_array_ref_detected): New static function. (gfc_is_class_array_ref): New function that calls previous. (gfc_is_class_scalar_expr): New function. (gfc_build_class_symbol): Throw not implemented error for assumed size class arrays. Remove error that prevents CLASS arrays. (gfc_build_class_symbol): Prevent pointer/allocatable conflict. Also unset codimension. (gfc_find_derived_vtab): Make 'copy' elemental and set the intent of the arguments accordingly.: * trans-array.h : Update prototype for gfc_array_allocate. * array.c (gfc_array_dimen_size): Return failure if class expr. (gfc_array_size): Likewise. * gfortran.h : New prototypes for gfc_add_class_array_ref, gfc_is_class_array_ref and gfc_is_class_scalar_expr. * trans-stmt.c (trans_associate_var): Exclude class targets from test. Move the allocation of the _vptr to an earlier time for class objects. (trans_associate_var): Assign the descriptor directly for class arrays. (gfc_trans_allocate): Add expr3 to gfc_array_allocate arguments. Convert array element references into sections. Do not invoke gfc_conv_procedure_call, use gfc_trans_call instead. * expr.c (gfc_get_corank): Fix for BT_CLASS. (gfc_is_simply_contiguous): Exclude class from test. * trans.c (gfc_build_array_ref): Include class array refs. * trans.h : Include prototypes for class API functions that are new in trans-expr. Define GFC_DECL_CLASS(node). * resolve.c (check_typebound_baseobject ): Remove error for non-scalar base object. (resolve_allocate_expr): Ensure that class _data component is present. If array, call gfc_expr_to_intialize. (resolve_select): Remove scalar error for SELECT statement as a temporary measure. (resolve_assoc_var): Update 'target' (aka 'selector') as needed. Ensure that the target expression has the right rank. (resolve_select_type): Ensure that target expressions have a valid locus. (resolve_allocate_expr, resolve_fl_derived0): Fix for BT_CLASS. * trans-decl.c (gfc_get_symbol_decl): Set GFC_DECL_CLASS, where appropriate. (gfc_trans_deferred_vars): Get class arrays right. * match.c(select_type_set_tmp): Add array spec to temporary. (gfc_match_select_type): Allow class arrays. * check.c (array_check): Ensure that class arrays have refs. (dim_corank_check, dim_rank_check): Retrun success if class. * primary.c (gfc_match_varspec): Fix for class arrays and co-arrays. Make sure that class _data is present. (gfc_match_rvalue): Handle class arrays. *trans-intrinsic.c (gfc_conv_intrinsic_size): Add class array reference. (gfc_conv_allocated): Add _data component to class expressions. (gfc_add_intrinsic_ss_code): ditto. * simplify.c (simplify_cobound): Fix for BT_CLASS. (simplify_bound): Return NULL for class arrays. (simplify_cobound): Obtain correct array_spec. Use cotype as appropriate. Use arrayspec for bounds. 2011-12-11 Paul Thomas <pault@gcc.gnu.org> Tobias Burnus <burnus@gcc.gnu.org> PR fortran/41539 PR fortran/43214 PR fortran/43969 PR fortran/44568 PR fortran/46356 PR fortran/46990 PR fortran/49074 * gfortran.dg/class_array_1.f03: New. * gfortran.dg/class_array_2.f03: New. * gfortran.dg/class_array_3.f03: New. * gfortran.dg/class_array_4.f03: New. * gfortran.dg/class_array_5.f03: New. * gfortran.dg/class_array_6.f03: New. * gfortran.dg/class_array_7.f03: New. * gfortran.dg/class_array_8.f03: New. * gfortran.dg/coarray_poly_1.f90: New. * gfortran.dg/coarray_poly_2.f90: New. * gfortran.dg/coarray/poly_run_1.f90: New. * gfortran.dg/coarray/poly_run_2.f90: New. * gfortran.dg/class_to_type_1.f03: New. * gfortran.dg/type_to_class_1.f03: New. * gfortran.dg/typebound_assignment_3.f03: Remove the error. * gfortran.dg/auto_dealloc_2.f90: Occurences of __builtin_free now 2. * gfortran.dg/class_19.f03: Occurences of __builtin_free now 8. Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org> From-SVN: r182210
2011-11-19re PR fortran/51207 ([OOP] Mark __def_init_... as FL_PARAMETER)Tobias Burnus1-0/+1
2011-11-19 Tobias Burnus <burnus@net-b.de> PR fortran/51207 * class.c (gfc_find_derived_vtab): Mark __def_init as PARAMETER and hence as TREE_READONLY; add subroutine attribute to __copy_ procedure. PR fortran/50640 * trans.h (GFC_DECL_PUSH_TOPLEVEL): New DECL_LANG_FLAG_7. * trans-decl.c (gfc_get_symbol_decl): Mark __def_init and vtab as GFC_DECL_PUSH_TOPLEVEL. (gfc_generate_function_code): If GFC_DECL_PUSH_TOPLEVEL, push it there. (build_function_decl): Push __copy_ procedure to the toplevel. From-SVN: r181505
2011-11-04re PR fortran/43829 (Scalarization of reductions)Mikael Morin1-0/+1
PR fortran/43829 * trans-array.c (gfc_conv_expr_descriptor): Accept the inline intrinsic case in the assertion. * trans-intrinsic (enter_nested_loop): New function. (gfc_conv_intrinsic_arith): Support non-scalar cases. (nest_loop_dimension, walk_inline_intrinsic_arith): New functions. (walk_inline_intrinsic_function): Handle sum and product. (gfc_inline_intrinsic_function_p): Ditto. * trans.h (gfc_get_loopinfo): New macro. From-SVN: r180920
2011-11-03trans.h (gfc_inline_intrinsic_function_p): Move prototype...Mikael Morin1-3/+0
* 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. From-SVN: r180904
2011-11-03trans.h (struct gfc_loopinfo): New field parent.Mikael Morin1-0/+3
* trans.h (struct gfc_loopinfo): New field parent. * trans-array.c (gfc_cleanup_loop): Free nested loops. (gfc_add_ss_to_loop): Set nested_loop's parent loop. (gfc_trans_array_constructor): Update assertion. (gfc_conv_loop_setup): Ditto. From-SVN: r180899
2011-11-03trans.h (struct gfc_loopinfo): New fields nested and next.Mikael Morin1-0/+3
* trans.h (struct gfc_loopinfo): New fields nested and next. * trans-array.c (gfc_add_ss_to_loop): Update list of nested list if ss has non-null nested_ss field. From-SVN: r180897
2011-11-03trans.h (struct gfc_ss): New field nested_ss.Mikael Morin1-0/+5
* trans.h (struct gfc_ss): New field nested_ss. * trans-expr.c (gfc_advance_se_ss_chain): Update assertion. From-SVN: r180893
2011-11-03trans.h (struct gfc_ss): New field parent.Mikael Morin1-0/+3
* trans.h (struct gfc_ss): New field parent. * trans-array.c (gfc_trans_scalarizing_loops): Skip clearing if a parent exists. * trans-expr.c (gfc_advance_se_ss_chain): Move to parent ss at the end of the chain. From-SVN: r180889
2011-11-03trans.h (struct gfc_ss): New field loop.Mikael Morin1-0/+3
* trans.h (struct gfc_ss): New field loop. * trans-array.c (set_ss_loop): New function. (gfc_add_ss_to_loop): Call set_ss_loop. From-SVN: r180884
2011-11-03trans.h (struct gfc_ss_info): New field refcount.Mikael Morin1-0/+1
* trans.h (struct gfc_ss_info): New field refcount. * trans-array.c (free_ss_info): Decrement refcount. Return early if still non-zero. (gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss): Increment refcount. From-SVN: r180883
2011-11-03trans.h (struct gfc_ss, [...]): Move field gfc_ss::where into gfc_ss_info.Mikael Morin1-3/+4
* trans.h (struct gfc_ss, struct gfc_ss_info): Move field gfc_ss::where into gfc_ss_info. * trans-array.c (gfc_add_loop_ss_code): Update reference chains. * trans-stmt.c (gfc_trans_where_assign, gfc_trans_where_3): Ditto. From-SVN: r180877
2011-11-03trans.h (struct gfc_ss, [...]): Move field gfc_ss::useflags into gfc_ss_info.Mikael Morin1-5/+8
* trans.h (struct gfc_ss, struct gfc_ss_info): Move field gfc_ss::useflags into gfc_ss_info. * trans-array.c (gfc_mark_ss_chain_used, gfc_trans_preloop_setup, gfc_trans_scalarizing_loops, gfc_trans_scalarized_boundary): Update reference chains. * trans-expr.c (gfc_conv_procedure_call): Ditto. * trans-intrinsic.c (gfc_conv_intrinsic_function): Ditto. From-SVN: r180875
2011-11-03trans.h (struct gfc_ss, [...]): Move field gfc_ss::data::info into ↵Mikael Morin1-7/+3
gfc_ss_info::data and remove empty union... * trans.h (struct gfc_ss, struct gfc_ss_info): Move field gfc_ss::data::info into gfc_ss_info::data and remove empty union gfc_ss::data. * trans-array.c (gfc_free_ss, gfc_trans_create_temp_array, gfc_trans_constant_array_constructor, gfc_trans_array_constructor, gfc_set_vector_loop_bounds, gfc_add_loop_ss_code, gfc_conv_ss_descriptor, gfc_trans_array_bound_check, gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref, add_array_offset, gfc_trans_preloop_setup, gfc_trans_scalarized_boundary, gfc_conv_section_startstride, gfc_conv_ss_startstride, gfc_could_be_alias, gfc_conv_loop_setup, gfc_conv_expr_descriptor, gfc_alloc_allocatable_for_assignment, gfc_walk_array_ref): Update reference chains and factor them where possible. * trans-expr.c (gfc_conv_variable, gfc_conv_subref_array_arg, gfc_conv_procedure_call, gfc_trans_subarray_assign): Updata reference chains. * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto. * trans-io.c (transfer_array_component): Ditto. * trans-stmt.c (gfc_conv_elemental_dependencies, gfc_trans_pointer_assign_need_temp): Ditto. From-SVN: r180873
2011-11-03trans.h (struct gfc_ss, [...]): Move member struct gfc_ss::data::temp into ↵Mikael Morin1-6/+7
gfc_ss_info::data. * trans.h (struct gfc_ss, struct gfc_ss_info): Move member struct gfc_ss::data::temp into gfc_ss_info::data. * trans-array.c (gfc_get_temp_ss, gfc_conv_loop_setup): Update reference chains. From-SVN: r180872
2011-11-03trans.h (struct gfc_ss, [...]): Move member struct gfc_ss::data::scalar into ↵Mikael Morin1-7/+11
newly created union... * trans.h (struct gfc_ss, struct gfc_ss_info): Move member struct gfc_ss::data::scalar into newly created union gfc_ss_info::data, and rename subfield expr to value. * trans-array.c (gfc_add_loop_ss_code, gfc_conv_array_index_offset, gfc_conv_expr_descriptor): Update reference chains. * trans-const.c (gfc_conv_constant): Ditto. * trans-expr.c (gfc_conv_expr): Ditto. From-SVN: r180870
2011-11-03trans.h (struct gfc_ss, [...]): Move field string_length from the former ↵Mikael Morin1-1/+1
struct to the latter. * trans.h (struct gfc_ss, struct gfc_ss_info): Move field string_length from the former struct to the latter. * trans-array.c (gfc_get_temp_ss, gfc_trans_array_constructor, gfc_add_loop_ss_code, gfc_conv_ss_descriptor, gfc_conv_scalarized_array_ref, gfc_conv_resolve_dependencies, gfc_conv_loop_setup, gfc_conv_expr_descriptor): Update references to string_length and factor common reference chains where possible. * trans-const.c (gfc_conv_constant): Ditto. * trans-expr.c (gfc_conv_variable, gfc_conv_subref_array_arg, gfc_conv_expr): Ditto. From-SVN: r180869
2011-11-03trans.h (struct gfc_ss, [...]): Move field expr from the former struct to ↵Mikael Morin1-1/+1
the latter. * trans.h (struct gfc_ss, struct gfc_ss_info): Move field expr from the former struct to the latter. * trans-array.c (gfc_get_array_ss, gfc_get_scalar_ss, gfc_trans_constant_array_constructor, gfc_trans_array_constructor, gfc_add_loop_ss_code, gfc_conv_ss_descriptor, gfc_trans_array_bound_check, gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref, gfc_conv_ss_startstride, gfc_could_be_alias, gfc_conv_resolve_dependencies, gfc_conv_loop_setup, gfc_conv_expr_descriptor, gfc_alloc_allocatable_for_assignment): Update references to expr and factor common reference chains where possible. * trans-const.c (gfc_conv_constant): Ditto. * trans-expr.c (gfc_conv_variable, gfc_conv_procedure_call, gfc_conv_array_constructor_expr, gfc_conv_expr, gfc_conv_expr_reference): Ditto. * trans-intrinsic.c (trans_this_image, gfc_conv_intrinsic_bound, gfc_conv_intrinsic_cobound, gfc_conv_intrinsic_funcall, gfc_add_intrinsic_ss_code): Ditto. * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto. From-SVN: r180868
2011-11-03trans.h (struct gfc_ss_info): New struct.Mikael Morin1-1/+11
* trans.h (struct gfc_ss_info): New struct. (gfc_get_ss_info): New macro. (struct gfc_ss): Move type field to struct gfc_ss_info. Add an info field of type gfc_ss_info. * trans-array.c (free_ss_info): New function. (gfc_free_ss): Call free_ss_info. (gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss): Allocate gfc_ss_info field. (gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss, gfc_set_vector_loop_bounds, gfc_add_loop_ss_code, gfc_conv_array_index_offset, gfc_trans_preloop_setup, gfc_trans_scalarized_loop_boundary, gfc_conv_section_startstride, gfc_conv_ss_startstride, gfc_conv_resolve_dependencies, gfc_conv_loop_setup, transposed_dims, gfc_conv_expr_descriptor, gfc_walk_elemental_function_args): Update references to type. * trans-const.c (gfc_conv_constant): Factor common reference chains and update reference to type. * trans-expr.c (gfc_conv_procedure_call, gfc_trans_assignment_1): Update reference to type. (gfc_conv_array_constructor_expr, gfc_conv_expr, gfc_conv_expr_reference): Ditto. Factor common reference chains. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Update references to type * trans-stmt.c (gfc_trans_where_assign): Ditto. From-SVN: r180867
2011-11-03trans.h (struct gfc_ss, [...]): Move shape field from the former struct to ↵Mikael Morin1-1/+2
the latter. * trans.h (struct gfc_ss, struct gfc_array_info): Move shape field from the former struct to the latter. * trans-array.c (gfc_conv_ss_startstride, gfc_conv_loop_setup): Update field references. * trans-expr.c (gfc_trans_subarray_assign): Update field references and factor common reference chains. * trans-io.c (transfer_array_component): Ditto. From-SVN: r180866
2011-11-03trans.h (struct gfc_array_info): Move dim and dimen fields...Mikael Morin1-8/+5
* trans.h (struct gfc_array_info): Move dim and dimen fields... (struct gfc_ss): ... here. Remove gfc_ss::data::temp::dimen field. * trans-array.c (gfc_conv_loop_setup): Remove temp_ss dim array initialization. (gfc_get_temp_ss): Initialize dim and dimen. (gfc_free_ss, gfc_get_array_ss, gfc_get_temp_ss, gfc_set_loop_bounds_from_array_spec, get_array_ref_dim, gfc_trans_create_temp_array, gfc_trans_constant_array_constructor, gfc_set_vector_loop_bounds, gfc_conv_scalarized_array_ref, gfc_trans_preloop_setup, gfc_conv_ss_startstride, gfc_conv_resolve_dependencies, gfc_conv_loop_setup, transposed_dims, gfc_conv_expr_descriptor, gfc_alloc_allocatable_for_assignment, gfc_walk_array_ref): Update field references. * trans-expr.c (gfc_conv_subref_array_arg, gfc_conv_procedure_call): Ditto. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Ditto. * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto. From-SVN: r180865
2011-11-03trans.h (struct gfc_ss_info, [...]): Rename the former to the latter.Mikael Morin1-11/+13
* trans.h (struct gfc_ss_info, struct gfc_array_info): Rename the former to the latter. * trans-array.c (gfc_get_array_ss, gfc_trans_allocate_array_storage, get_array_ref_dim, gfc_trans_create_temp_array, gfc_trans_constant_array_constructor, gfc_set_vector_loop_bounds, gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref, add_array_offset, gfc_trans_preloop_setup, gfc_conv_section_startstride, gfc_conv_ss_startstride, gfc_conv_loop_setup, transposed_dims, gfc_conv_expr_descriptor): Update all uses. * trans-expr.c (gfc_conv_subref_array_arg, gfc_conv_procedure_call): Ditto. * trans-intrinsic.c (gfc_conv_intrinsic_transfer, walk_inline_intrinsic_transpose): Ditto. * trans-stmt.c (gfc_conv_elemental_dependencies, gfc_trans_pointer_assign_need_temp): Ditto. From-SVN: r180864
2011-10-07trans.h (gfc_ss_info): Remove codimen field.Mikael Morin1-1/+1
* trans.h (gfc_ss_info): Remove codimen field. * trans-array.c (gfc_get_array_ss): Don't set codimen field. (gfc_trans_create_temp_array): Don't set descriptor's cobounds. (gfc_trans_constant_array_constructor): Update loop upper limit. (gfc_conv_ss_startstride): Don't set codimen field. Don't get descriptor's cobounds. (gfc_walk_variable_expr): Update dimension index. * trans-intrinsic.c (trans_this_image, trans_image_index, conv_intrinsic_cobound): Don't set codimen field From-SVN: r179690
2011-10-07trans.h (gfc_loopinfo): Remove codimen field.Mikael Morin1-1/+1
* trans.h (gfc_loopinfo): Remove codimen field. * trans-array.c (gfc_set_vector_loop_bounds, gfc_trans_scalarizing_loops, gfc_conv_loop_setup): Update loop upper limit. (gfc_set_loop_bounds_from_array_spec): Ditto. Remove skip on last codimension. (gfc_start_scalarized_body): Update loop lower limit. (gfc_conv_ss_startstride): Don't set loop's codimen field. (gfc_conv_loop_setup): Remove unnecessary condition. (gfc_conv_expr_descriptor): Don't use loop's codimen field as corank. From-SVN: r179689
2011-10-07trans.h (gfc_ss): Remove data.temp.codimen field.Mikael Morin1-1/+1
* trans.h (gfc_ss): Remove data.temp.codimen field. * trans-array.c (gfc_conv_resolve_dependencies, gfc_conv_expr_descriptor): Don't set temp's codimen field. From-SVN: r179686
2011-10-07trans-array.h (struct gfc_se): New flag want_coarray.Mikael Morin1-0/+2
* trans-array.h (struct gfc_se): New flag want_coarray. * trans-intrinsic.c (trans_this_image, trans_image_index, conv_intrinsic_cobound): Set want_coarray. * trans_array.c (gfc_conv_expr_descriptor): Evaluate codimension earlier and without relying on the scalarizer. From-SVN: r179676
2011-08-25trans-array.c (gfc_conv_descriptor_token): Add assert.Tobias Burnus1-0/+4
2011-08-25 Tobias Burnus <burnus@net-b.de> * trans-array.c (gfc_conv_descriptor_token): Add assert. * trans-decl.c (gfc_build_qualified_array, create_function_arglist): Handle assumed-shape arrays. * trans-expr.c (gfc_conv_procedure_call): Ditto. * trans-types.c (gfc_get_array_descriptor_base): Ditto, don't add "caf_token" to assumed-shape descriptors, new akind argument. (gfc_get_array_type_bounds): Pass akind. * trans.h (lang_decl): New elements caf_offset and token. (GFC_DECL_TOKEN, GFC_DECL_CAF_OFFSET): New macros. 2011-08-25 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_lib_token_4.f90: New. From-SVN: r178069
2011-08-02trans-array.c (gfc_array_allocate): Pass token to gfc_allocate_allocatable ↵Tobias Burnus1-2/+1
for -fcoarray=lib. 2011-08-02 Tobias Burnus <burnus@net-b.de> * trans-array.c (gfc_array_allocate): Pass token to gfc_allocate_allocatable for -fcoarray=lib. * trans-stmt.c (gfc_trans_allocate): Update gfc_allocate_allocatable call. * trans.h (gfc_allocate_allocatable): Update prototype. (gfc_allocate_using_lib): Remove. * trans.c (gfc_allocate_using_lib): Make static, handle token. (gfc_allocate_allocatable): Ditto. 2011-08-02 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_lib_token_3.f90: New. From-SVN: r177198
2011-07-27re PR fortran/49755 (ALLOCATE with STAT= produces invalid code for already ↵Daniel Carrera1-4/+5
allocated vars) 2011-07-26 Daniel Carrera <dcarrera@gmail.com> PR fortran/49755 * trans.c (gfc_allocate_using_malloc): Change function signature. Return nothing. New parameter "pointer". Eliminate temorary variables. (gfc_allocate_using_lib): Ditto. (gfc_allocate_allocatable): Ditto. Update call to gfc_allocate_using_lib and gfc_allocate_using_malloc. Do not free and then reallocate a variable that is already allocated. (gfc_likely): New function. Basedon gfc_unlikely. * trans-array.c (gfc_array_init_size): New parameter "descriptor_block". Instructions to modify the array descriptor are stored in this block while other instructions continue to be stored in "pblock". (gfc_array_allocate): Update call to gfc_array_init_size. Move the descriptor_block so that the array descriptor is only updated if the array was allocated successfully. Update calls to gfc_allocate_allocatable and gfc_allocate_using_malloc. * trans.h (gfc_allocate_allocatable): Change function signature. Function now returns void. (gfc_allocate_using_lib): Ditto, and new function parameter. (gfc_allocate_using_malloc): Ditto. * trans-openmp.c (gfc_omp_clause_default_ctor, gfc_omp_clause_copy_ctor,gfc_trans_omp_array_reduction): Replace a call to gfc_allocate_allocatable with gfc_allocate_using_malloc. * trans-stmt.c (gfc_trans_allocate): Update function calls for gfc_allocate_allocatable and gfc_allocate_using_malloc. 2011-07-26 Daniel Carrera <dcarrera@gmail.com> PR fortran/49755 * gfortran.dg/multiple_allocation_1.f90: Fix test. Allocating an allocated array should *not* change its size. * gfortran.dg/multiple_allocation_3.f90: New test. From-SVN: r176822
2011-07-21trans.c (gfc_allocate_with_status): Split into two functions ↵Daniel Carrera1-3/+4
gfc_allocate_using_malloc and gfc_allocate_usig_lib. 2011-07-21 Daniel Carrera <dcarrera@gmail.com> * trans.c (gfc_allocate_with_status): Split into two functions gfc_allocate_using_malloc and gfc_allocate_usig_lib. (gfc_allocate_using_malloc): The status parameter is now the actual status rather than a pointer. Code cleanup. (gfc_allocate_using_lib): Ditto. Add new parametrs errmsg and errlen. Pass these to the coarray lib. * trans-openmp.c (gfc_omp_clause_default_ctor): Update calls to gfc_allocate_allocatable. (gfc_omp_clause_copy_ctor): Ditto. (gfc_trans_omp_array_reduction): Ditto. * trans-stmt.c (gfc_trans_allocate): Ditto. Update call to gfc_allocate_using_malloc. Pass stat rather than pstat to the allocate fuctions. If using coarray lib, pass errmsg and errlen to the allocate functions. Move error checking outside the if (!gfc_array_allocate) block so that it also affects trees produced by gfc_array_allocate. * trans-array.c (gfc_array_allocate): Add new parameters errmsg and errlen. Replace parameter pstat by status. Code cleanup. Update calls to gfc_allocate_allocatable and gfc_allocate_using_malloc. * trans-array.h (gfc_array_allocate): Update signature of gfc_array_allocate. From-SVN: r176606
2011-07-21check.c (gfc_check_present): Allow coarrays.Tobias Burnus1-0/+2
2011-07-21 Tobias Burnus <burnus@net-b.de> * check.c (gfc_check_present): Allow coarrays. * trans-array.c (gfc_conv_array_ref): Avoid casting when a pointer is wanted. * trans-decl.c (create_function_arglist): For -fcoarray=lib, handle hidden token and offset arguments for nondescriptor coarrays. * trans-expr.c (get_tree_for_caf_expr): New function. (gfc_conv_procedure_call): For -fcoarray=lib pass the token and offset for nondescriptor coarray dummies. * trans.h (lang_type): Add caf_offset tree. (GFC_TYPE_ARRAY_CAF_OFFSET): New macro. 2011-07-21 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_lib_token_1.f90: New. From-SVN: r176562
2011-07-06trans-array.c (gfc_array_allocate): Rename allocatable_arrayDaniel Carrera1-3/+16
2011-07-06 Daniel Carrera <dcarrera@gmail.com> * trans-array.c (gfc_array_allocate): Rename allocatable_array * to allocatable. Rename function gfc_allocate_array_with_status to gfc_allocate_allocatable_with_status. Update function call for gfc_allocate_with_status. * trans-opemp.c (gfc_omp_clause_default_ctor): Rename function gfc_allocate_array_with_status to gfc_allocate_allocatable_with_status. * trans-stmt.c (gfc_trans_allocate): Update function call for gfc_allocate_with_status. Rename function gfc_allocate_array_with_status to gfc_allocate_allocatable_with_status. * trans.c (gfc_call_malloc): Add new parameter * gfc_allocate_with_status so it uses the library for memory allocation when -fcoarray=lib. (gfc_allocate_allocatable_with_status): Renamed from gfc_allocate_array_with_status. (gfc_allocate_allocatable_with_status): Update function call for gfc_allocate_with_status. * trans.h (gfc_coarray_type): New enum. (gfc_allocate_with_status): Update prototype. (gfc_allocate_allocatable_with_status): Renamed from gfc_allocate_array_with_status. * trans-decl.c (generate_coarray_sym_init): Use the new constant GFC_CAF_COARRAY_ALLOC in the call to gfor_fndecl_caf_register. From-SVN: r175937
2011-05-31re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-3/+2
2011-05-31 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * intrinsic.c (klass): Add CLASS_ATOMIC. (add_subroutines): Add atomic_ref/atomic_define. * intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document. * intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref, gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes. * gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF and GFC_ISYM_ATOMIC_REF. (gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars. * iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref): * New functions. * check.c (gfc_check_atomic, gfc_check_atomic_def, gfc_check_atomic_ref): New functions. * iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND, ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value. * trans-intrinsic.c (conv_intrinsic_atomic_def, conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New functions. (conv_intrinsic_move_alloc) Renamed from gfc_conv_intrinsic_move_alloc - and made static. * trans.h (gfc_conv_intrinsic_move_alloc): Remove. (gfc_conv_intrinsic_subroutine) Add prototype. * trans.c (trans_code): Call gfc_conv_intrinsic_subroutine. From-SVN: r174510