aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
AgeCommit message (Collapse)AuthorFilesLines
2009-12-23re PR debug/42454 (debug_ranges table contains empty range for unused .text ↵Jakub Jelinek1-16/+29
section with -ffunction-sections) PR debug/42454 * dwarf2out.c (add_ranges_by_labels_to_AT_range_list): New function. (dwarf2out_finish): Call add_ranges_by_labels_to_AT_range_list. * gcc.dg/debug/dwarf2/aranges-fnsec-1.c: Add check for .debug_ranges. Co-Authored-By: Cary Coutant <ccoutant@google.com> From-SVN: r155429
2009-12-22re PR debug/42454 (debug_ranges table contains empty range for unused .text ↵Cary Coutant1-4/+5
section with -ffunction-sections) PR debug/42454 * dwarf2out.c (dwarf2out_finish): Don't output range for .text section unless .text section was used. Likewise for cold. From-SVN: r155402
2009-12-17dwarf2out.c (loc_descriptor): For SYMBOL_REFs and LABEL_REFs use ↵Jakub Jelinek1-11/+21
DW_OP_addr+DW_OP_stack_value instead of... * dwarf2out.c (loc_descriptor): For SYMBOL_REFs and LABEL_REFs use DW_OP_addr+DW_OP_stack_value instead of DW_OP_implicit_value. (add_const_value_attribute): For CONST_STRING, SYMBOL_REFs and LABEL_REFs use DW_OP_addr+DW_OP_stack_value DW_AT_location instead of DW_AT_const_value. * gcc.dg/debug/dwarf2/const-1.c: Don't expect DW_AT_const_value, but instead DW_AT_location with DW_OP_addr+DW_OP_stack_value. Add -gno-strict-dwarf -fno-merge-debug-strings to dg-options. * g++.dg/debug/dwarf2/const1.C: Likewise. * g++.dg/debug/dwarf2/template-params-3.C: Likewise. * g++.dg/debug/dwarf2/template-func-params-3.C: Likewise. From-SVN: r155327
2009-12-15tree.c (free_lang_data_in_binfo): Do not free BINFO_OFFSET and BINFO_VPTR_FIELD.Richard Guenther1-2/+4
2009-12-15 Richard Guenther <rguenther@suse.de> * tree.c (free_lang_data_in_binfo): Do not free BINFO_OFFSET and BINFO_VPTR_FIELD. (free_lang_data_in_type): Do not free TYPE_STUB_DECL if we generate debug information. (free_lang_data_in_decl): Do not free DECL_SIZE_UNIT, DECL_SIZE, DECL_FIELD_OFFSET and DECL_FCONTEXT. (free_lang_data): Do not disable debuginfo. * lto-streamer-out.c (write_symbol_vec): Deal with non-constant DECL_SIZE. (pack_ts_base_value_fields): Write types with false TREE_ASM_WRITTEN. (lto_output_ts_type_tree_pointers): Stream TYPE_STUB_DECL. * lto-streamer-in.c (lto_input_ts_type_tree_pointers): Stream TYPE_STUB_DECL. * dwarf2out.c (add_pure_or_virtual_attribute): Check for DECL_CONTEXT. (gen_type_die_for_member): Test for TYPE_STUB_DECL. * opts.c (decode_options): Do not disable var-tracking for lto. * doc/invoke.texi (-flto): Document -flto vs. -g experimental status. (-fwhopr): Document experimental status. lto/ * lto.c (lto_fixup_field_decl): Fixup DECL_FIELD_OFFSET. (lto_post_options): Do not disable debuginfo. From-SVN: r155259
2009-12-14re PR target/41473 (dsymutil "Assertion failed ...")Alexandre Oliva1-8/+35
PR debug/41473 * dwarf2out.c (AT_loc_list_ptr): New. (resolve_addr): Remove unresolved attributes and loc_list entries. From-SVN: r155222
2009-12-14re PR target/41473 (dsymutil "Assertion failed ...")Alexandre Oliva1-85/+75
PR debug/41473 * dwarf2out.c (add_var_loc_to_decl): Don't drop initial empty locations. (new_loc_list): Drop gensym arg. Move generation of ll_symbol... (gen_llsym): ... here. New function. (add_loc_descr_to_loc_list): Removed. (loc_descriptor): Infer mode from CONST_DOUBLEs and CONST_VECTORs. (single_element_loc_list): Removed. (dw_loc_list): Don't create entries without a location. Don't special-case the first node of the list, only single nodes. (single_element_loc_list_p): Simplify. (loc_list_from_tree): Don't use DECL_RTL if loc_list is nonempty. (add_location_or_const_value_attribute): Test var loc for NULL. (convert_cfa_to_fb_loc_list): Adjust calls to new new_loc_list, call gen_llsym if needed. From-SVN: r155221
2009-12-12tree.c (need_assembler_name_p): Abstract decls do not need an assembler name.Richard Guenther1-1/+2
2009-12-12 Richard Guenther <rguenther@suse.de> * tree.c (need_assembler_name_p): Abstract decls do not need an assembler name. * dwarf2out.c (dwarf2out_abstract_function): Preserve DECL_ABSTRACT properly. From-SVN: r155189
2009-11-25re PR target/10127 (-fstack-check let's program crash)Eric Botcazou1-11/+16
PR target/10127 PR ada/20548 PR middle-end/42004 * dwarf2out.c (dwarf2out_args_size_adjust): Rename to... (dwarf2out_stack_adjust): ...this. Do not adjust the arg size for ACCUMULATE_OUTGOING_ARGS targets. Rename former version to... (dwarf2out_notice_stack_adjust): ...this. Adjust for above renaming. (dwarf2out_frame_debug_expr): Revert previous change and adjust for above renaming. (dwarf2out_frame_debug): Add ??? comment. Adjust for above renaming. From-SVN: r154650
2009-11-25Remove trailing white spaces.H.J. Lu1-14/+14
2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: 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-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: 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-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: 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-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.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.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-24dwarf2out.c (add_location_or_const_value_attribute): Remove useless ↵Paolo Carlini1-1/+0
NOTE_VAR_LOCATION_STATUS call. 2009-11-24 Paolo Carlini <paolo.carlini@oracle.com> * dwarf2out.c (add_location_or_const_value_attribute): Remove useless NOTE_VAR_LOCATION_STATUS call. * cfgrtl.c (commit_one_edge_insertion): Remove useless loop, tidy. From-SVN: r154501
2009-11-24cfgrtl.c (commit_one_edge_insertion): Remove set but not used local variable ↵David Binderman1-6/+1
bb_note. 2009-11-24 David Binderman <dcb314@hotmail.com> * cfgrtl.c (commit_one_edge_insertion): Remove set but not used local variable bb_note. * dominance.c (get_dominated_by): Likewise local var n. (output_file_names): Likewise local var idx. (add_location_or_const_value_attribute): Likewise local var status. * dwarf2out.c (gen_variable_die): Likewise local var field. * emit-rtl.c (no_line_numbers): Remove. (init_emit_once): Remove line_numbers parameter. * rtl.h (init_emit_once): Adjust prototype. * toplev.c (backend_init): Adjust init_emit_once call. From-SVN: r154496
2009-11-19DR 176 permissivenessJason Merrill1-1/+1
DR 176 permissiveness gcc/ * dwarf2out.c (get_context_die): Take TYPE_MAIN_VARIANT. gcc/cp/ * class.c (build_self_reference): Call set_underlying_type. * decl.c (check_elaborated_type_specifier): Don't complain about injected-class-name. (type_is_deprecated): Use TYPE_MAIN_VARIANT. * pt.c (convert_template_argument): Handle injected-class-name used as template template argument. * typeck2.c (abstract_virtuals_error): Use TYPE_MAIN_VARIANT. From-SVN: r154354
2009-11-18dwarf2out.c (loc_list_from_tree): Don't call rtl_for_decl_location ↵Jakub Jelinek1-3/+28
unnecessarily. * dwarf2out.c (loc_list_from_tree): Don't call rtl_for_decl_location unnecessarily. (rtl_for_decl_location): Try harder to get a rtl for TREE_STATIC vars. From-SVN: r154285
2009-11-13re PR c++/26965 (Unnecessary debug info for unused consts in C++)Jason Merrill1-22/+1
PR debug/26965 * dwarf2out.c (gen_variable_die): Don't worry about DECL_COMDAT. Don't emit a second declaration at any scope. From-SVN: r154157
2009-11-10re PR target/10127 (-fstack-check let's program crash)Eric Botcazou1-46/+44
PR target/10127 PR ada/20548 * expr.h (anti_adjust_stack_and_probe): Declare. * explow.c (anti_adjust_stack_and_probe): Make global, add ADJUST_BACK parameter and rewrite head comment. (allocate_dynamic_stack_space): Adjust call to above function. * function.c (expand_function_end): Handle STACK_CHECK_MOVING_SP. * tree.h (dwarf2out_args_size): Delete. * dwarf2out.c (dwarf2out_args_size): Make static and move around. (dwarf2out_args_size_adjust): Delete prototype and move around. (dwarf2out_frame_debug_expr): Do not record arg size adjustments for ACCUMULATE_OUTGOING_ARGS targets. From-SVN: r154079
2009-10-29re PR debug/41700 (g++.dg/debug/dwarf2/icf.C)Cary Coutant1-21/+56
gcc/ChangeLog: PR debug/41700 * dwarf2out.c (dwarf2_debug_hooks): Add entries for new hook (two locations in the source). (store_vcall_insn): New function. (lookup_vcall_insn): New function. (dwarf2out_virtual_call_token): Use store_vcall_insn. (dwarf2out_copy_call_info): New function. (dwarf2out_virtual_call): Use lookup_vcall_insn. * emit-rtl.c (try_split): Call copy_call_info debug hook. * debug.h (struct gcc_debug_hooks): Add copy_call_info hook. * debug.c (do_nothing_debug_hooks): Add dummy entry for new hook. (debug_nothing_rtx_rtx): New dummy hook. * dbxout.c (dbx_debug_hooks): Add dummy entry for new hook. (xcoff_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. From-SVN: r153719
2009-10-28trans-common.c (create_common): Set TREE_PUBLIC to false on fake variables.Rafael Avila de Espindola1-2/+1
2009-10-28 Rafael Avila de Espindola <espindola@google.com> * trans-common.c (create_common): Set TREE_PUBLIC to false on fake variables. 2009-10-28 Rafael Avila de Espindola <espindola@google.com> * dbxout.c (dbxout_common_check): Accept non public trees. * dwarf2out.c (fortran_common): Accept non public trees. From-SVN: r153685
2009-10-26extend.texi (Named Address Spaces): New section.Ben Elliston1-0/+6
2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/extend.texi (Named Address Spaces): New section. * coretypes.h (addr_space_t): New type. (ADDR_SPACE_GENERIC): New define. (ADDR_SPACE_GENERIC_P): New macro. * doc/tm.texi (Named Address Spaces): New section. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document. (TARGET_ADDR_SPACE_SUBSET_P): Document. (TARGET_ADDR_SPACE_CONVERT): Document. * target.h (struct gcc_target): Add addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_ADDR_SPACE_HOOKS): Likewise. (TARGET_INITIALIZER): Initialize addr_space hooks. * targhooks.c (default_addr_space_legitimate_address_p): New function. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * targhooks.h (default_addr_space_legitimate_address_p): Add prototype. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * doc/rtl.texi (MEM_ADDR_SPACE): Document. * rtl.h (mem_attrs): Add ADDRSPACE memory attribute. (MEM_ADDR_SPACE): New macro. * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set address space memory attribute. (mem_attrs_htab_hash): Handle address space memory attribute. (mem_attrs_htab_eq): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_align): Likewise. (set_mem_expr): Likewise. (set_mem_offset): Likewise. (set_mem_size): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. (widen_memoy_address): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. (set_mem_addr_space): New function. * emit-rtl.h (set_mem_addr_space): Add prototype. * print-rtl.c (print_rtx): Print address space memory attribute. * expr.c (expand_assignment): Set address space memory attribute of generated MEM RTXes as appropriate. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. * tree.h (struct tree_base): Add address_space bitfield. Reduce size of "spare" bitfield. (TYPE_ADDR_SPACE): New macro. (ENCODE_QUAL_ADDR_SPACE): Likewise. (DECODE_QUAL_ADDR_SPACE): Likewise. (CLEAR_QUAL_ADDR_SPACE): Likewise. (KEEP_QUAL_ADDR_SPACE): Likewise. (TYPE_QUALS): Encode type address space. (TYPE_QUALS_NO_ADDR_SPACE): New macro. * tree.c (set_type_quals): Set type address space. (build_array_type): Inherit array address space from element type. * print-tree.c (print_node_brief): Print type address space. (print_node): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * explow.c (memory_address): Rename to ... (memory_address_addr_space): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * recog.c (memory_address_p): Rename to ... (memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (offsettable_address_p): Rename to ... (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * reload.c (strict_memory_address_p): Rename to ... (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (maybe_memory_address_p): Rename to ... (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. * expr.h (memory_address_addr_space): Add prototype. (memory_address): Define as macro. * recog.h (memory_address_addr_space_p): Add prototype. (memory_address_p): Define as macro. (offsettable_address_addr_space_p): Add prototype. (offsettable_address_p): Define as macro. (strict_memory_address_addr_space_p): Add prototype. (strict_memory_address_p): Define as macro. * combine.c (find_split_point): Use address-space aware variants of memory address routines. * emit-rtl.c (operand_subword): Likewise. (change_address_1): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. * expr.c (emit_move_insn): Likewise. (expand_assignment): Likewise. (expand_expr_real_1): Likewise. * recog.c (verify_changes): Likewise. (general_operand): Likewise. (offsettable_memref_p): Likewise. (offsettable_nonstrict_memref_p): Likewise. (constrain_operands): Likewise. * reload.c (get_secondary_mem): Likewise. (find_reloads_toplev): Likewise. (find_reloads_address): Likewise. (find_reloads_subreg_address): Likewise. * reload1.c (reload): Likewise. * rtlhooks.c (gen_lowpart_if_possible): Likewise. * rtl.h (address_cost): Add ADDRSPACE argument. * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. * loop-invariant.c (create_new_invariant): Update address_cost call. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * fwprop.c (should_replace_address): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (propagate_rtx_1): Update call to should_replace_address. * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE argument. * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add ADDRSPACE argument. Use per-address-space instead of global cache. Use address-space aware variant of memory address routines. (get_address_cost): Likewise. (get_computation_cost_at): Update calls. * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (create_mem_ref_raw): Update call to valid_mem_ref_p. (most_expensive_mult_to_index): Update call to multiplier_allowed_in_address_p. * dwarf2out.c (modified_type_die): Output DW_AT_address_class attribute to indicate named address spaces. * varasm.c (get_variable_section): DECLs in named address spaces cannot be "common". * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS for addresses in a non-generic address space. * expr.c (emit_block_move_hints): Do not use libcalls for memory in non-generic address spaces. (clear_storage_hints): Likewise. (expand_assignment): Likewise. * fold-const.c (operand_equal_p): Expressions refering to different address spaces are not equivalent. * rtl.c (rtx_equal_p_cb): MEMs refering to different address spaces are not equivalent. (rtx_equal_p): Likewise. * cse.c (exp_equiv_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * reload.c (operands_match_p): Likewise. * alias.c (nonoverlapping_memrefs_p): MEMs refering to different address spaces may alias. (true_dependence): Likewise. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * dse.c (canon_address): Handle named address spaces. * ifcvt.c (noce_try_cmove_arith): Likewise. * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code. * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR. * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR to handle conversions between different address spaces. * fold-const.c (fold_convert_loc): Likewise. (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_unary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_unary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-ssa.c (useless_type_conversion_p): Conversions between pointers to different address spaces are not useless. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153572
2009-10-26re PR debug/41828 (DW_AT_name should not be present for anonymous aggregates)Jakub Jelinek1-7/+27
PR debug/41828 * cp-lang.c (cxx_dwarf_name): Return NULL instead of <anonymous ...> for anonymous aggregate names. * dwarf2out.c (add_pubname, add_pubtype, generic_parameter_die, add_name_and_src_coords_attributes, gen_namespace_die, dwarf2out_set_name): Handle dwarf2_name returning NULL. * g++.dg/debug/dwarf2/anonname1.C: New test. From-SVN: r153568
2009-10-17re PR debug/40521 (-g causes GCC to generate .eh_frame)Jakub Jelinek1-0/+11
PR debug/40521 * debug.h (struct gcc_debug_hooks): Add assembly_start hook. * cgraphunit.c (cgraph_optimize): Call it. * dwarf2out.c (dwarf2out_init): Move .cfi_sections printing into... (dwarf2out_assembly_start): ... here. New hook. (dwarf2out_debug_hooks): Add dwarf2out_assembly_start. * debug.c (do_nothing_debug_hooks): Do nothing for assembly_start hook. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Add vmsdbgout_assembly_start. (vmsdbgout_assembly_start): New hook. From-SVN: r152930
2009-10-16dwarf2out.c (mem_loc_descriptor): Cast DWARF2_ADDR_SIZE to int to avoid ↵Jakub Jelinek1-2/+2
signed vs. * dwarf2out.c (mem_loc_descriptor) <case ZERO_EXTRACT>: Cast DWARF2_ADDR_SIZE to int to avoid signed vs. unsigned warnings. From-SVN: r152915
2009-10-16re PR debug/41717 (internal compiler error: in expand_debug_expr)Jakub Jelinek1-11/+19
PR debug/41717 * cfgexpand.c (expand_debug_expr): Handle CONJ_EXPR. * dwarf2out.c (mem_loc_descriptor): Don't handle POST_INT/POST_DEC/POST_MODIFY like SUBREG. For SUBREG punt if it is not lowpart subreg or if inner mode isn't MODE_INT. * gcc.dg/debug/pr41717.c: New test. From-SVN: r152897
2009-10-15dwarf2out.c (dwarf_tag_name): Handle DW_TAG_rvalue_reference_type and ↵Jakub Jelinek1-2/+40
DW_TAG_template_alias. * dwarf2out.c (dwarf_tag_name): Handle DW_TAG_rvalue_reference_type and DW_TAG_template_alias. (dwarf_attr_name): Handle DW_AT_main_subprogram, DW_AT_data_bit_offset, DW_AT_const_expr, DW_AT_enum_class, DW_AT_linkage_name, DW_AT_GNU_guarded_by, DW_AT_GNU_pt_guarded_by, DW_AT_GNU_guarded, DW_AT_GNU_pt_guarded, DW_AT_GNU_locks_excluded, DW_AT_GNU_exclusive_locks_required, DW_AT_GNU_shared_locks_required and DW_AT_GNU_odr_signature. (dwarf_form_name): Handle DW_FORM_sec_offset, DW_FORM_exprloc, DW_FORM_flag_present and DW_FORM_ref_sig8. (output_signature): Only print name on the first byte. (output_die): Likewise for dw_val_class_data8. * include/dwarf2.h (DW_LANG_Python): Add comment that it is a DWARF 4 addition. From-SVN: r152853
2009-10-14re PR debug/41695 (Invalid .debug_loc created)Jakub Jelinek1-2/+1
PR debug/41695 * dwarf2out.c (dwarf2out_var_location): Always clear last_postcall_label when changing last_label. * gcc.dg/debug/dwarf2/pr41695.c: New test. From-SVN: r152760
2009-10-13* dwarf2out.c (mem_loc_descriptor): Accept UNGT as well.Eric Botcazou1-0/+1
From-SVN: r152733
2009-10-12Candidate fix for PR c++/41570Dodji Seketeli1-8/+3
gcc/ChangeLog: PR c++/41570 * gcc/dwarf2out.c (template_parameter_pack_die, gen_formal_parameter_pack_die): Use add_name_and_src_coords_attributes. gcc/testsuite/ChangeLog: PR c++/41570 * gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C: New test. From-SVN: r152663
2009-10-09re PR debug/40521 (-g causes GCC to generate .eh_frame)Jakub Jelinek1-3/+1
PR debug/40521 * dwarf2out.c (dwarf2out_init): Test whether HAVE_GAS_CFI_SECTIONS_DIRECTIVE is non-zero instead of checking it is defined. From-SVN: r152598
2009-10-08Add support for debugging with ICF (Identical Code Folding).Cary Coutant1-0/+301
gcc/ChangeLog: Add support for debugging with ICF (Identical Code Folding). * calls.c (debug.h): New #include. (emit_call_1): Call virtual_call_token debug hook. * common.opt (-fenable-icf-debug): New option. * dwarf2out.c (dwarf2_debug_hooks): Add entries for new hooks (two locations in the source). (poc_label_num): New variable. (dcall_entry, vcall_entry): New typedefs. (dcall_table, vcall_table): New variables. (struct vcall_insn): New type. (vcall_insn_table): New variable. (DEBUG_DCALL_SECTION, DEBUG_VCALL_SECTION): New macros. (size_of_dcall_table): New function. (output_dcall_table): New function. (size_of_vcall_table): New function. (output_vcall_table): New function. (dwarf2out_direct_call): New function. (vcall_insn_table_hash): New function. (vcall_insn_table_eq): New function. (dwarf2out_virtual_call_token): New function. (dwarf2out_virtual_call): New function. (dwarf2out_init): Allocate new tables and sections. (prune_unused_types): Mark DIEs referenced from direct call table. (dwarf2out_finish): Output direct and virtual call tables. * final.c (final_scan_insn): Call direct_call and virtual_call debug hooks. * debug.h (struct gcc_debug_hooks): Add direct_call, virtual_call_token, virtual_call hooks. (debug_nothing_uid): New function. * debug.c (do_nothing_debug_hooks): Add dummy entries for new hooks. (debug_nothing_uid): New function. * dbxout.c (dbx_debug_hooks): Add dummy entries for new hooks. * sdbout.c (sdb_debug_hooks): Likewise. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * doc/invoke.texi (-fenable-icf-debug): New option. gcc/testsuite/ChangeLog: Add support for debugging with ICF (Identical Code Folding). * g++.dg/debug/dwarf2/icf.C: New test. From-SVN: r152577
2009-10-07dwarf2out.c (tree_add_const_value_attribute_for_decl): Don't add ↵Jakub Jelinek1-0/+4
DW_AT_const_value if VAR_DIE already has DW_AT_abstract_origin... * dwarf2out.c (tree_add_const_value_attribute_for_decl): Don't add DW_AT_const_value if VAR_DIE already has DW_AT_abstract_origin refering to a DIE with DW_AT_const_value. * gcc.dg/debug/dwarf2/inline3.c: New test. From-SVN: r152535
2009-10-05dwarf2out.c (modified_type_die): Don't add DW_AT_name to ↵Jakub Jelinek1-3/+9
DW_TAG_{const,volatile}_type if... * dwarf2out.c (modified_type_die): Don't add DW_AT_name to DW_TAG_{const,volatile}_type if its DW_AT_type already has the same name and isn't the main variant. From-SVN: r152468
2009-10-05re PR debug/41558 (gfortran -O code excessive DW_OP_deref's)Jakub Jelinek1-101/+84
PR debug/41558 * dwarf2out.c (loc_by_reference): Removed. (dw_loc_list_1): New function. (dw_loc_list): Remove toplev argument, add want_address argument. Don't look at decl_by_reference_p at all. Use dw_loc_list_1. (loc_list_from_tree) <case VAR_DECL>: Pass want_address rather than want_address == 2 to dw_loc_list. For successful dw_loc_list set have_address to 1 only if want_address is not 0. * gcc.dg/guality/guality.exp: Move gdb-test proc into... * lib/gcc-gdb-test.exp: ... here. New file. * gfortran.dg/guality/guality.exp: New file. * gfortran.dg/guality/pr41558.f90: New test. * gfortran.dg/guality/arg1.f90: New test. From-SVN: r152467
2009-10-02Add support for comdat type sections for DWARF v4.Cary Coutant1-44/+1572
Add support for comdat type sections for DWARF v4. Merge from dwarf4 branch. * dwarf2out.c (DWARF_TYPE_SIGNATURE_SIZE): New constant. (dw_die_ref): Define vector type. (enum dw_val_class): Add dw_val_class_data8. (struct dw_val_struct): Add v.val_data8. (comdat_type_node_ref): New type. (struct die_struct): Move die_symbol into a union; add new field die_type_node. Change all uses. (comdat_type_node): New type. (skeleton_chain_node): New type. (DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE): New constant. (comdat_type_list): New variable. (dwarf_tag_name): Add DW_TAG_type_unit. (dwarf_attr_name): Add DW_AT_signature. (add_AT_data8): New function. (replace_child): New function. (move_all_children): New function. (print_signature): New function. (print_die): Print signature information; add dw_val_class_data8. (attr_checksum): Support dw_val_class_data8. (CHECKSUM_STRING): Redefine for DWARF-4 to include trailing NULL byte. (CHECKSUM_SLEB128, CHECKSUM_ULEB128): New macros. (checksum_sleb128, checksum_uleb128): New functions. (checksum_die_context): New function. (loc_checksum_ordered): New function. (attr_checksum_ordered): New function. (struct checksum_attributes): New structure. (collect_checksum_attributes): New function. (die_checksum_ordered): New function. (generate_type_signature): New function. (same_dw_val_p): Add dw_val_class_data8. (is_symbol_die): Use new is_declaration_die function. (is_declaration_die): New function. (should_move_die_to_comdat): New function. (clone_die): New function. (clone_tree): New function. (clone_as_declaration): New function. (copy_declaration_context): New function. (generate_skeleton_ancestor_tree): New function. (generate_skeleton_bottom_up): New function. (generate_skeleton): New function. (remove_child_or_replace_with_skeleton): New function. (break_out_comdat_types): New function. (struct decl_table_entry): New type. (htab_decl_hash): New function. (htab_decl_eq): New function. (htab_decl_del): New function. (copy_ancestor_tree): New function. (copy_decls_walk): New function. (copy_decls_for_unworthy_types): New function. (build_abbrev_table): Don't assert on missing die_symbol when doing comdat type sections. (size_of_die): Use DW_FORM_sig8 for external references; Add dw_val_class_data8. (unmark_dies): Don't assert for unmarked dies when doing comdat type sections. (value_format): Support DW_FORM_sig8 and dw_val_class_data8. (output_signature): New function. (output_die): Likewise. (output_compilation_unit_header): Mark output as DWARF version 3 even if generating DWARF 4. (output_comdat_type_unit): New function. (output_line_info): Mark output as DWARF version 3 even if generating DWARF 4. (dwarf2out_start_source_file): Don't do eliminate_dwarf2_dups with DWARF-4. (dwarf2out_end_source_file): Likewise. (prune_unused_types_walk_attribs): Don't follow references into comdat type sections. (prune_unused_types_mark): When generating type units, do not mark children of non-defining declarations of types; do mark children of type entries. (prune_unused_types): Process comdat type sections. (htab_ct_hash): New function. (htab_ct_eq): New function. (dwarf2out_finish): Move types to comdat sections when using DWARF-4. Add a pointer to the line table from type unit entries so DW_AT_decl_file has meaning. * varasm.c (default_elf_asm_named_section): Use identifier name as comdat key instead of lang hook. From-SVN: r152421
2009-10-02re PR debug/40521 (-g causes GCC to generate .eh_frame)Jakub Jelinek1-0/+20
PR debug/40521 * configure.ac (HAVE_GAS_CFI_SECTIONS_DIRECTIVE): New test. * configure: Regenerated. * config.in: Regenerated. * dwarf2out.c (dwarf2out_do_cfi_asm): Return false if !HAVE_GAS_CFI_SECTIONS_DIRECTIVE and not emitting .eh_frame. (dwarf2out_init): If HAVE_GAS_CFI_SECTIONS_DIRECTIVE and not emitting .eh_frame, emit .cfi_sections .debug_frame directive. From-SVN: r152414
2009-10-02re PR bootstrap/41404 (expr.c undefined reference while linking jc1)Jakub Jelinek1-8/+148
PR debug/41404 PR debug/41353 * cfgexpand.c (expand_debug_expr) <case STRING_CST>: Don't create CONST_STRING if STRING_CST contains embedded '\0's or doesn't end with '\0'. (expand_debug_expr) <case VAR_DECL>: For TREE_STATIC !DECL_EXTERNAL vars use DECL_RTL with resetting it back to NULL afterwards. * dwarf2out.c (same_dw_val_p): For dw_val_class_addr compare with rtx_equal_p instead of asserting it is a SYMBOL_REF. (value_format): For dw_val_class_addr only use DW_FORM_addr if the attribute type allows it, otherwise use DW_FORM_dataN. (mem_loc_descriptor): Handle CONST_STRING. (add_const_value_attribute): Handle CONST_STRING using add_AT_addr. Handle MEM with CONST_STRING address using add_AT_string. (rtl_for_decl_init): Return MEM with CONST_STRING address instead of CONST_STRING for const arrays initialized with a string literal. (resolve_one_addr, resolve_addr_in_expr, resolve_addr): New functions. (dwarf2out_finish): Call resolve_addr. * gcc.dg/guality/pr41404-1.c: New test. * gcc.dg/guality/pr41353-2.c: New test. From-SVN: r152403
2009-09-29re PR debug/41438 (VTA: libgomp build fails due to inconsistent debug info)Jakub Jelinek1-8/+75
PR debug/41438 * dwarf2out.c (const_ok_for_output_1, const_ok_for_output): New functions. (mem_loc_descriptor, loc_descriptor, add_const_value_attribute): Bail out if !const_ok_for_output. PR debug/41474 * dwarf2out.c (mem_loc_descriptor) <case CONCAT, case CONCATN, case VAR_LOCATION>: Remove gcc_unreachable (). * gcc.dg/debug/dwarf2/const-1.c: Add dg-require-visibility, make x hidden. * g++.dg/debug/dwarf2/const-1.C: Likewise. From-SVN: r152282
2009-09-27dwarf2out.c (enum dw_val_class): Replace dw_val_class_long_long with ↵Eric Botcazou1-52/+88
dw_val_class_const_double. * dwarf2out.c (enum dw_val_class): Replace dw_val_class_long_long with dw_val_class_const_double. (struct dw_val_struct): Replace val_long_long with val_double and adjust for above change. (output_loc_operands): Likewise. (add_AT_long_long): Rename into... (add_AT_double): ...this. (print_die): Replace dw_val_class_long_long with dw_val_class_const_double and adjust. (attr_checksum): Likewise. (same_dw_val_p): Likewise. (size_of_die): Likewise. (value_format): Likewise. (output_die): Likewise. (loc_descriptor) <CONST_DOUBLE>: Likewise. (add_const_value_attribute) <CONST_DOUBLE>: Call add_AT_double instead of add_AT_long_long. (add_bound_info) <INTEGER_CST>: Generate the bound as an unsigned value with the precision of its type. From-SVN: r152222
2009-09-26DWARF for Template parm pack is a gnu extension.Dodji Seketeli1-11/+11
include/ChangeLog: * dwarf2.h (enum dwarf_tag): Rename DW_TAG_template_parameter_pack and DW_TAG_formal_parameter_pack into DW_TAG_GNU_template_parameter_pack and DW_TAG_formal_parameter_pack until DWARF 5 is out. gcc/ChangeLog: * dwarf2out.c (dwarf_tag_name, gen_generic_params_dies, generic_parameter_die, template_parameter_pack_die, gen_formal_parameter_die, gen_subprogram_die): Adjust after renaming DW_TAG_formal_parameter_pack and DW_TAG_template_parameter_pack into DW_TAG_GNU_formal_parameter_pack and DW_TAG_GNU_template_parameter_pack. gcc/testsuite/ChangeLog: * g++.dg/debug/dwarf2/template-func-params-4.C: Adjust after renaming DW_TAG_template_parameter_pack and DW_TAG_formal_parameter_pack into DW_TAG_GNU_template_parameter_pack and DW_TAG_GNU_formal_parameter_pack. * g++.dg/debug/dwarf2/template-params-4.C: Likewise. * g++.dg/debug/dwarf2/template-func-params-7.C: Likewise. From-SVN: r152188
2009-09-25dwarf2out.c (tls_mem_loc_descriptor): Pass 1 instead of 2 to ↵Jakub Jelinek1-2/+2
loc_descriptor_from_tree. * dwarf2out.c (tls_mem_loc_descriptor): Pass 1 instead of 2 to loc_descriptor_from_tree. (add_location_or_const_value_attribute): Pass 0 instead of 2 for decl_by_reference_p decls. From-SVN: r152172
2009-09-24re PR bootstrap/41457 (Bootstrap failure at revision 152100)Jakub Jelinek1-8/+6
PR bootstrap/41457 * dwarf2out.c (add_const_value_attribute): For HIGH and CONST_FIXED, return false instead of gcc_unreachable (). For CONST return the value returned by recursive call instead of always returning true. (tree_add_const_value_attribute): Return the value returned by add_const_value_attribute instead of always returning true if rtl is non-NULL. From-SVN: r152119
2009-09-23re PR debug/41439 (choose DW_OP_stack_value over DW_OP_implicit_value more ↵Jakub Jelinek1-21/+5
often, please) PR debug/41439 * dwarf2out.c (address_of_int_loc_descriptor): Don't emit DW_OP_piece after DW_OP_stack_value, adjust size calculations for it, when DW_OP_stack_value and DW_OP_implicit_value has the same size, prefer DW_OP_stack_value. (loc_descriptor, loc_list_for_address_of_addr_expr_of_indirect_ref, loc_list_from_tree): Don't emit DW_OP_piece after DW_OP_stack_value. From-SVN: r152091
2009-09-23re PR debug/41065 (DW_TAG_enumeration_type+DW_TAG_enumerator is sometimes ↵Dodji Seketeli1-1/+50
missing) Fix PR debug/41065 gcc/ChangeLog: PR debug/41065 * function.h (types_used_by_vars_hash): Declare new hash table. (types_used_by_vars_eq, types_used_by_var_decl_insert): Declare equality and hash function for the hash table. (types_used_by_cur_var_decl): Declare a new global chained list. (types_used_by_var_decl_insert): Declare new function. * function.c (types_used_by_vars_hash): Define the hashtable ... (types_used_by_vars_eq, types_used_by_vars_do_hash): ... as well as its equality and hash functions. (hash_types_used_by_vars_entry): New hash helper. (types_used_by_cur_var_decl): Define the global chained list. (used_types_insert): Update the list of types used by the global variable being parsed. (types_used_by_var_decl_insert): Define new function. * c-common.h (record_types_used_by_current_var_decl): Declare ... * c-common.c (record_types_used_by_current_var_decl): ... new function. * c-decl.c (finish_decl): Record the types used by the global variable declaration we've just parsed. * dwarf2out.c (premark_used_types): Insert a new line between comment and function. (premark_used_types_helper): Fix comment. (premark_types_used_by_global_vars_helper, premark_types_used_by_global_vars): New functions. (prune_unused_types): Do not prune types used by global variables. gcc/cp/ChangeLog: PR debug/41065 * decl.c (cp_finish_decl): Record the types used by the global variable declaration we've just parsed. gcc/testsuite/ChangeLog: PR debug/41065 * gcc.dg/debug/dwarf2/global-used-types.c: New test. From-SVN: r152085
2009-09-23re PR debug/41411 (ICE: mem_loc_descriptor, at dwarf2out.c:11616)Jakub Jelinek1-3/+5
* dwarf2out.c (loc_list_plus_const): Only define if DWARF2_DEBUGGING_INFO. (address_of_int_loc_descriptor): Likewise. PR debug/41411 * dwarf2out.c (mem_loc_descriptor): Handle HIGH. From-SVN: r152059
2009-09-22re PR debug/41266 (Emit DW_TAG_template_parameter_pack and ↵Dodji Seketeli1-81/+164
DW_TAG_formal_parameter_pack) Fix for PR debug/41266 ChangeLog: * include/dwarf2.h (enum dwarf_tag): Add DW_TAG_template_parameter_pack and DW_TAG_formal_parameter_pack. gcc/ChangeLog: * dwarf2out.c (template_parameter_pack_die, gen_formal_parameter_pack_die ): New functions. (make_ith_pack_parameter_name): Remove this function. (dwarf_tag_name): Support printing DW_TAG_template_parameter_pack and DW_TAG_formal_parameter_pack. (gen_generic_params_dies): Represent each template parameter pack by a DW_TAG_template_parameter_pack DIE. Argument pack elements are represented by usual DW_TAG_template_*_parameter DIEs that are children of the DW_TAG_template_parameter_pack element DIE. (generic_parameter_die): This doesn't deal with parameter pack names anymore. Don't generate DW_AT_name for some DIEs, e.g. children of parameter pack DIEs. (gen_formal_parameter_die): Add a flag to not emit DW_AT_name in certain cases, e.g. for pack elements. (gen_formal_types_die, gen_decl_die): Adjust usage of gen_formal_parameter_die. (gen_subprogram_die): Represent each function parameter pack by a DW_TAG_formal_parameter_pack DIE. Arguments of of the pack are represented by usual DW_TAG_formal_parameter DIEs that are children of the DW_TAG_formal_parameter_pack DIE. Remove references to ____builtin_va_alist decls as no part of the compiler uses those anymore. * langhooks.h (struct lang_hooks_for_decls): Add function_parm_expanded_from_pack_p, get_generic_function_decl and function_parameter_pack_p hooks. Fix comment for get_innermost_generic_parms hook. * langhooks-def.h (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P, LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P ): Declare new hook macros and use them to initialize lang_hook. gcc/cp/ChangeLog: * cp-lang.c (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P, LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P, LANG_HOOKS_GET_GENERIC_FUNCTION_DECL): Initialize these hooks for the c++ FE. * cp-tree.h (function_parameter_pack_p, get_function_template_decl, function_parameter_expanded_from_pack_p): Declare ... * pt.c (function_parameter_pack_p, get_function_template_decl, function_parameter_expanded_from_pack_p): ... new hooks. (get_template_info): Make this more robust. (template_args_variadic_p, make_ith_pack_parameter_name): Add a new line between comment and function. (get_template_argument_pack_elems): Fix comment. (tsubst_decl): Arguments of function parameter packs are not parameter packs themselves. gcc/testsuite/ChangeLog: * g++.dg/debug/dwarf2/template-func-params-4.C: Adjust. * g++.dg/debug/dwarf2/template-func-params-7.C: Likewise. * g++.dg/debug/dwarf2/template-params-4.C: Likewise. From-SVN: r152043
2009-09-22re PR bootstrap/41405 (Bootstrap fails on *-apple-darwin* due to revision ↵Jakub Jelinek1-33/+73
151815) PR bootstrap/41405 * dwarf2out.c (base_type_die, record_type_tag, gen_subprogram_die, add_call_src_coords_attributes, add_high_low_attributes, gen_compile_unit_die, gen_type_die_with_usage force_decl_die, gen_decl_die, dwarf2out_imported_module_or_decl_1, dwarf2out_finish, dwarf2out_imported_module_or_decl): Avoid using DWARF3 additions when -gdwarf-2 -gstrict-dwarf. (loc_list_from_tree): Likewise. Avoid using DWARF4 additions when -gdwarf-[23] -gstrict-dwarf. (address_of_int_loc_descriptor, loc_descriptor, loc_list_for_address_of_addr_expr_of_indirect_ref): Avoid using DWARF4 additions when -gdwarf-[23] -gstrict-dwarf. * common.opt (gno-strict-dwarf, gstrict-dwarf): New options. * gfortran.dg/debug/pr37738.f: Add -gno-strict-dwarf to dg-options. * gfortran.dg/debug/pr35154-dwarf2.f: Likewise. * g++.dg/debug/dwarf2/explicit-constructor.C: Likewise. * g++.dg/debug/dwarf2/imported-module-2.C: Likewise. * g++.dg/debug/dwarf2/imported-module-3.C: Likewise. * g++.dg/debug/dwarf2/imported-module-4.C: Likewise. * g++.dg/debug/dwarf2/namespace-1.C: Likewise. * objc.dg/dwarf-2.m: Likewise. From-SVN: r151978
2009-09-22dwarf2out.c (address_of_int_loc_descriptor): Avoid signed/unsigned ↵Jakub Jelinek1-1/+1
comparison warning on rs6000. * dwarf2out.c (address_of_int_loc_descriptor): Avoid signed/unsigned comparison warning on rs6000. From-SVN: r151967
2009-09-22re PR bootstrap/41404 (expr.c undefined reference while linking jc1)Dave Korn1-3/+2
PR bootstrap/41404 * dwarf2out.c (mem_loc_descriptor): Punt on CONST_STRING until we can handle it correctly. From-SVN: r151958
2009-09-21inline-params.c: New testcase.Jan Hubicka1-1/+10
* gcc.dg/guality/inline-params.c: New testcase. * dwarf2out.c (decl_loc_table_eq): Allow decl_loc_table to be NULL. (dwarf2out_abstract_function): NULLify decl_loc_table at begginig and restore at the end. From-SVN: r151917
2009-09-20dwarf2out.c (add_const_value_attribute): Return true if successful.Jan Hubicka1-226/+295
* dwarf2out.c (add_const_value_attribute): Return true if successful. (add_location_or_const_value_attribute): Rewrite using loc_list_from_tree. (tree_add_const_value_attribute): Return true if successful. (tree_add_const_value_attribute_for_decl): Likewise. * dwarf2out.c (address_of_int_loc_descriptor): Break out from ... (loc_descriptor): ... here; (loc_list_for_address_of_addr_expr_of_indirect_ref): New function. (cst_pool_loc_descr): Break out from ...; do not reffer constant pool items that was not marked for output. (loc_list_from_tree): ... here; handle special cases of ADDR_EXPR; (loc_list_for_address_of_addr_expr_of_indirect_ref): New function. (loc_list_for_address_of_addr_expr_of_indirect_ref): New function. handle ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF, REALPART_EXPR, IMAGPART_EXPR; handle address of INTEGER_CST; improve handling of CONSTRUCTOR; handle REAL_CST, STRING_CST, COMPLEX_CST; use DW_OP_stack_value to get address of items that are not available as addresses. (dw_loc_list): Handle single element lists correctly. From-SVN: r151901
2009-09-19re PR bootstrap/41397 (RTL checking failure compiling libiberty)Jakub Jelinek1-2/+2
PR bootstrap/41397 * dwarf2out.c (mem_loc_descriptor) <case SUBREG>: Recurse instead of assuming it has always a REG inside of it. From-SVN: r151872
2009-09-17dwarf2out.c (loc_descriptor): Emit DW_OP_stack_value and ↵Alexandre Oliva1-7/+5
DW_OP_implicit_value even without dwarf_version 4. * dwarf2out.c (loc_descriptor): Emit DW_OP_stack_value and DW_OP_implicit_value even without dwarf_version 4. From-SVN: r151815