diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-21 10:43:55 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-21 10:43:55 +0000 |
commit | bd11046c067c9b3bbae45b2723d7bae0ccc99da2 (patch) | |
tree | 651676cbef1c8e70dd0202c2989b2ef58678fcd8 | |
parent | 0d8c07f78603884b20cb9fd6a07879d382565449 (diff) | |
download | gcc-bd11046c067c9b3bbae45b2723d7bae0ccc99da2.tar.gz |
2012-05-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 187704 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@187706 138bc75d-0d04-0410-961f-82ee72b054a4
247 files changed, 5905 insertions, 2898 deletions
diff --git a/ChangeLog b/ChangeLog index 9a46dca69f4..e29515044c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2012-05-16 Olivier Hainque <hainque@adacore.com> + + * Makefile.tpl (gcc-no-fixedincludes): Rename into ... + (gcc-install-no-fixedincludes): Now forwarder to local target in gcc/ + (install-no-fixedincludes): Adjust accordingly. + * Makefile.in: Regenerate. + +2012-05-15 H.J. Lu <hongjiu.lu@intel.com> + + Merge upstream change + * libtool.m4 (_LT_ENABLE_LOCK): Support x32. + 2012-05-14 Marc Glisse <marc.glisse@inria.fr> * MAINTAINERS (Write After Approval): Add myself. diff --git a/ChangeLog.MELT b/ChangeLog.MELT index 2a3e8322942..3018946f82c 100644 --- a/ChangeLog.MELT +++ b/ChangeLog.MELT @@ -1,4 +1,7 @@ +2012-05-21 Basile Starynkevitch <basile@starynkevitch.net> + MELT branch merged with trunk rev 187704 using svnmerge + 2012-05-15 Basile Starynkevitch <basile@starynkevitch.net> MELT branch merged with trunk rev 187525 using svnmerge diff --git a/Makefile.in b/Makefile.in index e30c5e2ad80..def860e386d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2447,11 +2447,12 @@ install.all: install-no-fixedincludes true ; \ fi -# install-no-fixedincludes is used because Cygnus can not distribute -# the fixed header files. +# install-no-fixedincludes is used to allow the elaboration of binary packages +# suitable for distribution, where we cannot include the fixed system header +# files. .PHONY: install-no-fixedincludes install-no-fixedincludes: installdirs install-host-nogcc \ - install-target gcc-no-fixedincludes + install-target gcc-install-no-fixedincludes .PHONY: install-strip install-strip: @@ -41200,25 +41201,16 @@ check-gcc-go: check-go: check-gcc-go check-target-libgo -# Install the gcc headers files, but not the fixed include files, -# which Cygnus is not allowed to distribute. This rule is very -# dependent on the workings of the gcc Makefile.in. -.PHONY: gcc-no-fixedincludes -gcc-no-fixedincludes: +# The gcc part of install-no-fixedincludes, which relies on an intimate +# knowledge of how a number of gcc internal targets (inter)operate. Delegate. +.PHONY: gcc-install-no-fixedincludes +gcc-install-no-fixedincludes: @if [ -f ./gcc/Makefile ]; then \ - rm -rf gcc/tmp-include; \ - mv gcc/include gcc/tmp-include 2>/dev/null; \ - mkdir gcc/include; \ - cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ - touch gcc/stmp-fixinc gcc/include/fixed; \ - rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - (cd ./gcc && \ - $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ - rm -rf gcc/include; \ - mv gcc/tmp-include gcc/include 2>/dev/null; \ + (cd ./gcc \ + && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \ else true; fi @endif gcc diff --git a/Makefile.tpl b/Makefile.tpl index ae263e6d36f..371c3b6f7db 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -906,11 +906,12 @@ install.all: install-no-fixedincludes true ; \ fi -# install-no-fixedincludes is used because Cygnus can not distribute -# the fixed header files. +# install-no-fixedincludes is used to allow the elaboration of binary packages +# suitable for distribution, where we cannot include the fixed system header +# files. .PHONY: install-no-fixedincludes install-no-fixedincludes: installdirs install-host-nogcc \ - install-target gcc-no-fixedincludes + install-target gcc-install-no-fixedincludes .PHONY: install-strip install-strip: @@ -1443,25 +1444,16 @@ check-gcc-[+language+]: check-[+language+]: check-gcc-[+language+][+ FOR lib-check-target +] [+ lib-check-target +][+ ENDFOR lib-check-target +] [+ ENDFOR languages +] -# Install the gcc headers files, but not the fixed include files, -# which Cygnus is not allowed to distribute. This rule is very -# dependent on the workings of the gcc Makefile.in. -.PHONY: gcc-no-fixedincludes -gcc-no-fixedincludes: +# The gcc part of install-no-fixedincludes, which relies on an intimate +# knowledge of how a number of gcc internal targets (inter)operate. Delegate. +.PHONY: gcc-install-no-fixedincludes +gcc-install-no-fixedincludes: @if [ -f ./gcc/Makefile ]; then \ - rm -rf gcc/tmp-include; \ - mv gcc/include gcc/tmp-include 2>/dev/null; \ - mkdir gcc/include; \ - cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ - touch gcc/stmp-fixinc gcc/include/fixed; \ - rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - (cd ./gcc && \ - $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ - rm -rf gcc/include; \ - mv gcc/tmp-include gcc/include 2>/dev/null; \ + (cd ./gcc \ + && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \ else true; fi @endif gcc diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 0d830836583..f25fbbcd893 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-05-11 H.J. Lu <hongjiu.lu@intel.com> Merge upstream changes diff --git a/boehm-gc/configure b/boehm-gc/configure index c76ea447af5..aa610539399 100755 --- a/boehm-gc/configure +++ b/boehm-gc/configure @@ -6786,7 +6786,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -11304,7 +11311,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11307 "configure" +#line 11314 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11410,7 +11417,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11413 "configure" +#line 11420 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 180e62c9591..dd53a628550 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,401 @@ +2012-05-21 Razya Ladelsky <razya@il.ibm.com> + + * tree-parloops.c : Add myself to contributors, update + TODO list, add link to wiki. + +2012-05-21 Alan Modra <amodra@gmail.com> + + * config/rs6000/predicates.md (input_operand): Don't match + constant pool addresses. Remove label_ref, high and plus from + match_code list. Remove redundant CONSTANT_P test. + (splat_input_operand): Similarly update match_code list. + (small_toc_ref): New predicate. + * config/rs6000/rs6000-protos.h (toc_relative_expr_p): Update prototype. + * config/rs6000/rs6000.c (tocrel_base, tocrel_offset): Make const. + (legitimate_constant_pool_address_p): Move TARGET_TOC test and + register checks to.. + (toc_relative_expr_p): ..here. Add "strict" param. Match new rtl + generated by create_TOC_reference. + (rs6000_legitimize_address): Update cerate_TOC_reference call. + (rs6000_delegitimize_address): Handle new rtl for toc refs. + (rs6000_cannot_force_const_mem, rs6000_find_base_term): Likewise. + (use_toc_relative_ref): New function, split out from.. + (rs6000_emit_move): ..here. Remove redundant tests. Update + create_TOC_reference calls. + (rs6000_legitimize_reload_address): Formatting. Handle splitting + of medium/large model toc addresses. Use use_toc_relative_ref. + (print_operand): Formatting, style. Adjust for toc changes. + (print_operand_address): Likewise. + (rs6000_output_addr_const_extra): Likewise. + (create_TOC_reference): Put TOC_REGISTER in UNSPEC_TOCREL rather + than a PLUS. Use this formulation for both high and low part + of -mcmodel=medium/large toc reference too. Before reload, + always use the small model formulation. + * config/rs6000/rs6000.md (tls_gd, tls_gd_high): Similarly avoid + a PLUS in high part of addresses here. + (tls_ld, tls_ld_high, tls_got_dtprel, tls_got_dtprel_high): Likewise. + (tls_got_tprel, tls_got_tprel_high, largetoc_high): Likewise. + (largetoc_high, largetoc_low): Move earlier. Cope when no + base reg available. + (largetoc_high_plus): New insn. + (movsi_internal1, movsi_internal1_single, movsf_softfloat, + movdi_mfpgpr, movdi_internal64): Don't handle 'R' constraint here.. + (tocref): ..instead do so here, new insn and split. + +2012-05-20 H.J. Lu <hongjiu.lu@intel.com> + + * config/i386/driver-i386.c (host_detect_local_cpu): Support + RDRND, F16C and FSGSBASE. + +2012-05-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + PR rtl-optimzation/53373 + * config/pa/pa.md (call_symref_pic): Don't expose PIC register save in + call pattern. Update split patterns. + (call_symref_64bit, call_reg_pic, call_reg_64bit, call_val_symref_pic, + call_val_symref_64bit, call_val_reg_pic, call_val_reg_64bit): Likewise. + +2012-05-20 Razya Ladelsky <razya@il.ibm.com> + + * tree-parloops.c (gen_parallel_loop): Change many_iterations_cond for outer loops. + +2012-05-18 Jan Hubicka <jh@suse.cz> + + * cgraphunit.c (handle_alias_pairs): Declare; free alias_pairs + (cgraph_process_new_functions): Process also aliases. + * lto-streamer-out.c (struct sets): Remove. + (trivally_defined_alias): Remove. + (output_alias_pair_p): Remove. + (output_unreferenced_globals): Remove. + (produce_symtab); Do not handle alias pairs. + (produce_asm_for_decls): Likewise. + * lto-streamer-in.c (input_alias_pairs): Remove. + (lto_read_body): Do not input alias pairs. + (lto_input_constructors_and_inits): Remove. + +2012-05-18 Jan Hubicka <jh@suse.cz> + + * cgraphunit.c (handle_alias_pairs): Cleanup; handle all types of aliases. + +2012-05-18 Jan Hubicka <jh@suse.cz> + + * cgraphbuild.c (record_reference): Update. + * lto-cgraph.c (lto_output_varpool_node): External vars + are not in other partition even if they are not output + in current partition. + * gimple-fold.c (can_refer_decl_in_current_unit_p): Take FROM_DECL + argument; fix. + (canonicalize_constructor_val): Take FROM_DECL argument. + (fold_ctor_reference, fold_string_cst_ctor_reference, + fold_array_ctor_reference, fold_nonarray_ctor_reference, + fold_ctor_reference): Likewise. + (fold_const_aggregate_ref_1, gimple_get_virt_method_for_binfo): Update. + * gimple.h (gimple_fold_builtin): Likewise. + +2012-05-18 Olivier Hainque <hainque@adacore.com> + + * Makefile.in (FLAGS_TO_PASS): Pass $(libexecsubdir) instead of + $(libsubdir) as libexecsubdir. + +2012-05-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + * config/rs6000/rs6000.c (print_operand): Revise code that unsafely + relied on signed overflow behavior. + +2012-05-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/53346 + * tree-loop-distribution.c (ldist_gen): Make sure to apply + builtin transform even when only a single partition with + all reads/writes exists. + +2012-05-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/53390 + * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Ignore + strided loads. + +2012-05-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + * tree-ssa-reassoc.c (bip_map): Remove decl. + (completely_remove_stmt): Remove function. + (remove_def_if_absorbed_call): Remove function. + (remove_visited_stmt_chain): Remove __builtin_powi handling. + (possibly_move_powi): Remove function. + (rewrite_expr_tree): Remove calls to possibly_move_powi. + (rewrite_expr_tree_parallel): Likewise. + (attempt_builtin_powi): Build multiplies explicitly rather than + relying on the ops vector and rank system. + (transform_stmt_to_copy): New function. + (transform_stmt_to_multiply): Likewise. + (reassociate_bb): Handle leftover operations after __builtin_powi + optimization; build a final multiply if necessary. + +2012-05-18 Jan Hubicka <jh@suse.cz> + + * cgraphunit.c (varpool_finalize_decl): Allow external decls. + (mark_functions_to_output): Fix sanity check. + * ipa.c (function_and_variable_visibility): Remove TREE_STATIC + check. + +2012-05-18 Richard Guenther <rguenther@suse.de> + + * tree-flow.h (mark_symbols_for_renaming): Remove. + * tree-dfa.c (mark_symbols_for_renaming): Likewise. + * tree-inline.c (copy_edges_for_bb): Do not mark symbols for + renaming. + (copy_debug_stmt): Likewise. + (expand_call_inline): Likewise. + (declare_return_variable): Mark the return variable for renaming + if necessary. + +2012-05-18 Andrew Stubbs <ams@codesourcery.com> + + * config/arm/arm-protos.h (arm_emit_coreregs_64bit_shift): New + prototype. + * config/arm/arm.c (arm_emit_coreregs_64bit_shift): New function. + * config/arm/arm.md (ashldi3): Use arm_emit_coreregs_64bit_shift. + (ashrdi3,lshrdi3): Likewise. + (arm_cond_branch): Remove '*' to enable gen_arm_cond_branch. + +2012-05-18 Meador Inge <meadori@codesourcery.com> + + PR rtl-optimization/53352 + * cse.c (equiv_constant): Ignore paradoxical subregs. + +2012-05-17 Steven Bosscher <steven@gcc.gnu.org> + + PR rtl-optimization/53125 + * regstat.c (regstat_bb_compute_ri): Take new local_live_last_luid + argument. Simplify calculation of REG_LIVE_LENGTH for regnos that + die in the basic block. Correctly top off REG_FREQ and + REG_FREQ_CALLS_CROSSED. + Remove do_not_gen. + (regstat_compute_ri): Allocate and free local_live_last_luid. + Remove do_not_gen. + (regstat_bb_compute_calls_crossed): Correctly top off + REG_FREQ_CALLS_CROSSED. + +2012-05-17 Jan Hubicka <jh@suse.cz> + + * lto-symtab.c (lto_symtab_resolve_symbols): Preffer decl with constructor + over decl without. + * cgraph.c (cgraph_remove_node): Clear also body of unanalyzed nodes. + * cgraph.h (varpool_can_remove_if_no_refs): Handle external correctly. + * cgraphunit.c (process_function_and_variable_attributes): Finalize + extrnal decls. + (mark_functions_to_output): Also accept bodies for functions with clones. + (output_in_order): Skip external vars. + * lto-cgraph.c (lto_output_node): External functions are never in other + partition. + (lto_output_varpool_node): Likewise. + * lto-streamer-out.c (lto_write_tree): Always use error_mark_nodes for + forgotten initializers. + * ipa.c (process_references): Handle external vars. + (symtab_remove_unreachable_nodes): Update to handle external vars. + (varpool_externally_visible_p): External vars are externally visible. + * gimple-fold.c (can_refer_decl_in_current_unit_p): Update. + * varpool.c (varpool_remove_node): Remove constructor. + (decide_is_variable_needed): Handle externals. + (varpool_remove_unreferenced_decls): Likewise. + +2012-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org> + + * opts.c (common_handle_option): -pedantic-errors enables -Wpedantic. + (enable_warning_as_error): Do not special case Wuninitialized. + * optc-gen.awk: Add sanity checks. + +2012-05-17 Jan Hubicka <jh@suse.cz> + + * ipa-reference.c (is_proper_for_analysis): Do not check flags + that might change as result of global optimization. + (analyze_function): Do not check analyzed and externally_visible + flags; be happy about address dereferences. + (propagate): Prune all_module_statics so it really contains just + statics; prune all the local summaries. + (ipa_reference_write_optimization_summary): Simplify. + +2012-05-17 Kwok Cheung Yeung <kcy@codesourcery.com> + + * config/m68k/m68k-devices.def: Add 51ag, 51je, 51jf, 51jg, 51mm, + 51qm. + * config/m68k/m68k-tables.opt: Regenerated. + * doc/invoke.texi (M680x0 Options): Document. + +2012-05-16 Dave Boutcher <daveboutcher@gmail.com> + Patrick Marlier <patrick.marlier@gmail.com> + + * trans-mem.c (ipa_tm_transform_clone): Transform functions with + indirect calls. + +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + +2012-05-16 Andrew Pinski <apinski@cavium.com> + + * gimple-fold.c (get_maxval_strlen): Move COND_EXPR handling under + GIMPLE_ASSIGN. + +2012-05-16 David S. Miller <davem@davemloft.net> + + * jump.c (delete_related_insns): If we remove a CALL, make sure + we delete it's NOTE_INSN_CALL_ARG_LOCATION note too. + +2012-05-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR tree-optimization/53217 + * tree-ssa-reassoc.c (bip_map): New static variable. + (possibly_move_powi): Move feeding multiplies with __builtin_powi call. + (attempt_builtin_powi): Save feeding multiplies on a stack. + (reassociate_bb): Create and destroy bip_map. + +2012-05-16 Olivier Hainque <hainque@adacore.com> + + * Makefile.in (install-no-fixedincludes): New target, former toplevel + gcc-no-fixedincludes. Stash "include-fixed" in addition to "include". + Add comments and improve stamp preservation across the whole sequence. + (stmp-int-hdrs): Use move-if-change + cp -p to setup fix_dir/limits.h. + +2012-05-16 Richard Guenther <rguenther@suse.de> + + * tree-inline.c (insert_init_stmt): Do not call + mark_symbols_for_renaming. + (setup_one_parameter): Avoid initializing unused parameters. + (declare_return_variable): Properly handle DECL_BY_REFERENCE + return vars in SSA form. + +2012-05-16 Richard Guenther <rguenther@suse.de> + + * tree-flow.h (get_virtual_var): Remove. + * tree-dfa.c (get_virtual_var): Likewise. + +2012-05-16 Richard Guenther <rguenther@suse.de> + + * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1): + Remove set-only bitmap of new names. + (slpeel_tree_peel_loop_to_edge): Likewise. Do not set + CFG hooks. + * tree-flow.h (ssa_names_to_replace): Remove. + * tree-into-ssa.c (ssa_names_to_replace): Likewise. + +2012-05-16 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/53364 + * tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Properly + detect a view-conversion of the decl. + +2012-05-16 Dodji Seketeli <dodji@redhat.com> + + PR preprocessor/7263 + * c-tree.h (enum c_declspec_word): Declare new enum. + (struct c_declspecs::locations): New member. + (declspecs_add_qual, declspecs_add_scspec) + (declspecs_add_addrspace, declspecs_add_alignas): Take a new + location parameter. + * c-decl.c (build_null_declspecs): Initialize the new struct + c_declspecs::locations member. + (declspecs_add_addrspace): Take a location parameter for the + address space. Store it onto declaration specifiers. + (declspecs_add_qual): Likewise, take a location parameter for the + qualifier. + (declspecs_add_type): Likewise, take a location parameter for the + type specifier. + (declspecs_add_scspec): Likewise, take a location parameter for + the storage class specifier. + (declspecs_add_attrs): Likewise, take a location parameter for the + first attribute. + (declspecs_add_alignas): Likewise, take a location parameter for + the alignas token. + (finish_declspecs): For diagnostics, use the location of the + relevant declspec, instead of the global input_location. + * c-parser.c (c_parser_parameter_declaration): Pass the precise + virtual location of the declspec to the declspecs-setters. + (c_parser_declspecs): Likewise. Avoid calling c_parser_peek_token + repeatedly. + +2012-05-16 Igor Zamyatin <igor.zamyatin@intel.com> + + * configure.ac: Stack protector enabling for Android targets. + * configure: Regenerate. + +2012-05-16 Richard Sandiford <r.sandiford@uk.ibm.com> + + * ira.c (pseudo_move_insn): Delete. + (find_moveable_pseudos): Don't set it. + (move_unallocated_pseudos): Use DF_REG_DEF_CHAIN to find + the definitions of the original pseudo. Delete all of them. + +2012-05-16 Olivier Hainque <hainque@adacore.com> + + * config/rs6000/rs6000-opts.h (enum processor_type): Add + PROCESSOR_PPC8548. + * config/rs6000/rs6000-cpus.def: Reference it for cpu="8548". + * config/rs6000/rs6000.md (cpu attribute definition): Add ppc8548. + * config/rs6000/8540.md: indicate that the units/patterns apply to + ppc8548 as well. + + * config/rs6000/rs6000.c (rs6000_option_override_internal): Rename + default_cpu into implicit_cpu, conveying what --with-cpu was passed at + configure time. Treat implicit_cpu as have_CPU. Pick defaults for SPE + related flags, check that what is queried is supported by the selected + configuration. Rework the single/double_float and MASK_STRING resets to + hit for all the E500 cores (854x + E500MC variants). Select the ppc8540 + costs for PROCESSOR_PPC8548 as well. + (rs6000_issue_rate): case CPU_PPC8548 together with CPU_PPC8540. + (rs6000_use_sched_lookahead): Likewise, rewriting function as a case + statement instead of a sequence of ifs. + + * config/rs6000/rs6000.h (TARGET_E500): Remove. + (TARGET_NO_LWSYNC): Adjust accordingly. + * config/rs6000/e500.h (TARGET_E500): Remove. + (CHECK_E500_OPTIONS): Adjust accordingly. + * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Remove. + (TARGET_DEFAULT): Reformat definition to match the one in linuxspe.h. + * config/rs6000/linuxspe.h: Likewise. + * config/rs6000/vxworks.h: Remove bogus TARGET_E500 overrides and + superfluous comments. + * config/rs6000/e500-double.h: Remove. + + * config.gcc (pick a default with_cpu): For powerpc*-*-*spe*, + default to with_cpu=8548 if --enable-e500-double, and to 8540 + otherwise. + (set misc flags section): For powerpc*|rs6000*, remove inclusion + of e500-double.h for --enable-e500-double. + +2012-05-16 Olivier Hainque <hainque@adacore.com> + + * Makefile.in (s-header-vars): Resort to -n instead of trailing + -e d in sed invocation. + +2012-05-16 Hans-Peter Nilsson <hp@axis.com> + + * doc/tm.texi.in (Type Layout) <SIZE_TYPE>: Update reference to + source-code. + * doc/tm.texi: Regenerate. + +2012-05-15 Paolo Carlini <paolo.carlini@oracle.com> + + * tree.h (EXPR_LOCATION): Use CAN_HAVE_LOCATION_P. + +2012-05-15 Jakub Jelinek <jakub@redhat.com> + + PR target/53358 + * config/i386/i386.md (*addqi_2 peephole with QImode addition): Check + that operands[2] is either immediate, or q_regs_operand. + +2012-05-15 Richard Guenther <rguenther@suse.de> + + * cgraphunit.c (thunk_adjust): Use make_rename_temp. + (assemble_thunk): Likewise. Manually rename and register + function arguments. + +2012-05-15 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/53355 + * tree-vrp.c (extract_range_from_binary_expr_1): Handle LSHIFT_EXPRs + by constants. + 2012-05-15 Tristan Gingold <gingold@adacore.com> * tree-ssa-strlen.c (get_string_length): Convert lhs if needed. diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index a1ede540d11..794415bdc5a 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20120515 +20120521 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 1e577409c72..001ece9397b 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1103,7 +1103,7 @@ FLAGS_TO_PASS = \ "build_tooldir=$(build_tooldir)" \ "gcc_tooldir=$(gcc_tooldir)" \ "bindir=$(bindir)" \ - "libexecsubdir=$(libsubdir)" \ + "libexecsubdir=$(libexecsubdir)" \ "datarootdir=$(datarootdir)" \ "datadir=$(datadir)" \ "localedir=$(localedir)" @@ -4171,10 +4171,16 @@ gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS) # Build the include directories. stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) fixinc_list # Copy in the headers provided with gcc. +# # The sed command gets just the last file name component; # this is necessary because VPATH could add a dirname. # Using basename would be simpler, but some systems don't have it. +# # The touch command is here to workaround an AIX/Linux NFS bug. +# +# The move-if-change + cp -p twists for limits.h are intended to preserve +# the time stamp when we regenerate, to prevent pointless rebuilds during +# e.g. install-no-fixedincludes. -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi -if [ -d include-fixed ] ; then true; else mkdir include-fixed; chmod a+rx include-fixed; fi for file in .. $(USER_H); do \ @@ -4223,8 +4229,10 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) fixinc_list fi; \ $(mkinstalldirs) $${fix_dir}; \ chmod a+rx $${fix_dir} || true; \ + $(SHELL) $(srcdir)/../move-if-change \ + tmp-xlimits.h tmp-limits.h; \ rm -f $${fix_dir}/limits.h; \ - mv tmp-xlimits.h $${fix_dir}/limits.h; \ + cp -p tmp-limits.h $${fix_dir}/limits.h; \ chmod a+r $${fix_dir}/limits.h; \ done # Install the README @@ -4326,6 +4334,42 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \ fi $(STAMP) stmp-fixinc # + +# Install with the gcc headers files, not the fixed include files, which we +# are typically not allowed to distribute. The general idea is to: +# - Get to "install" with a bare set of internal headers, not the +# fixed system ones, +# - Prevent rebuilds of what normally depends on the headers, which is +# useless for installation purposes and would rely on improper headers. +# - Restore as much of the original state as possible. + +.PHONY: install-no-fixedincludes + +install-no-fixedincludes: + # Stash the current set of headers away, save stamps we're going to + # alter explicitly, and arrange for fixincludes not to run next time + # we trigger a headers rebuild. + -rm -rf tmp-include + -mv include tmp-include 2>/dev/null + -mv include-fixed tmp-include-fixed 2>/dev/null + -mv stmp-int-hdrs tmp-stmp-int-hdrs 2>/dev/null + -mv stmp-fixinc tmp-stmp-fixinc 2>/dev/null + -mkdir include + -cp -p $(srcdir)/gsyslimits.h include/syslimits.h + -touch stmp-fixinc + + # Rebuild our internal headers, restore the original stamps so that + # "install" doesn't trigger pointless rebuilds because of that update, + # then do install + $(MAKE) $(FLAGS_TO_PASS) stmp-int-hdrs + -mv tmp-stmp-int-hdrs stmp-int-hdrs 2>/dev/null + -mv tmp-stmp-fixinc stmp-fixinc 2>/dev/null + $(MAKE) $(FLAGS_TO_PASS) install + + # Restore the original set of maybe-fixed headers + -rm -rf include; mv tmp-include include 2>/dev/null + -rm -rf include-fixed; mv tmp-include-fixed include-fixed 2>/dev/null + # Remake the info files. doc: $(BUILD_INFO) $(GENERATED_MANPAGES) @@ -4683,7 +4727,12 @@ MELT_PLUGIN_HEADERS= melt-runtime.h melt-run.h melt-predef.h melt-run-md5.h \ # generate the 'build fragment' b-header-vars s-header-vars: Makefile rm -f tmp-header-vars - $(foreach header_var,$(shell sed < Makefile -e 's/^\([A-Z0-9_]*_H\)[ ]*=.*/\1/p' -e d),echo $(header_var)=$(shell echo $($(header_var):$(srcdir)/%=.../%) | sed -e 's~\.\.\./config/~config/~' -e 's~\.\.\..*/~~') >> tmp-header-vars;) \ +# The first sed gets the list "header variables" as the list variables +# assigned in Makefile and having _H at the end of the name. "sed -n" proved +# more portable than a trailing "-e d" to filter out the uninteresting lines, +# in particular on ia64-hpux where "s/.../p" only prints if -n was requested +# as well. + $(foreach header_var,$(shell sed < Makefile -n -e 's/^\([A-Z0-9_]*_H\)[ ]*=.*/\1/p'),echo $(header_var)=$(shell echo $($(header_var):$(srcdir)/%=.../%) | sed -e 's~\.\.\./config/~config/~' -e 's~\.\.\..*/~~') >> tmp-header-vars;) \ $(SHELL) $(srcdir)/../move-if-change tmp-header-vars b-header-vars $(STAMP) s-header-vars diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index cc02ee54b4f..bf8cf64cb62 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 34ab93d74ba..744f6eb89b9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,176 @@ +2012-05-20 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/utils.c (gnat_write_global_declarations): Put a name + on the dummy global variable. + +2012-05-19 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c (Has_Thiscall_Convention): New macro. + (gnat_to_gnu_entity) <E_Subprogram_Type>: Test it to set the thiscall + calling convention + (get_minimal_subprog_decl): Likewise. + (gnat_first_param_is_class): New predicate. + + * gcc-interface/misc.c (gnat_handle_option): Fix formatting. + * gcc-interface/Makefile.in: Likewise. + +2012-05-18 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: For an object at + global level with unconstrained nominal subtype and a non-fixed size, + make a variable for the size. + +2012-05-15 Andris Pavenis <andris.pavenis@iki.fi> + + PR ada/52494 + * s-taprop-dummy.adb (Specific): New package. + +2012-05-15 Olivier Hainque <hainque@adacore.com> + + * gcc-interface/Make-lang.in (COMMON_FLAGS_TO_PASS): Use WARN_CFLAGS + instead of trying to mimic it. + +2012-05-15 Robert Dewar <dewar@adacore.com> + + * sem_ch5.adb, sem_util.adb, s-stposu.adb, exp_ch4.adb: Minor + reformatting. + +2012-05-15 Geert Bosch <bosch@adacore.com> + + * uintp.adb (UI_Rem): Remove optimizations, as they are complex and are + not needed. + (Sum_Digits): Remove, no longer used. + (Sum_Double_Digits): Likewise. + +2012-05-15 Yannick Moy <moy@adacore.com> + + * aspects.ads: Minor typo. + +2012-05-15 Thomas Quinot <quinot@adacore.com> + + * gnat_rm.texi (Scalar_Storage_Order): Fix RM reference. + * sem_ch13.adb: Minor comment fix: incorrect RM reference. + +2012-05-15 Eric Botcazou <ebotcazou@adacore.com> + + * sem_prag.adb (Process_Atomic_Shared_Volatile): Propagate + atomicity from an object to its underlying type only if it + is composite. + +2012-05-15 Ed Schonberg <schonberg@adacore.com> + + * sem_ch5.adb (Analyze_Iterator_Specification): Set kind of + loop variable after pre-analysis of iterator name, to prevent + premature usage of loop variable. + +2012-05-15 Ed Schonberg <schonberg@adacore.com> + + * sem_util.adb (Is_Variable): In Ada 2012, an explicit + dereference that is a rewriting of an expression whose type has + a declared Implicit_Derenference aspect is a variable. + +2012-05-15 Hristian Kirtchev <kirtchev@adacore.com> + + * exp_ch4.adb (Insert_Dereference_Action): Reimplemented. The + routine performs address and size adjustments for dereferences + of heap-allocated controlled objects. This manipulation is needed + in order to restore the original state of the memory at the time + it was allocated by the finalization machinery. + * rtsfind.ads: Add RE_Adjust_Controlled_Dereference to tables + RE_Id and RE_Unit_Table. + * sinfo.adb (Has_Dereference_Action): New routine. + (Set_Has_Dereference_Action): New routine. + * sinfo.ads: Add new semantic flag Has_Dereference_Action along + its association in nodes. + (Has_Dereference_Action): New routine and pragma Inline. + (Set_Has_Dereference_Action): New routine and pragma Inline. + * s-stposu.ads, s-stposu.adb (Adjust_Controlled_Dereference): New + routine. + +2012-05-15 Thomas Quinot <quinot@adacore.com> + + * uintp.adb (Image_Uint): Use UI_Div_Rem to get quotient and + remainder of U / Base in a single operation. + +2012-05-15 Robert Dewar <dewar@adacore.com> + + * exp_ch5.adb, inline.adb, sem_ch10.adb, prj.ads, sem_util.adb, + a-ngelfu.ads, exp_ch4.adb, exp_ch6.adb, aspects.ads, sem_ch6.adb, + vms_data.ads, exp_ch3.adb, prj-env.adb: Minor reformatting. + +2012-05-15 Thomas Quinot <quinot@adacore.com> + + * exp_ch4.adb (Has_Inferable_Discriminants): For a qualified + expression, use correct node for test on the subtype denoted by + the subtype mark. + +2012-05-15 Eric Botcazou <ebotcazou@adacore.com> + + * inline.adb (Scope_In_Main_Unit): Rename into... + (In_Main_Unit_Or_Subunit): ...this. Also return + true if the subprogram is within a subunit of the + main unit. + (Add_Inlined_Body): Adjust for above renaming. + (Add_Inlined_Subprogram): Likewise. Pass the subprogram directly. + (Analyze_Inlined_Bodies): Really set aside inlined subprograms + not handled by Add_Inlined_Body. + +2012-05-15 Ed Schonberg <schonberg@adacore.com> + + * sem_ch10.adb (Expand_With_Clause): In the context of a generic + package declaration, a private with-clause on a child unit implies + that the implicit with clauses on its parents are private as well. + +2012-05-15 Javier Miranda <miranda@adacore.com> + + * sem_ch6.adb (Is_Interface_Conformant): Add missing call to + Base_Type to handle subtypes. + * exp_ch6.adb (Expand_Call): For calls located in thunks handle + unchecked conversions of access types found in actuals. + * exp_disp.adb (Expand_Interface_Thunk): Add missing unchecked + conversion to actuals whose type is an access type. Done to + avoid reporting spurious errors. + +2012-05-15 Vincent Celier <celier@adacore.com> + + * prj-env.adb (Create_Mapping): Ignore sources that are + suppressed (Create_Mapping_File.Process): Ditto + * prj-nmsc.adb (Add_Source): Update to take into + account suppressed files that may hide inherited sources. + (Mark_Excluded_Sources): Mark excluded sources of the current + project as suppressed. + * prj.ads (Source_Data): New Boolean component Suppressed, + defaulted to False + +2012-05-15 Thomas Quinot <quinot@adacore.com> + + * exp_intr.adb: Minor reformatting. + +2012-05-15 Thomas Quinot <quinot@adacore.com> + + * gnat_rm.texi: Document attribute Scalar_Storage_Order. + +2012-05-15 Javier Miranda <miranda@adacore.com> + + * exp_ch3.adb (Build_Offset_To_Top): Modify the + expansion of the offset_to_top functions to ensure that their + profile is conformant with the profile specified in Ada.Tags. No + change in functionality. + +2012-05-15 Eric Botcazou <ebotcazou@adacore.com> + + * inline.adb (Subp_Info): Remove Count and Next_Nopred + components, add Processed component and move around Next component. + (Add_Call): Reverse meaning of Successors table to the natural one. + (Add_Inlined_Body): Do not inline a package if it is in the main unit. + (Add_Inlined_Subprogram): Do not add the subprogram to the list if the + package is in the main unit. Do not recurse on the successors. + (Add_Subp): Adjust to new contents of Subp_Info. + (Analyze_Inlined_Bodies): Do not attempt + to compute a topological order on the list of inlined subprograms, + but compute the transitive closure from the main unit instead. + (Get_Code_Unit_Entity): Always return the spec for a package. + 2012-05-15 Yannick Moy <moy@adacore.com> * aspects.ads: Minor addition of comments to provide info on diff --git a/gcc/ada/a-ngelfu.ads b/gcc/ada/a-ngelfu.ads index 03aed54b966..9f7d3a3a168 100644 --- a/gcc/ada/a-ngelfu.ads +++ b/gcc/ada/a-ngelfu.ads @@ -11,10 +11,6 @@ -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the Post aspects that have been added to the spec. -- --- Except for these parts of the document, in accordance with the copyright -- --- of that document, you can freely copy and modify this specification, -- --- provided that if you redistribute a modified version, any changes that -- --- you have made are clearly indicated. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index bc5b9c6956c..b21b1e23973 100644 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -34,30 +34,35 @@ -- aspect specifications from the tree. The semantic processing for aspect -- specifications is found in Sem_Ch13.Analyze_Aspect_Specifications. +------------------------ +-- Adding New Aspects -- +------------------------ + -- In general, each aspect should have a corresponding pragma, so that the -- newly developed functionality is available for Ada versions < Ada 2012. -- When both are defined, it is convenient to first transform the aspect into -- an equivalent pragma in Sem_Ch13.Analyze_Aspect_Specifications, and then -- analyze the pragma in Sem_Prag.Analyze_Pragma. --- To add a new aspect: --- * create a name in snames.ads-tmpl --- * create a value in type Aspect_Id in this unit --- * add a value for the aspect in the global arrays defined in this unit --- * add code for analyzing the aspect in --- Sem_Ch13.Analyze_Aspect_Specifications. This may involve adding some --- nodes to the tree to perform additional treatments later. --- * if the semantic analysis of expressions/names in the aspect should not --- occur at the point the aspect is defined, add code in the adequate --- semantic analysis procedure for the aspect. For example, this is the case --- for aspects Pre and Post on subprograms, which are pre-analyzed at the --- end of the list of declarations to which the subprogram belongs, and --- fully analyzed (possibly with expansion) during the semantic analysis of --- subprogram bodies. - --- Additionally, to add a corresponding pragma for a new aspect: --- * create a name for the pragma in snames.ads-tmpl --- * add code for analyzing the pragma in Sem_Prag.Analyze_Pragma +-- To add a new aspect, you need to do the following + +-- 1. Create a name in snames.ads-tmpl + +-- 2. Create a value in type Aspect_Id in this unit + +-- 3. Add a value for the aspect in the global arrays defined in this unit + +-- 4. Add code for the aspect in Sem_Ch13.Analyze_Aspect_Specifications. +-- This may involve adding some nodes to the tree to perform additional +-- treatments later. + +-- 5. If the semantic analysis of expressions/names in the aspect should not +-- occur at the point the aspect is defined, add code in the adequate +-- semantic analysis procedure for the aspect. For example, this is the +-- case for aspects Pre and Post on subprograms, which are pre-analyzed +-- at the end of the declaration list to which the subprogram belongs, +-- and fully analyzed (possibly with expansion) during the semantic +-- analysis of subprogram bodies. with Namet; use Namet; with Snames; use Snames; diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 9f6e5653911..8240ed4d9a2 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -1883,9 +1883,10 @@ package body Exp_Ch3 is procedure Build_Offset_To_Top_Function (Iface_Comp : Entity_Id); -- Generate: - -- function Fxx (O : in Rec_Typ) return Storage_Offset is + -- function Fxx (O : Address) return Storage_Offset is + -- type Acc is access all <Typ>; -- begin - -- return O.Iface_Comp'Position; + -- return Acc!(O).Iface_Comp'Position; -- end Fxx; ---------------------------------- @@ -1896,6 +1897,7 @@ package body Exp_Ch3 is Body_Node : Node_Id; Func_Id : Entity_Id; Spec_Node : Node_Id; + Acc_Type : Entity_Id; begin Func_Id := Make_Temporary (Loc, 'F'); @@ -1912,7 +1914,7 @@ package body Exp_Ch3 is Make_Defining_Identifier (Loc, Name_uO), In_Present => True, Parameter_Type => - New_Reference_To (Rec_Type, Loc)))); + New_Reference_To (RTE (RE_Address), Loc)))); Set_Result_Definition (Spec_Node, New_Reference_To (RTE (RE_Storage_Offset), Loc)); @@ -1924,7 +1926,19 @@ package body Exp_Ch3 is Body_Node := New_Node (N_Subprogram_Body, Loc); Set_Specification (Body_Node, Spec_Node); - Set_Declarations (Body_Node, New_List); + + Acc_Type := Make_Temporary (Loc, 'T'); + Set_Declarations (Body_Node, New_List ( + Make_Full_Type_Declaration (Loc, + Defining_Identifier => Acc_Type, + Type_Definition => + Make_Access_To_Object_Definition (Loc, + All_Present => True, + Null_Exclusion_Present => False, + Constant_Present => False, + Subtype_Indication => + New_Reference_To (Rec_Type, Loc))))); + Set_Handled_Statement_Sequence (Body_Node, Make_Handled_Sequence_Of_Statements (Loc, Statements => New_List ( @@ -1933,7 +1947,9 @@ package body Exp_Ch3 is Make_Attribute_Reference (Loc, Prefix => Make_Selected_Component (Loc, - Prefix => Make_Identifier (Loc, Name_uO), + Prefix => + Unchecked_Convert_To (Acc_Type, + Make_Identifier (Loc, Name_uO)), Selector_Name => New_Reference_To (Iface_Comp, Loc)), Attribute_Name => Name_Position))))); diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 03ab119823b..28d89e37df1 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -10105,10 +10105,8 @@ package body Exp_Ch4 is -- mark is a constrained Unchecked_Union subtype. elsif Nkind (N) = N_Qualified_Expression then - return Is_Unchecked_Union (Subtype_Mark (N)) - and then - Is_Constrained (Subtype_Mark (N)); - + return Is_Unchecked_Union (Etype (Subtype_Mark (N))) + and then Is_Constrained (Etype (Subtype_Mark (N))); end if; return False; @@ -10119,10 +10117,6 @@ package body Exp_Ch4 is ------------------------------- procedure Insert_Dereference_Action (N : Node_Id) is - Loc : constant Source_Ptr := Sloc (N); - Typ : constant Entity_Id := Etype (N); - Pool : constant Entity_Id := Associated_Storage_Pool (Typ); - Pnod : constant Node_Id := Parent (N); function Is_Checked_Storage_Pool (P : Entity_Id) return Boolean; -- Return true if type of P is derived from Checked_Pool; @@ -10151,57 +10145,176 @@ package body Exp_Ch4 is return False; end Is_Checked_Storage_Pool; + -- Local variables + + Typ : constant Entity_Id := Etype (N); + Desig : constant Entity_Id := Available_View (Designated_Type (Typ)); + Loc : constant Source_Ptr := Sloc (N); + Pool : constant Entity_Id := Associated_Storage_Pool (Typ); + Pnod : constant Node_Id := Parent (N); + + Addr : Entity_Id; + Alig : Entity_Id; + Deref : Node_Id; + Size : Entity_Id; + Stmt : Node_Id; + -- Start of processing for Insert_Dereference_Action begin pragma Assert (Nkind (Pnod) = N_Explicit_Dereference); - if not (Is_Checked_Storage_Pool (Pool) - and then Comes_From_Source (Original_Node (Pnod))) - then + -- Do not re-expand a dereference which has already been processed by + -- this routine. + + if Has_Dereference_Action (Pnod) then + return; + + -- Do not perform this type of expansion for internally-generated + -- dereferences. + + elsif not Comes_From_Source (Original_Node (Pnod)) then + return; + + -- A dereference action is only applicable to objects which have been + -- allocated on a checked pool. + + elsif not Is_Checked_Storage_Pool (Pool) then return; end if; + -- Extract the address of the dereferenced object. Generate: + + -- Addr : System.Address := <N>'Pool_Address; + + Addr := Make_Temporary (Loc, 'P'); + Insert_Action (N, - Make_Procedure_Call_Statement (Loc, - Name => New_Reference_To ( - Find_Prim_Op (Etype (Pool), Name_Dereference), Loc), + Make_Object_Declaration (Loc, + Defining_Identifier => Addr, + Object_Definition => + New_Reference_To (RTE (RE_Address), Loc), + Expression => + Make_Attribute_Reference (Loc, + Prefix => Duplicate_Subexpr_Move_Checks (N), + Attribute_Name => Name_Pool_Address))); - Parameter_Associations => New_List ( + -- Calculate the size of the dereferenced object. Generate: - -- Pool + -- Size : Storage_Count := <N>.all'Size / Storage_Unit; - New_Reference_To (Pool, Loc), + Deref := + Make_Explicit_Dereference (Loc, + Prefix => Duplicate_Subexpr_Move_Checks (N)); + Set_Has_Dereference_Action (Deref); - -- Storage_Address. We use the attribute Pool_Address, which uses - -- the pointer itself to find the address of the object, and which - -- handles unconstrained arrays properly by computing the address - -- of the template. i.e. the correct address of the corresponding - -- allocation. + Size := Make_Temporary (Loc, 'S'); - Make_Attribute_Reference (Loc, - Prefix => Duplicate_Subexpr_Move_Checks (N), - Attribute_Name => Name_Pool_Address), + Insert_Action (N, + Make_Object_Declaration (Loc, + Defining_Identifier => Size, - -- Size_In_Storage_Elements + Object_Definition => + New_Reference_To (RTE (RE_Storage_Count), Loc), - Make_Op_Divide (Loc, - Left_Opnd => + Expression => + Make_Op_Divide (Loc, + Left_Opnd => Make_Attribute_Reference (Loc, - Prefix => - Make_Explicit_Dereference (Loc, - Duplicate_Subexpr_Move_Checks (N)), + Prefix => Deref, Attribute_Name => Name_Size), Right_Opnd => - Make_Integer_Literal (Loc, System_Storage_Unit)), + Make_Integer_Literal (Loc, System_Storage_Unit)))); - -- Alignment + -- Calculate the alignment of the dereferenced object. Generate: + -- Alig : constant Storage_Count := <N>.all'Alignment; - Make_Attribute_Reference (Loc, - Prefix => - Make_Explicit_Dereference (Loc, - Duplicate_Subexpr_Move_Checks (N)), - Attribute_Name => Name_Alignment)))); + Deref := + Make_Explicit_Dereference (Loc, + Prefix => Duplicate_Subexpr_Move_Checks (N)); + Set_Has_Dereference_Action (Deref); + + Alig := Make_Temporary (Loc, 'A'); + + Insert_Action (N, + Make_Object_Declaration (Loc, + Defining_Identifier => Alig, + Object_Definition => + New_Reference_To (RTE (RE_Storage_Count), Loc), + Expression => + Make_Attribute_Reference (Loc, + Prefix => Deref, + Attribute_Name => Name_Alignment))); + + -- A dereference of a controlled object requires special processing. The + -- finalization machinery requests additional space from the underlying + -- pool to allocate and hide two pointers. As a result, a checked pool + -- may mark the wrong memory as valid. Since checked pools do not have + -- knowledge of hidden pointers, we have to bring the two pointers back + -- in view in order to restore the original state of the object. + + if Needs_Finalization (Desig) then + + -- Adjust the address and size of the dereferenced object. Generate: + -- Adjust_Controlled_Dereference (Addr, Size, Alig); + + Stmt := + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To (RTE (RE_Adjust_Controlled_Dereference), Loc), + Parameter_Associations => New_List ( + New_Reference_To (Addr, Loc), + New_Reference_To (Size, Loc), + New_Reference_To (Alig, Loc))); + + -- Class-wide types complicate things because we cannot determine + -- statically whether the actual object is truly controlled. We must + -- generate a runtime check to detect this property. Generate: + -- + -- if Needs_Finalization (<N>.all'Tag) then + -- <Stmt>; + -- end if; + + if Is_Class_Wide_Type (Desig) then + Deref := + Make_Explicit_Dereference (Loc, + Prefix => Duplicate_Subexpr_Move_Checks (N)); + Set_Has_Dereference_Action (Deref); + + Stmt := + Make_If_Statement (Loc, + Condition => + Make_Function_Call (Loc, + Name => + New_Reference_To (RTE (RE_Needs_Finalization), Loc), + Parameter_Associations => New_List ( + Make_Attribute_Reference (Loc, + Prefix => Deref, + Attribute_Name => Name_Tag))), + Then_Statements => New_List (Stmt)); + end if; + + Insert_Action (N, Stmt); + end if; + + -- Generate: + -- Dereference (Pool, Addr, Size, Alig); + + Insert_Action (N, + Make_Procedure_Call_Statement (Loc, + Name => + New_Reference_To + (Find_Prim_Op (Etype (Pool), Name_Dereference), Loc), + Parameter_Associations => New_List ( + New_Reference_To (Pool, Loc), + New_Reference_To (Addr, Loc), + New_Reference_To (Size, Loc), + New_Reference_To (Alig, Loc)))); + + -- Mark the explicit dereference as processed to avoid potential + -- infinite expansion. + + Set_Has_Dereference_Action (Pnod); exception when RE_Not_Available => diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 0acb74bced9..a9f6ce46e5e 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -344,14 +344,12 @@ package body Exp_Ch5 is elsif Has_Controlled_Component (L_Type) then Loop_Required := True; - -- If changing scalar storage order and assigning a bit packed arrau, + -- If changing scalar storage order and assigning a bit packed array, -- force loop expansion. elsif Is_Bit_Packed_Array (L_Type) - and then - (In_Reverse_Storage_Order_Record (Rhs) - /= - In_Reverse_Storage_Order_Record (Lhs)) + and then (In_Reverse_Storage_Order_Record (Rhs) /= + In_Reverse_Storage_Order_Record (Lhs)) then Loop_Required := True; diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 7b6b296456c..3cbb790ec2d 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -2711,6 +2711,14 @@ package body Exp_Ch6 is Next_Entity (Parm_Ent); end loop; + -- Handle unchecked conversion of access types generated + -- in thunks (cf. Expand_Interface_Thunk). + + elsif Is_Access_Type (Etype (Actual)) + and then Nkind (Actual) = N_Unchecked_Type_Conversion + then + Parm_Ent := Entity (Expression (Actual)); + else pragma Assert (Is_Entity_Name (Actual)); Parm_Ent := Entity (Actual); end if; diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index e065538c72b..fd175bd02c3 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -1829,6 +1829,14 @@ package body Exp_Disp is Make_Explicit_Dereference (Loc, New_Reference_To (Defining_Identifier (Decl_2), Loc)))); + -- Ensure proper matching of access types. Required to avoid + -- reporting spurious errors. + + elsif Is_Access_Type (Etype (Target_Formal)) then + Append_To (Actuals, + Unchecked_Convert_To (Base_Type (Etype (Target_Formal)), + New_Reference_To (Defining_Identifier (Formal), Loc))); + -- No special management required for this actual else diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb index 50f404e6bc8..6617cc0066d 100644 --- a/gcc/ada/exp_intr.adb +++ b/gcc/ada/exp_intr.adb @@ -564,16 +564,15 @@ package body Exp_Intr is -- conventions and this has already been checked. elsif Present (Alias (E)) then - Expand_Intrinsic_Call (N, Alias (E)); + Expand_Intrinsic_Call (N, Alias (E)); elsif Nkind (N) in N_Binary_Op then Expand_Binary_Operator_Call (N); - -- The only other case is where an external name was specified, - -- since this is the only way that an otherwise unrecognized - -- name could escape the checking in Sem_Prag. Nothing needs - -- to be done in such a case, since we pass such a call to the - -- back end unchanged. + -- The only other case is where an external name was specified, since + -- this is the only way that an otherwise unrecognized name could + -- escape the checking in Sem_Prag. Nothing needs to be done in such + -- a case, since we pass such a call to the back end unchanged. else null; diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index b9b8cd70da1..73a307e1c49 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -68,7 +68,7 @@ ADA_RTL_OBJ_DIR = $(libsubdir)/adalib THREAD_KIND=native TRACE=no # We do not want the WARN_CFLAGS of the compiler in Ada as it is for C/C++. -COMMON_FLAGS_TO_PASS = $(filter-out -pedantic -W%, $(FLAGS_TO_PASS)) +COMMON_FLAGS_TO_PASS = $(filter-out $(WARN_CFLAGS), $(FLAGS_TO_PASS)) ADA_FLAGS_TO_PASS = \ "ADA_FOR_BUILD=$(ADA_FOR_BUILD)" \ "ADA_INCLUDE_DIR=$(ADA_INCLUDE_DIR)" \ diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index c1d9284496c..21c247149c2 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -2148,7 +2148,7 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),) s-taprop.adb<s-taprop-posix.adb \ s-taspri.ads<s-taspri-posix.ads \ s-tpopsp.adb<s-tpopsp-posix-foreign.adb - + ifeq ($(strip $(filter-out %86,$(arch))),) LIBGNAT_TARGET_PAIRS += \ s-intman.adb<s-intman-susv3.adb \ @@ -2195,7 +2195,7 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),) s-osprim.adb<s-osprim-posix.adb \ a-numaux.ads<a-numaux-darwin.ads \ a-numaux.adb<a-numaux-darwin.adb - + ifeq ($(strip $(MULTISUBDIR)),/ppc64) LIBGNAT_TARGET_PAIRS += \ system.ads<system-darwin-ppc64.ads diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 97ade5e6159..05c9b1a26f5 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -50,19 +50,23 @@ #include "ada-tree.h" #include "gigi.h" -/* Convention_Stdcall should be processed in a specific way on 32 bits - Windows targets only. The macro below is a helper to avoid having to - check for a Windows specific attribute throughout this unit. */ +/* "stdcall" and "thiscall" conventions should be processed in a specific way + on 32-bit x86/Windows only. The macros below are helpers to avoid having + to check for a Windows specific attribute throughout this unit. */ #if TARGET_DLLIMPORT_DECL_ATTRIBUTES #ifdef TARGET_64BIT #define Has_Stdcall_Convention(E) \ (!TARGET_64BIT && Convention (E) == Convention_Stdcall) +#define Has_Thiscall_Convention(E) \ + (!TARGET_64BIT && gnat_first_param_is_class (E)) #else #define Has_Stdcall_Convention(E) (Convention (E) == Convention_Stdcall) +#define Has_Thiscall_Convention(E) (gnat_first_param_is_class (E)) #endif #else #define Has_Stdcall_Convention(E) 0 +#define Has_Thiscall_Convention(E) 0 #endif /* Stack realignment is necessary for functions with foreign conventions when @@ -126,6 +130,7 @@ DEF_VEC_ALLOC_O(variant_desc,heap); static GTY ((if_marked ("tree_int_map_marked_p"), param_is (struct tree_int_map))) htab_t annotate_value_cache; +static bool gnat_first_param_is_class (Entity_Id) ATTRIBUTE_UNUSED; static bool allocatable_size_p (tree, bool); static void prepend_one_attribute_to (struct attrib **, enum attr_type, tree, tree, Node_Id); @@ -760,6 +765,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) gnu_size = max_size (TYPE_SIZE (gnu_type), true); mutable_p = true; } + + /* If we are at global level and the size isn't constant, call + elaborate_expression_1 to make a variable for it rather than + calculating it each time. */ + if (global_bindings_p () && !TREE_CONSTANT (gnu_size)) + gnu_size = elaborate_expression_1 (gnu_size, gnat_entity, + get_identifier ("SIZE"), + definition, false); } /* If the size is zero byte, make it one byte since some linkers have @@ -4395,6 +4408,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) (&attr_list, ATTR_MACHINE_ATTRIBUTE, get_identifier ("stdcall"), NULL_TREE, gnat_entity); + else if (Has_Thiscall_Convention (gnat_entity)) + prepend_one_attribute_to + (&attr_list, ATTR_MACHINE_ATTRIBUTE, + get_identifier ("thiscall"), NULL_TREE, + gnat_entity); /* If we should request stack realignment for a foreign convention subprogram, do so. Note that this applies to task entry points in @@ -5258,6 +5276,10 @@ get_minimal_subprog_decl (Entity_Id gnat_entity) prepend_one_attribute_to (&attr_list, ATTR_MACHINE_ATTRIBUTE, get_identifier ("stdcall"), NULL_TREE, gnat_entity); + else if (Has_Thiscall_Convention (gnat_entity)) + prepend_one_attribute_to (&attr_list, ATTR_MACHINE_ATTRIBUTE, + get_identifier ("thiscall"), NULL_TREE, + gnat_entity); if (No (Interface_Name (gnat_entity)) && gnu_ext_name == gnu_entity_name) gnu_ext_name = NULL_TREE; @@ -5267,6 +5289,63 @@ get_minimal_subprog_decl (Entity_Id gnat_entity) false, true, true, true, attr_list, gnat_entity); } +/* Return whether the E_Subprogram_Type/E_Function/E_Procedure GNAT_ENTITY has + a first parameter with a class or equivalent type. + + We use the predicate on 32-bit x86/Windows to find out whether we need to + use the "thiscall" calling convention for GNAT_ENTITY. This convention is + the one set for C++ methods (functions with METHOD_TYPE) by the back-end. + Now in Ada primitive operations are regular subprograms (e.g. you can have + common pointers to both) so we cannot compute an equivalent of METHOD_TYPE + and so we set the calling convention in an uniform way. */ + +static bool +gnat_first_param_is_class (Entity_Id gnat_entity) +{ + Entity_Id gnat_param = First_Formal_With_Extras (gnat_entity); + Entity_Id gnat_type; + Node_Id node; + + if (No (gnat_param)) + return false; + + gnat_type = Underlying_Type (Etype (gnat_param)); + + /* This is the main case. Note that we must return the same value for + regular tagged types and CW types since dispatching calls have a CW + type on the caller side and a tagged type on the callee side. */ + if (Is_Tagged_Type (gnat_type)) + return True; + + /* C++ classes with no virtual functions can be imported as limited + record types, but we need to return true for the constructors. */ + if (Is_CPP_Class (gnat_type)) + return True; + + /* The language-level "protected" calling convention doesn't distinguish + tagged protected types from non-tagged protected types (e.g. you can + have common pointers to both) so we must use a single low-level calling + convention for it. Since tagged protected types can be derived from + simple limited interfaces, we need to pick the calling convention of + the latters. */ + if (Is_Protected_Record_Type (gnat_type)) + return True; + + /* If this is the special E_Subprogram_Type built for the declaration of + an access to protected subprogram type, the first parameter will have + type Address, but we must return true to be consistent with above. */ + if (Is_Itype (gnat_entity) + && Present (node = Associated_Node_For_Itype (gnat_entity)) + && Nkind (node) == N_Full_Type_Declaration + && Ekind (Defining_Identifier (node)) == E_Access_Subprogram_Type + && Present (node = Original_Access_Type (Defining_Identifier (node))) + && (Ekind (node) == E_Access_Protected_Subprogram_Type + || Ekind (node) == E_Anonymous_Access_Protected_Subprogram_Type)) + return True; + + return False; +} + /* Finalize the processing of From_With_Type incomplete types. */ void diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index f2002f577ee..6d77dc804af 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -153,10 +153,10 @@ gnat_handle_option (size_t scode, const char *arg ATTRIBUTE_UNUSED, int value, gcc_unreachable (); } - Ada_handle_option_auto (&global_options, &global_options_set, - scode, arg, value, - gnat_option_lang_mask (), kind, - loc, handlers, global_dc); + Ada_handle_option_auto (&global_options, &global_options_set, + scode, arg, value, + gnat_option_lang_mask (), kind, + loc, handlers, global_dc); return true; } diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index ce480208f99..36012a6ed91 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -5586,8 +5586,12 @@ gnat_write_global_declarations (void) if (!VEC_empty (tree, types_used_by_cur_var_decl)) { struct varpool_node *node; + char *label; + + ASM_FORMAT_PRIVATE_NAME (label, first_global_object_name, 0); dummy_global - = build_decl (BUILTINS_LOCATION, VAR_DECL, NULL_TREE, void_type_node); + = build_decl (BUILTINS_LOCATION, VAR_DECL, get_identifier (label), + void_type_node); TREE_STATIC (dummy_global) = 1; TREE_ASM_WRITTEN (dummy_global) = 1; node = varpool_node (dummy_global); diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 88a30f9fe5d..dc09cc541e4 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -272,6 +272,7 @@ Implementation Defined Attributes * Result:: * Safe_Emax:: * Safe_Large:: +* Scalar_Storage_Order:: * Simple_Storage_Pool:: * Small:: * Storage_Unit:: @@ -6023,6 +6024,7 @@ consideration, you should minimize the use of these attributes. * Result:: * Safe_Emax:: * Safe_Large:: +* Scalar_Storage_Order:: * Simple_Storage_Pool:: * Small:: * Storage_Unit:: @@ -6750,6 +6752,54 @@ The @code{Safe_Large} attribute is provided for compatibility with Ada 83. See the Ada 83 reference manual for an exact description of the semantics of this attribute. +@node Scalar_Storage_Order +@unnumberedsec Scalar_Storage_Order +@cindex Endianness +@cindex Scalar storage order +@findex Scalar_Storage_Order +@noindent +For every record subtype @var{S}, the representation attribute +@code{Scalar_Storage_Order} denotes the order in which storage elements +that make up scalar components are ordered within S. Other properties are +as for standard representation attribute @code{Bit_Order}, as defined by +Ada RM 13.5.3(4). The default is @code{System.Default_Bit_Order}. + +If @code{@var{S}'Scalar_Storage_Order} is specified explicitly, it shall be +equal to @code{@var{S}'Bit_Order}. Note: This means that if a +@code{Scalar_Storage_Order} attribute definition clause is not confirming, +then the type's @code{Bit_Order} shall be specified explicitly and set to +the same value. + +A confirming @code{Scalar_Storage_Order} attribute definition clause (i.e. +with a value equal to @code{System.Default_Bit_Order}) has no effect. + +If the opposite storage order is specified, then whenever the +value of a scalar component of S is read, the storage elements of the +enclosing machine scalar are first reversed (before retrieving the +component value, possibly applying some shift and mask operatings on the +enclosing machine scalar), and the opposite operation is done for +writes. + +In that case, the restrictions set forth in 13.5.1(10.3/2) for scalar components +are relaxed. Instead, the following rules apply: + +@itemize @bullet +@item the underlying storage elements are those at positions + @code{(position + first_bit / storage_element_size) .. + (position + (last_bit + storage_element_size - 1) / + storage_element_size)} +@item the sequence of underlying storage elements shall have + a size no greater than the largest machine scalar +@item the enclosing machine scalar is defined as the smallest machine + scalar starting at a position no greater than + @code{position + first_bit / storage_element_size} and covering + storage elements at least up to @code{position + (last_bit + + storage_element_size - 1) / storage_element_size} +@item the position of the component is interpreted relative to that machine + scalar. + +@end itemize + @node Simple_Storage_Pool @unnumberedsec Simple_Storage_Pool @cindex Storage pool, simple @@ -15452,7 +15502,7 @@ sequences for various UCS input formats. @section @code{GNAT.Byte_Swapping} (@file{g-bytswa.ads}) @cindex @code{GNAT.Byte_Swapping} (@file{g-bytswa.ads}) @cindex Byte swapping -@cindex Endian +@cindex Endianness @noindent General routines for swapping the bytes in 2-, 4-, and 8-byte quantities. diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 473553584dd..2fa6054a89a 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -70,15 +70,12 @@ package body Inline is ----------------------- -- For each call to an inlined subprogram, we make entries in a table - -- that stores caller and callee, and indicates a prerequisite from + -- that stores caller and callee, and indicates the call direction from -- one to the other. We also record the compilation unit that contains -- the callee. After analyzing the bodies of all such compilation units, - -- we produce a list of subprograms in topological order, for use by the - -- back-end. If P2 is a prerequisite of P1, then P1 calls P2, and for - -- proper inlining the back-end must analyze the body of P2 before that of - -- P1. The code below guarantees that the transitive closure of inlined - -- subprograms called from the main compilation unit is made available to - -- the code generator. + -- we compute the transitive closure of inlined subprograms called from + -- the main compilation unit and make it available to the code generator + -- in no particular order, thus allowing cycles in the call graph. Last_Inlined : Entity_Id := Empty; @@ -117,12 +114,11 @@ package body Inline is type Subp_Info is record Name : Entity_Id := Empty; + Next : Subp_Index := No_Subp; First_Succ : Succ_Index := No_Succ; - Count : Integer := 0; Listed : Boolean := False; Main_Call : Boolean := False; - Next : Subp_Index := No_Subp; - Next_Nopred : Subp_Index := No_Subp; + Processed : Boolean := False; end record; package Inlined is new Table.Table ( @@ -139,10 +135,11 @@ package body Inline is function Get_Code_Unit_Entity (E : Entity_Id) return Entity_Id; pragma Inline (Get_Code_Unit_Entity); - -- Return the entity node for the unit containing E + -- Return the entity node for the unit containing E. Always return + -- the spec for a package. - function Scope_In_Main_Unit (Scop : Entity_Id) return Boolean; - -- Return True if Scop is in the main unit or its spec + function In_Main_Unit_Or_Subunit (E : Entity_Id) return Boolean; + -- Return True if E is in the main unit or its spec or in a subunit procedure Add_Call (Called : Entity_Id; Caller : Entity_Id := Empty); -- Make two entries in Inlined table, for an inlined subprogram being @@ -166,9 +163,7 @@ package body Inline is -- example, an initialization procedure). procedure Add_Inlined_Subprogram (Index : Subp_Index); - -- Add subprogram to Inlined List once all of its predecessors have been - -- placed on the list. Decrement the count of all its successors, and - -- add them to list (recursively) if count drops to zero. + -- Add the subprogram to the list of inlined subprogram for the unit ------------------------------ -- Deferred Cleanup Actions -- @@ -203,29 +198,26 @@ package body Inline is if Present (Caller) then P2 := Add_Subp (Caller); - -- Add P2 to the list of successors of P1, if not already there. + -- Add P1 to the list of successors of P2, if not already there. -- Note that P2 may contain more than one call to P1, and only -- one needs to be recorded. - J := Inlined.Table (P1).First_Succ; + J := Inlined.Table (P2).First_Succ; while J /= No_Succ loop - if Successors.Table (J).Subp = P2 then + if Successors.Table (J).Subp = P1 then return; end if; J := Successors.Table (J).Next; end loop; - -- On exit, make a successor entry for P2 + -- On exit, make a successor entry for P1 Successors.Increment_Last; - Successors.Table (Successors.Last).Subp := P2; + Successors.Table (Successors.Last).Subp := P1; Successors.Table (Successors.Last).Next := - Inlined.Table (P1).First_Succ; - Inlined.Table (P1).First_Succ := Successors.Last; - - Inlined.Table (P2).Count := Inlined.Table (P2).Count + 1; - + Inlined.Table (P2).First_Succ; + Inlined.Table (P2).First_Succ := Successors.Last; else Inlined.Table (P1).Main_Call := True; end if; @@ -345,9 +337,11 @@ package body Inline is -- or other internally generated subprogram, because in that -- case the subprogram body appears in the same unit that -- declares the type, and that body is visible to the back end. + -- Do not inline it either if it is in the main unit. elsif not Is_Inlined (Pack) and then Comes_From_Source (E) + and then not In_Main_Unit_Or_Subunit (Pack) then Set_Is_Inlined (Pack); Inlined_Bodies.Increment_Last; @@ -365,8 +359,6 @@ package body Inline is procedure Add_Inlined_Subprogram (Index : Subp_Index) is E : constant Entity_Id := Inlined.Table (Index).Name; Pack : constant Entity_Id := Get_Code_Unit_Entity (E); - Succ : Succ_Index; - Subp : Subp_Index; function Back_End_Cannot_Inline (Subp : Entity_Id) return Boolean; -- There are various conditions under which back-end inlining cannot @@ -441,7 +433,7 @@ package body Inline is and then (Is_Inlined (Pack) or else Is_Generic_Instance (Pack) or else Is_Internal (E)) - and then not Scope_In_Main_Unit (E) + and then not In_Main_Unit_Or_Subunit (E) and then not Is_Nested (E) and then not Has_Initialized_Type (E) then @@ -460,27 +452,6 @@ package body Inline is end if; Inlined.Table (Index).Listed := True; - - -- Now add to the list those callers of the current subprogram that - -- are themselves called. They may appear on the graph as callers - -- of the current one, even if they are themselves not called, and - -- there is no point in including them in the list for the backend. - -- Furthermore, they might not even be public, in which case the - -- back-end cannot handle them at all. - - Succ := Inlined.Table (Index).First_Succ; - while Succ /= No_Succ loop - Subp := Successors.Table (Succ).Subp; - Inlined.Table (Subp).Count := Inlined.Table (Subp).Count - 1; - - if Inlined.Table (Subp).Count = 0 - and then Is_Called (Inlined.Table (Subp).Name) - then - Add_Inlined_Subprogram (Subp); - end if; - - Succ := Successors.Table (Succ).Next; - end loop; end Add_Inlined_Subprogram; ------------------------ @@ -545,12 +516,11 @@ package body Inline is begin Inlined.Increment_Last; Inlined.Table (Inlined.Last).Name := E; + Inlined.Table (Inlined.Last).Next := No_Subp; Inlined.Table (Inlined.Last).First_Succ := No_Succ; - Inlined.Table (Inlined.Last).Count := 0; Inlined.Table (Inlined.Last).Listed := False; Inlined.Table (Inlined.Last).Main_Call := False; - Inlined.Table (Inlined.Last).Next := No_Subp; - Inlined.Table (Inlined.Last).Next_Nopred := No_Subp; + Inlined.Table (Inlined.Last).Processed := False; end New_Entry; -- Start of processing for Add_Subp @@ -589,8 +559,20 @@ package body Inline is Comp_Unit : Node_Id; J : Int; Pack : Entity_Id; + Subp : Subp_Index; S : Succ_Index; + type Pending_Index is new Nat; + + package Pending_Inlined is new Table.Table ( + Table_Component_Type => Subp_Index, + Table_Index_Type => Pending_Index, + Table_Low_Bound => 1, + Table_Initial => Alloc.Inlined_Initial, + Table_Increment => Alloc.Inlined_Increment, + Table_Name => "Pending_Inlined"); + -- The workpile used to compute the transitive closure + function Is_Ancestor_Of_Main (U_Name : Entity_Id; Nam : Node_Id) return Boolean; @@ -757,64 +739,57 @@ package body Inline is -- as part of an inlined package, but are not themselves called. An -- accurate computation of just those subprograms that are needed -- requires that we perform a transitive closure over the call graph, - -- starting from calls in the main program. Here we do one step of - -- the inverse transitive closure, and reset the Is_Called flag on - -- subprograms all of whose callers are not. + -- starting from calls in the main program. for Index in Inlined.First .. Inlined.Last loop - S := Inlined.Table (Index).First_Succ; + if not Is_Called (Inlined.Table (Index).Name) then - if S /= No_Succ - and then not Inlined.Table (Index).Main_Call - then - Set_Is_Called (Inlined.Table (Index).Name, False); + -- This means that Add_Inlined_Body added the subprogram to the + -- table but wasn't able to handle its code unit. Do nothing. - while S /= No_Succ loop - if Is_Called - (Inlined.Table (Successors.Table (S).Subp).Name) - or else Inlined.Table (Successors.Table (S).Subp).Main_Call - then - Set_Is_Called (Inlined.Table (Index).Name); - exit; - end if; + Inlined.Table (Index).Processed := True; + + elsif Inlined.Table (Index).Main_Call then + Pending_Inlined.Increment_Last; + Pending_Inlined.Table (Pending_Inlined.Last) := Index; + Inlined.Table (Index).Processed := True; - S := Successors.Table (S).Next; - end loop; + else + Set_Is_Called (Inlined.Table (Index).Name, False); end if; end loop; - -- Now that the units are compiled, chain the subprograms within - -- that are called and inlined. Produce list of inlined subprograms - -- sorted in topological order. Start with all subprograms that - -- have no prerequisites, i.e. inlined subprograms that do not call - -- other inlined subprograms. + -- Iterate over the workpile until it is emptied, propagating the + -- Is_Called flag to the successors of the processed subprogram. - for Index in Inlined.First .. Inlined.Last loop + while Pending_Inlined.Last >= Pending_Inlined.First loop + Subp := Pending_Inlined.Table (Pending_Inlined.Last); + Pending_Inlined.Decrement_Last; - if Is_Called (Inlined.Table (Index).Name) - and then Inlined.Table (Index).Count = 0 - and then not Inlined.Table (Index).Listed - then - Add_Inlined_Subprogram (Index); - end if; + S := Inlined.Table (Subp).First_Succ; + + while S /= No_Succ loop + Subp := Successors.Table (S).Subp; + + if not Inlined.Table (Subp).Processed then + Set_Is_Called (Inlined.Table (Subp).Name); + Pending_Inlined.Increment_Last; + Pending_Inlined.Table (Pending_Inlined.Last) := Subp; + Inlined.Table (Subp).Processed := True; + end if; + + S := Successors.Table (S).Next; + end loop; end loop; - -- Because Add_Inlined_Subprogram treats recursively nodes that have - -- no prerequisites left, at the end of the loop all subprograms - -- must have been listed. If there are any unlisted subprograms - -- left, there must be some recursive chains that cannot be inlined. + -- Finally add the called subprograms to the list of inlined + -- subprograms for the unit. for Index in Inlined.First .. Inlined.Last loop if Is_Called (Inlined.Table (Index).Name) - and then Inlined.Table (Index).Count /= 0 - and then not Is_Predefined_File_Name - (Unit_File_Name - (Get_Source_Unit (Inlined.Table (Index).Name))) + and then not Inlined.Table (Index).Listed then - Error_Msg_N - ("& cannot be inlined?", Inlined.Table (Index).Name); - - -- A warning on the first one might be sufficient ??? + Add_Inlined_Subprogram (Index); end if; end loop; @@ -994,8 +969,14 @@ package body Inline is -------------------------- function Get_Code_Unit_Entity (E : Entity_Id) return Entity_Id is + Unit : Entity_Id := Cunit_Entity (Get_Code_Unit (E)); + begin - return Cunit_Entity (Get_Code_Unit (E)); + if Ekind (Unit) = E_Package_Body then + Unit := Spec_Entity (Unit); + end if; + + return Unit; end Get_Code_Unit_Entity; -------------------------- @@ -1027,6 +1008,28 @@ package body Inline is return False; end Has_Initialized_Type; + ----------------------------- + -- In_Main_Unit_Or_Subunit -- + ----------------------------- + + function In_Main_Unit_Or_Subunit (E : Entity_Id) return Boolean is + Comp : Node_Id := Cunit (Get_Code_Unit (E)); + + begin + -- Check whether the subprogram or package to inline is within the main + -- unit or its spec or within a subunit. In either case there are no + -- additional bodies to process. If the subprogram appears in a parent + -- of the current unit, the check on whether inlining is possible is + -- done in Analyze_Inlined_Bodies. + + while Nkind (Unit (Comp)) = N_Subunit loop + Comp := Library_Unit (Comp); + end loop; + + return Comp = Cunit (Main_Unit) + or else Comp = Library_Unit (Cunit (Main_Unit)); + end In_Main_Unit_Or_Subunit; + ---------------- -- Initialize -- ---------------- @@ -1061,7 +1064,6 @@ package body Inline is begin if Serious_Errors_Detected = 0 then - Expander_Active := (Operating_Mode = Opt.Generate_Code); Push_Scope (Standard_Standard); To_Clean := New_Elmt_List; @@ -1180,23 +1182,4 @@ package body Inline is end loop; end Remove_Dead_Instance; - ------------------------ - -- Scope_In_Main_Unit -- - ------------------------ - - function Scope_In_Main_Unit (Scop : Entity_Id) return Boolean is - Comp : constant Node_Id := Cunit (Get_Code_Unit (Scop)); - - begin - -- Check whether the scope of the subprogram to inline is within the - -- main unit or within its spec. In either case there are no additional - -- bodies to process. If the subprogram appears in a parent of the - -- current unit, the check on whether inlining is possible is done in - -- Analyze_Inlined_Bodies. - - return - Comp = Cunit (Main_Unit) - or else Comp = Library_Unit (Cunit (Main_Unit)); - end Scope_In_Main_Unit; - end Inline; diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb index 23d2cbf526f..dac6512ee04 100644 --- a/gcc/ada/prj-env.adb +++ b/gcc/ada/prj-env.adb @@ -754,7 +754,7 @@ package body Prj.Env is exit when Data = No_Source; if Data.Unit /= No_Unit_Index then - if Data.Locally_Removed then + if Data.Locally_Removed and then not Data.Suppressed then Fmap.Add_Forbidden_File_Name (Data.File); else Fmap.Add_To_File_Map @@ -829,7 +829,8 @@ package body Prj.Env is Source := Prj.Element (Iter); exit when Source = No_Source; - if Source.Replaced_By = No_Source + if not Source.Suppressed + and then Source.Replaced_By = No_Source and then Source.Path.Name /= No_Path and then (Source.Language.Config.Kind = File_Based or else Source.Unit /= No_Unit_Index) diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 28d2f0faa17..cd62bc9bf44 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -642,32 +642,45 @@ package body Prj.Nmsc is Add_Src := True; - -- Always add the source if it is locally removed, to avoid incorrect - -- duplicate checks. + if Unit /= No_Name then + Prev_Unit := Units_Htable.Get (Data.Tree.Units_HT, Unit); + end if; - if not Locally_Removed then - if Unit /= No_Name then - Prev_Unit := Units_Htable.Get (Data.Tree.Units_HT, Unit); - end if; + if Prev_Unit /= No_Unit_Index + and then (Kind = Impl or else Kind = Spec) + and then Prev_Unit.File_Names (Kind) /= null + then + -- Suspicious, we need to check later whether this is authorized - if Prev_Unit /= No_Unit_Index - and then (Kind = Impl or else Kind = Spec) - and then Prev_Unit.File_Names (Kind) /= null - then - -- Suspicious, we need to check later whether this is authorized + Add_Src := False; + Source := Prev_Unit.File_Names (Kind); + else + Source := Source_Files_Htable.Get + (Data.Tree.Source_Files_HT, File_Name); + + if Source /= No_Source and then Source.Index = Index then Add_Src := False; - Source := Prev_Unit.File_Names (Kind); + end if; + end if; - else - Source := Source_Files_Htable.Get - (Data.Tree.Source_Files_HT, File_Name); + -- Always add the source if it is locally removed, to avoid incorrect + -- duplicate checks. - if Source /= No_Source and then Source.Index = Index then - Add_Src := False; - end if; + if Locally_Removed then + Add_Src := True; + + -- A locally removed source may first replace a source in a project + -- being extended. + + if Source /= No_Source + and then Is_Extending (Project, Source.Project) + and then Naming_Exception /= Inherited + then + Source_To_Replace := Source; end if; + else -- Duplication of file/unit in same project is allowed if order of -- source directories is known, or if there is no compiler for the -- language. @@ -725,7 +738,7 @@ package body Prj.Nmsc is elsif Is_Extending (Project, Source.Project) then if not Locally_Removed - and then Naming_Exception /= Inherited + and then Naming_Exception /= Inherited then Source_To_Replace := Source; end if; @@ -733,6 +746,7 @@ package body Prj.Nmsc is elsif Prev_Unit /= No_Unit_Index and then Prev_Unit.File_Names (Kind) /= null and then not Source.Locally_Removed + and then Source.Replaced_By = No_Source and then not Data.In_Aggregate_Lib then -- Path is set if this is a source we found on the disk, in @@ -768,6 +782,7 @@ package body Prj.Nmsc is Add_Src := False; elsif not Source.Locally_Removed + and then Source.Replaced_By /= No_Source and then not Data.Flags.Allow_Duplicate_Basenames and then Lang_Id.Config.Kind = Unit_Based and then Source.Language.Config.Kind = Unit_Based @@ -785,10 +800,10 @@ package body Prj.Nmsc is Add_Src := True; end if; end if; + end if; - if not Add_Src then - return; - end if; + if not Add_Src then + return; end if; -- Add the new file @@ -868,7 +883,7 @@ package body Prj.Nmsc is -- Note that this updates Unit information as well - if Naming_Exception /= Inherited then + if Naming_Exception /= Inherited and then not Locally_Removed then Override_Kind (Id, Kind); end if; end if; @@ -7799,8 +7814,12 @@ package body Prj.Nmsc is (Project.Excluded, Source.File); if Excluded /= No_File_Found then - Source.Locally_Removed := True; Source.In_Interfaces := False; + Source.Locally_Removed := True; + + if Proj = Project.Project then + Source.Suppressed := True; + end if; if Current_Verbosity = High then Debug_Indent; diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index 696db4ac530..b0d76661b06 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -783,8 +783,12 @@ package Prj is Locally_Removed : Boolean := False; -- True if the source has been "excluded" + Suppressed : Boolean := False; + -- True if the source is a locally removed direct source of the project. + -- These sources should not be put in the mapping file. + Replaced_By : Source_Id := No_Source; - -- Missing comment ??? + -- Source in an extending project that replaces the current source File : File_Name_Type := No_File; -- Canonical file name of the source @@ -866,6 +870,7 @@ package Prj is Unit => No_Unit_Index, Index => 0, Locally_Removed => False, + Suppressed => False, Compilable => Unknown, In_The_Queue => False, Replaced_By => No_Source, diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads index a01505c709c..5b7345f3af4 100644 --- a/gcc/ada/rtsfind.ads +++ b/gcc/ada/rtsfind.ads @@ -1401,6 +1401,7 @@ package Rtsfind is RE_Root_Storage_Pool, -- System.Storage_Pools RE_Root_Storage_Pool_Ptr, -- System.Storage_Pools + RE_Adjust_Controlled_Dereference, -- System.Storage_Pools.Subpools RE_Allocate_Any_Controlled, -- System.Storage_Pools.Subpools RE_Deallocate_Any_Controlled, -- System.Storage_Pools.Subpools RE_Header_Size_With_Padding, -- System.Storage_Pools.Subpools @@ -2624,6 +2625,7 @@ package Rtsfind is RE_Root_Storage_Pool => System_Storage_Pools, RE_Root_Storage_Pool_Ptr => System_Storage_Pools, + RE_Adjust_Controlled_Dereference => System_Storage_Pools_Subpools, RE_Allocate_Any_Controlled => System_Storage_Pools_Subpools, RE_Deallocate_Any_Controlled => System_Storage_Pools_Subpools, RE_Header_Size_With_Padding => System_Storage_Pools_Subpools, diff --git a/gcc/ada/s-stposu.adb b/gcc/ada/s-stposu.adb index 5ee3f2d5804..7838e48d8e8 100644 --- a/gcc/ada/s-stposu.adb +++ b/gcc/ada/s-stposu.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2011, Free Software Foundation, Inc. -- +-- Copyright (C) 2011-2012, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -56,6 +56,28 @@ package body System.Storage_Pools.Subpools is procedure Detach (N : not null SP_Node_Ptr); -- Unhook a subpool node from an arbitrary subpool list + ----------------------------------- + -- Adjust_Controlled_Dereference -- + ----------------------------------- + + procedure Adjust_Controlled_Dereference + (Addr : in out System.Address; + Storage_Size : in out System.Storage_Elements.Storage_Count; + Alignment : System.Storage_Elements.Storage_Count) + is + Header_And_Padding : constant Storage_Offset := + Header_Size_With_Padding (Alignment); + begin + -- Expose the two hidden pointers by shifting the address from the + -- start of the object to the FM_Node equivalent of the pointers. + + Addr := Addr - Header_And_Padding; + + -- Update the size of the object to include the two pointers + + Storage_Size := Storage_Size + Header_And_Padding; + end Adjust_Controlled_Dereference; + -------------- -- Allocate -- -------------- diff --git a/gcc/ada/s-stposu.ads b/gcc/ada/s-stposu.ads index 47099d290e8..40fe676bdaf 100644 --- a/gcc/ada/s-stposu.ads +++ b/gcc/ada/s-stposu.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2011, Free Software Foundation, Inc. -- +-- Copyright (C) 2011-2012, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -249,6 +249,14 @@ private -- This back pointer is used in subpool deallocation. end record; + procedure Adjust_Controlled_Dereference + (Addr : in out System.Address; + Storage_Size : in out System.Storage_Elements.Storage_Count; + Alignment : System.Storage_Elements.Storage_Count); + -- Given the memory attributes of a heap-allocated object that is known to + -- be controlled, adjust the address and size of the object to include the + -- two hidden pointers inserted by the finalization machinery. + -- ??? Once Storage_Pools.Allocate_Any is removed, this should be renamed -- to Allocate_Any. diff --git a/gcc/ada/s-taprop-dummy.adb b/gcc/ada/s-taprop-dummy.adb index f6e9a64cdc7..96bcc3c3bbc 100644 --- a/gcc/ada/s-taprop-dummy.adb +++ b/gcc/ada/s-taprop-dummy.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2012, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -46,6 +46,28 @@ package body System.Task_Primitives.Operations is pragma Warnings (Off); -- Turn off warnings since so many unreferenced parameters + -------------------- + -- Local Packages -- + -------------------- + + package Specific is + + procedure Set (Self_Id : Task_Id); + pragma Inline (Set); + -- Set the self id for the current task + + end Specific; + + package body Specific is + + procedure Set (Self_Id : Task_Id) is + begin + null; + end Set; + + end Specific; + -- The body of this package is target specific + ---------------------------------- -- ATCB allocation/deallocation -- ---------------------------------- diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 64e7e322026..11239f8f233 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -2987,10 +2987,13 @@ package body Sem_Ch10 is Set_First_Name (Withn, True); Set_Implicit_With (Withn, True); - -- If the unit is a package declaration, a private_with_clause on a - -- child unit implies the implicit with on the parent is also private. + -- If the unit is a package or generic package declaration, a private_ + -- with_clause on a child unit implies that the implicit with on the + -- parent is also private. - if Nkind (Unit (N)) = N_Package_Declaration then + if Nkind_In (Unit (N), N_Package_Declaration, + N_Generic_Package_Declaration) + then Set_Private_Present (Withn, Private_Present (Item)); end if; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index fbbde853492..984462a025f 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -423,7 +423,7 @@ package body Sem_Ch13 is end if; end if; - -- Give error message for RM 13.4.1(10) violation + -- Give error message for RM 13.5.1(10) violation else Error_Msg_FE diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index ba94d77f1c4..749393b5d78 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -1650,7 +1650,6 @@ package body Sem_Ch5 is begin Enter_Name (Def_Id); - Set_Ekind (Def_Id, E_Variable); if Present (Subt) then Analyze (Subt); @@ -1658,6 +1657,11 @@ package body Sem_Ch5 is Preanalyze_Range (Iter_Name); + -- Set the kind of the loop variable, which is not visible within + -- the iterator name. + + Set_Ekind (Def_Id, E_Variable); + -- If the domain of iteration is an expression, create a declaration for -- it, so that finalization actions are introduced outside of the loop. -- The declaration must be a renaming because the body of the loop may @@ -1679,6 +1683,13 @@ package body Sem_Ch5 is begin Typ := Etype (Iter_Name); + -- Protect against malformed iterator + + if Typ = Any_Type then + Error_Msg_N ("invalid expression in loop iterator", Iter_Name); + return; + end if; + -- The name in the renaming declaration may be a function call. -- Indicate that it does not come from source, to suppress -- spurious warnings on renamings of parameterless functions, diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 747636d69c1..a2868a97daa 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -6072,7 +6072,6 @@ package body Sem_Ch6 is begin while Present (Old_Discr) and then Present (New_Discr) loop - New_Discr_Id := Defining_Identifier (New_Discr); -- The subtype mark of the discriminant on the full type has not @@ -8934,7 +8933,7 @@ package body Sem_Ch6 is or else not Is_Dispatching_Operation (Prim) or else Scope (Prim) /= Scope (Tagged_Type) or else No (Typ) - or else Base_Type (Typ) /= Tagged_Type + or else Base_Type (Typ) /= Base_Type (Tagged_Type) or else not Primitive_Names_Match (Iface_Prim, Prim) then return False; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 28bb57456eb..5279fb24097 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -3022,16 +3022,29 @@ package body Sem_Prag is Set_Has_Delayed_Freeze (E); end if; - -- An interesting improvement here. If an object of type X is - -- declared atomic, and the type X is not atomic, that's a + -- An interesting improvement here. If an object of composite + -- type X is declared atomic, and the type X isn't, that's a -- pity, since it may not have appropriate alignment etc. We -- can rescue this in the special case where the object and -- type are in the same unit by just setting the type as -- atomic, so that the back end will process it as atomic. + -- Note: we used to do this for elementary types as well, + -- but that turns out to be a bad idea and can have unwanted + -- effects, most notably if the type is elementary, the object + -- a simple component within a record, and both are in a spec: + -- every object of this type in the entire program will be + -- treated as atomic, thus incurring a potentially costly + -- synchronization operation for every access. + + -- Of course it would be best if the back end could just adjust + -- the alignment etc for the specific object, but that's not + -- something we are capable of doing at this point. + Utyp := Underlying_Type (Etype (E)); if Present (Utyp) + and then Is_Composite_Type (Utyp) and then Sloc (E) > No_Location and then Sloc (Utyp) > No_Location and then diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 522ea3c76fb..1ca02d11332 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -3172,12 +3172,13 @@ package body Sem_Util is function Enclosing_Lib_Unit_Entity (E : Entity_Id := Current_Scope) return Entity_Id is - Unit_Entity : Entity_Id := E; + Unit_Entity : Entity_Id; begin -- Look for enclosing library unit entity by following scope links. -- Equivalent to, but faster than indexing through the scope stack. + Unit_Entity := E; while (Present (Scope (Unit_Entity)) and then Scope (Unit_Entity) /= Standard_Standard) and not Is_Child_Unit (Unit_Entity) @@ -8673,6 +8674,16 @@ package body Sem_Util is or else Is_Variable_Prefix (Original_Node (Prefix (N))); + -- in Ada 2012, the dereference may have been added for a type with + -- a declared implicit dereference aspect. + + elsif Nkind (N) = N_Explicit_Dereference + and then Present (Etype (Orig_Node)) + and then Ada_Version >= Ada_2012 + and then Has_Implicit_Dereference (Etype (Orig_Node)) + then + return True; + -- A function call is never a variable elsif Nkind (N) = N_Function_Call then diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb index a89f9b26269..e7ad52e6daf 100644 --- a/gcc/ada/sinfo.adb +++ b/gcc/ada/sinfo.adb @@ -1427,6 +1427,14 @@ package body Sinfo is return Flag15 (N); end Has_Created_Identifier; + function Has_Dereference_Action + (N : Node_Id) return Boolean is + begin + pragma Assert (False + or else NT (N).Nkind = N_Explicit_Dereference); + return Flag13 (N); + end Has_Dereference_Action; + function Has_Dynamic_Length_Check (N : Node_Id) return Boolean is begin @@ -4515,6 +4523,14 @@ package body Sinfo is Set_Flag15 (N, Val); end Set_Has_Created_Identifier; + procedure Set_Has_Dereference_Action + (N : Node_Id; Val : Boolean := True) is + begin + pragma Assert (False + or else NT (N).Nkind = N_Explicit_Dereference); + Set_Flag13 (N, Val); + end Set_Has_Dereference_Action; + procedure Set_Has_Dynamic_Length_Check (N : Node_Id; Val : Boolean := True) is begin diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index fa7dbee35aa..4ece76261d2 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -1111,6 +1111,12 @@ package Sinfo is -- handler is deleted during optimization. For further details on why -- this is required, see Exp_Ch11.Remove_Handler_Entries. + -- Has_Dereference_Action (Flag13-Sem) + -- This flag is present in N_Explicit_Dereference nodes. It is set to + -- indicate that the expansion has aready produced a call to primitive + -- Dereference of a System.Checked_Pools.Checked_Pool implementation. + -- Such dereference actions are produced for debugging purposes. + -- Has_Dynamic_Length_Check (Flag10-Sem) -- This flag is present in all expression nodes. It is set to indicate -- that one of the routines in unit Checks has generated a length check @@ -3192,6 +3198,7 @@ package Sinfo is -- Prefix (Node3) -- Actual_Designated_Subtype (Node4-Sem) -- Atomic_Sync_Required (Flag14-Sem) + -- Has_Dereference_Action (Flag13-Sem) -- plus fields for expression ------------------------------- @@ -8524,6 +8531,9 @@ package Sinfo is function Has_Created_Identifier (N : Node_Id) return Boolean; -- Flag15 + function Has_Dereference_Action + (N : Node_Id) return Boolean; -- Flag13 + function Has_Dynamic_Length_Check (N : Node_Id) return Boolean; -- Flag10 @@ -9508,6 +9518,9 @@ package Sinfo is procedure Set_Has_Created_Identifier (N : Node_Id; Val : Boolean := True); -- Flag15 + procedure Set_Has_Dereference_Action + (N : Node_Id; Val : Boolean := True); -- Flag13 + procedure Set_Has_Dynamic_Length_Check (N : Node_Id; Val : Boolean := True); -- Flag10 @@ -11947,6 +11960,7 @@ package Sinfo is pragma Inline (Handled_Statement_Sequence); pragma Inline (Handler_List_Entry); pragma Inline (Has_Created_Identifier); + pragma Inline (Has_Dereference_Action); pragma Inline (Has_Dynamic_Length_Check); pragma Inline (Has_Dynamic_Range_Check); pragma Inline (Has_Init_Expression); @@ -12272,6 +12286,7 @@ package Sinfo is pragma Inline (Set_Handled_Statement_Sequence); pragma Inline (Set_Handler_List_Entry); pragma Inline (Set_Has_Created_Identifier); + pragma Inline (Set_Has_Dereference_Action); pragma Inline (Set_Has_Dynamic_Length_Check); pragma Inline (Set_Has_Init_Expression); pragma Inline (Set_Has_Local_Raise); diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb index 1afd8b8a38b..ca7127970d0 100644 --- a/gcc/ada/uintp.adb +++ b/gcc/ada/uintp.adb @@ -157,13 +157,6 @@ package body Uintp is pragma Inline (N_Digits); -- Returns number of "digits" in a Uint - function Sum_Digits (Left : Uint; Sign : Int) return Int; - -- If Sign = 1 return the sum of the "digits" of Abs (Left). If the total - -- has more than one digit then return Sum_Digits of total. - - function Sum_Double_Digits (Left : Uint; Sign : Int) return Int; - -- Same as above but work in New_Base = Base * Base - procedure UI_Div_Rem (Left, Right : Uint; Quotient : out Uint; @@ -370,9 +363,12 @@ package body Uintp is H : constant array (Int range 0 .. 15) of Character := "0123456789ABCDEF"; + Q, R : Uint; begin - if U >= Base then - Image_Uint (U / Base); + UI_Div_Rem (U, Base, Q, R); + + if Q > Uint_0 then + Image_Uint (Q); end if; if Digs_Output = 4 and then Base = Uint_16 then @@ -380,7 +376,7 @@ package body Uintp is Digs_Output := 0; end if; - Image_Char (H (UI_To_Int (U rem Base))); + Image_Char (H (UI_To_Int (R))); Digs_Output := Digs_Output + 1; end Image_Uint; @@ -735,234 +731,6 @@ package body Uintp is end if; end Release_And_Save; - ---------------- - -- Sum_Digits -- - ---------------- - - -- This is done in one pass - - -- Mathematically: assume base congruent to 1 and compute an equivalent - -- integer to Left. - - -- If Sign = -1 return the alternating sum of the "digits" - - -- D1 - D2 + D3 - D4 + D5 ... - - -- (where D1 is Least Significant Digit) - - -- Mathematically: assume base congruent to -1 and compute an equivalent - -- integer to Left. - - -- This is used in Rem and Base is assumed to be 2 ** 15 - - -- Note: The next two functions are very similar, any style changes made - -- to one should be reflected in both. These would be simpler if we - -- worked base 2 ** 32. - - function Sum_Digits (Left : Uint; Sign : Int) return Int is - begin - pragma Assert (Sign = Int_1 or else Sign = Int (-1)); - - -- First try simple case; - - if Direct (Left) then - declare - Tmp_Int : Int := Direct_Val (Left); - - begin - if Tmp_Int >= Base then - Tmp_Int := (Tmp_Int / Base) + - Sign * (Tmp_Int rem Base); - - -- Now Tmp_Int is in [-(Base - 1) .. 2 * (Base - 1)] - - if Tmp_Int >= Base then - - -- Sign must be 1 - - Tmp_Int := (Tmp_Int / Base) + 1; - - end if; - - -- Now Tmp_Int is in [-(Base - 1) .. (Base - 1)] - - end if; - - return Tmp_Int; - end; - - -- Otherwise full circuit is needed - - else - declare - L_Length : constant Int := N_Digits (Left); - L_Vec : UI_Vector (1 .. L_Length); - Tmp_Int : Int; - Carry : Int; - Alt : Int; - - begin - Init_Operand (Left, L_Vec); - L_Vec (1) := abs L_Vec (1); - Tmp_Int := 0; - Carry := 0; - Alt := 1; - - for J in reverse 1 .. L_Length loop - Tmp_Int := Tmp_Int + Alt * (L_Vec (J) + Carry); - - -- Tmp_Int is now between [-2 * Base + 1 .. 2 * Base - 1], - -- since old Tmp_Int is between [-(Base - 1) .. Base - 1] - -- and L_Vec is in [0 .. Base - 1] and Carry in [-1 .. 1] - - if Tmp_Int >= Base then - Tmp_Int := Tmp_Int - Base; - Carry := 1; - - elsif Tmp_Int <= -Base then - Tmp_Int := Tmp_Int + Base; - Carry := -1; - - else - Carry := 0; - end if; - - -- Tmp_Int is now between [-Base + 1 .. Base - 1] - - Alt := Alt * Sign; - end loop; - - Tmp_Int := Tmp_Int + Alt * Carry; - - -- Tmp_Int is now between [-Base .. Base] - - if Tmp_Int >= Base then - Tmp_Int := Tmp_Int - Base + Alt * Sign * 1; - - elsif Tmp_Int <= -Base then - Tmp_Int := Tmp_Int + Base + Alt * Sign * (-1); - end if; - - -- Now Tmp_Int is in [-(Base - 1) .. (Base - 1)] - - return Tmp_Int; - end; - end if; - end Sum_Digits; - - ----------------------- - -- Sum_Double_Digits -- - ----------------------- - - -- Note: This is used in Rem, Base is assumed to be 2 ** 15 - - function Sum_Double_Digits (Left : Uint; Sign : Int) return Int is - begin - -- First try simple case; - - pragma Assert (Sign = Int_1 or else Sign = Int (-1)); - - if Direct (Left) then - return Direct_Val (Left); - - -- Otherwise full circuit is needed - - else - declare - L_Length : constant Int := N_Digits (Left); - L_Vec : UI_Vector (1 .. L_Length); - Most_Sig_Int : Int; - Least_Sig_Int : Int; - Carry : Int; - J : Int; - Alt : Int; - - begin - Init_Operand (Left, L_Vec); - L_Vec (1) := abs L_Vec (1); - Most_Sig_Int := 0; - Least_Sig_Int := 0; - Carry := 0; - Alt := 1; - J := L_Length; - - while J > Int_1 loop - Least_Sig_Int := Least_Sig_Int + Alt * (L_Vec (J) + Carry); - - -- Least is in [-2 Base + 1 .. 2 * Base - 1] - -- Since L_Vec in [0 .. Base - 1] and Carry in [-1 .. 1] - -- and old Least in [-Base + 1 .. Base - 1] - - if Least_Sig_Int >= Base then - Least_Sig_Int := Least_Sig_Int - Base; - Carry := 1; - - elsif Least_Sig_Int <= -Base then - Least_Sig_Int := Least_Sig_Int + Base; - Carry := -1; - - else - Carry := 0; - end if; - - -- Least is now in [-Base + 1 .. Base - 1] - - Most_Sig_Int := Most_Sig_Int + Alt * (L_Vec (J - 1) + Carry); - - -- Most is in [-2 Base + 1 .. 2 * Base - 1] - -- Since L_Vec in [0 .. Base - 1] and Carry in [-1 .. 1] - -- and old Most in [-Base + 1 .. Base - 1] - - if Most_Sig_Int >= Base then - Most_Sig_Int := Most_Sig_Int - Base; - Carry := 1; - - elsif Most_Sig_Int <= -Base then - Most_Sig_Int := Most_Sig_Int + Base; - Carry := -1; - else - Carry := 0; - end if; - - -- Most is now in [-Base + 1 .. Base - 1] - - J := J - 2; - Alt := Alt * Sign; - end loop; - - if J = Int_1 then - Least_Sig_Int := Least_Sig_Int + Alt * (L_Vec (J) + Carry); - else - Least_Sig_Int := Least_Sig_Int + Alt * Carry; - end if; - - if Least_Sig_Int >= Base then - Least_Sig_Int := Least_Sig_Int - Base; - Most_Sig_Int := Most_Sig_Int + Alt * 1; - - elsif Least_Sig_Int <= -Base then - Least_Sig_Int := Least_Sig_Int + Base; - Most_Sig_Int := Most_Sig_Int + Alt * (-1); - end if; - - if Most_Sig_Int >= Base then - Most_Sig_Int := Most_Sig_Int - Base; - Alt := Alt * Sign; - Least_Sig_Int := - Least_Sig_Int + Alt * 1; -- cannot overflow again - - elsif Most_Sig_Int <= -Base then - Most_Sig_Int := Most_Sig_Int + Base; - Alt := Alt * Sign; - Least_Sig_Int := - Least_Sig_Int + Alt * (-1); -- cannot overflow again. - end if; - - return Most_Sig_Int * Base + Least_Sig_Int; - end; - end if; - end Sum_Double_Digits; - --------------- -- Tree_Read -- --------------- @@ -2367,167 +2135,21 @@ package body Uintp is end UI_Rem; function UI_Rem (Left, Right : Uint) return Uint is - Sign : Int; - Tmp : Int; - - subtype Int1_12 is Integer range 1 .. 12; + Remainder : Uint; + Quotient : Uint; + pragma Warnings (Off, Quotient); begin pragma Assert (Right /= Uint_0); - if Direct (Right) then - if Direct (Left) then - return UI_From_Int (Direct_Val (Left) rem Direct_Val (Right)); - - else - - -- Special cases when Right is less than 13 and Left is larger - -- larger than one digit. All of these algorithms depend on the - -- base being 2 ** 15 We work with Abs (Left) and Abs(Right) - -- then multiply result by Sign (Left) - - if (Right <= Uint_12) and then (Right >= Uint_Minus_12) then - - if Left < Uint_0 then - Sign := -1; - else - Sign := 1; - end if; - - -- All cases are listed, grouped by mathematical method It is - -- not inefficient to do have this case list out of order since - -- GCC sorts the cases we list. - - case Int1_12 (abs (Direct_Val (Right))) is - - when 1 => - return Uint_0; - - -- Powers of two are simple AND's with LS Left Digit GCC - -- will recognise these constants as powers of 2 and replace - -- the rem with simpler operations where possible. - - -- Least_Sig_Digit might return Negative numbers - - when 2 => - return UI_From_Int ( - Sign * (Least_Sig_Digit (Left) mod 2)); + if Direct (Right) and then Direct (Left) then + return UI_From_Int (Direct_Val (Left) rem Direct_Val (Right)); - when 4 => - return UI_From_Int ( - Sign * (Least_Sig_Digit (Left) mod 4)); - - when 8 => - return UI_From_Int ( - Sign * (Least_Sig_Digit (Left) mod 8)); - - -- Some number theoretical tricks: - - -- If B Rem Right = 1 then - -- Left Rem Right = Sum_Of_Digits_Base_B (Left) Rem Right - - -- Note: 2^32 mod 3 = 1 - - when 3 => - return UI_From_Int ( - Sign * (Sum_Double_Digits (Left, 1) rem Int (3))); - - -- Note: 2^15 mod 7 = 1 - - when 7 => - return UI_From_Int ( - Sign * (Sum_Digits (Left, 1) rem Int (7))); - - -- Note: 2^32 mod 5 = -1 - - -- Alternating sums might be negative, but rem is always - -- positive hence we must use mod here. - - when 5 => - Tmp := Sum_Double_Digits (Left, -1) mod Int (5); - return UI_From_Int (Sign * Tmp); - - -- Note: 2^15 mod 9 = -1 - - -- Alternating sums might be negative, but rem is always - -- positive hence we must use mod here. - - when 9 => - Tmp := Sum_Digits (Left, -1) mod Int (9); - return UI_From_Int (Sign * Tmp); - - -- Note: 2^15 mod 11 = -1 - - -- Alternating sums might be negative, but rem is always - -- positive hence we must use mod here. - - when 11 => - Tmp := Sum_Digits (Left, -1) mod Int (11); - return UI_From_Int (Sign * Tmp); - - -- Now resort to Chinese Remainder theorem to reduce 6, 10, - -- 12 to previous special cases - - -- There is no reason we could not add more cases like these - -- if it proves useful. - - -- Perhaps we should go up to 16, however we have no "trick" - -- for 13. - - -- To find u mod m we: - - -- Pick m1, m2 S.T. - -- GCD(m1, m2) = 1 AND m = (m1 * m2). - - -- Next we pick (Basis) M1, M2 small S.T. - -- (M1 mod m1) = (M2 mod m2) = 1 AND - -- (M1 mod m2) = (M2 mod m1) = 0 - - -- So u mod m = (u1 * M1 + u2 * M2) mod m Where u1 = (u mod - -- m1) AND u2 = (u mod m2); Under typical circumstances the - -- last mod m can be done with a (possible) single - -- subtraction. - - -- m1 = 2; m2 = 3; M1 = 3; M2 = 4; - - when 6 => - Tmp := 3 * (Least_Sig_Digit (Left) rem 2) + - 4 * (Sum_Double_Digits (Left, 1) rem 3); - return UI_From_Int (Sign * (Tmp rem 6)); - - -- m1 = 2; m2 = 5; M1 = 5; M2 = 6; - - when 10 => - Tmp := 5 * (Least_Sig_Digit (Left) rem 2) + - 6 * (Sum_Double_Digits (Left, -1) mod 5); - return UI_From_Int (Sign * (Tmp rem 10)); - - -- m1 = 3; m2 = 4; M1 = 4; M2 = 9; - - when 12 => - Tmp := 4 * (Sum_Double_Digits (Left, 1) rem 3) + - 9 * (Least_Sig_Digit (Left) rem 4); - return UI_From_Int (Sign * (Tmp rem 12)); - end case; - - end if; - - -- Else fall through to general case - - -- The special case Length (Left) = Length (Right) = 1 in Div - -- looks slow. It uses UI_To_Int when Int should suffice. ??? - end if; - end if; - - declare - Remainder : Uint; - Quotient : Uint; - pragma Warnings (Off, Quotient); - begin + else UI_Div_Rem - (Left, Right, Quotient, Remainder, Discard_Quotient => True); + (Left, Right, Quotient, Remainder, Discard_Quotient => True); return Remainder; - end; + end if; end UI_Rem; ------------ diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads index 1ebe8d34595..e438f843670 100644 --- a/gcc/ada/vms_data.ads +++ b/gcc/ada/vms_data.ads @@ -1779,9 +1779,12 @@ package VMS_Data is -- Causes errors to be displayed as soon as they are encountered, rather -- than after compilation is terminated. If GNAT terminates prematurely -- or goes into an infinite loop, the last error message displayed may - -- help to pinpoint the culprit. Use with caution: This qualifier is - -- intended for use in debugging the compiler proper, and may cause - -- output of warnings suppressed by pragma. + -- help to pinpoint the culprit. + -- + -- Note that this qualifier is intended only for helping to diagnose + -- illegal programs when the compiler fails. It disconnects many of the + -- normal handling procedures for error messages, and may for example + -- cause malfunction of pragma Warnings. S_GCC_Inline : aliased constant S := "/INLINE=" & "PRAGMA " & diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 3153cf4e183..41688a7220d 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -8787,6 +8787,7 @@ struct c_declspecs * build_null_declspecs (void) { struct c_declspecs *ret = XOBNEW (&parser_obstack, struct c_declspecs); + memset (&ret->locations, 0, cdw_number_of_elements); ret->type = 0; ret->expr = 0; ret->decl_attr = 0; @@ -8824,7 +8825,8 @@ build_null_declspecs (void) SPECS, returning SPECS. */ struct c_declspecs * -declspecs_add_addrspace (struct c_declspecs *specs, addr_space_t as) +declspecs_add_addrspace (source_location location, + struct c_declspecs *specs, addr_space_t as) { specs->non_sc_seen_p = true; specs->declspecs_seen_p = true; @@ -8835,7 +8837,10 @@ declspecs_add_addrspace (struct c_declspecs *specs, addr_space_t as) c_addr_space_name (as), c_addr_space_name (specs->address_space)); else - specs->address_space = as; + { + specs->address_space = as; + specs->locations[cdw_address_space] = location; + } return specs; } @@ -8843,7 +8848,8 @@ declspecs_add_addrspace (struct c_declspecs *specs, addr_space_t as) returning SPECS. */ struct c_declspecs * -declspecs_add_qual (struct c_declspecs *specs, tree qual) +declspecs_add_qual (source_location loc, + struct c_declspecs *specs, tree qual) { enum rid i; bool dupe = false; @@ -8857,20 +8863,23 @@ declspecs_add_qual (struct c_declspecs *specs, tree qual) case RID_CONST: dupe = specs->const_p; specs->const_p = true; + specs->locations[cdw_const] = loc; break; case RID_VOLATILE: dupe = specs->volatile_p; specs->volatile_p = true; + specs->locations[cdw_volatile] = loc; break; case RID_RESTRICT: dupe = specs->restrict_p; specs->restrict_p = true; + specs->locations[cdw_restrict] = loc; break; default: gcc_unreachable (); } if (dupe && !flag_isoc99) - pedwarn (input_location, OPT_Wpedantic, "duplicate %qE", qual); + pedwarn (loc, OPT_Wpedantic, "duplicate %qE", qual); return specs; } @@ -8923,6 +8932,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, pedwarn_c90 (loc, OPT_Wlong_long, "ISO C90 does not support %<long long%>"); specs->long_long_p = 1; + specs->locations[cdw_long_long] = loc; break; } if (specs->short_p) @@ -8962,7 +8972,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<long%> and %<_Decimal128%> in " "declaration specifiers")); else - specs->long_p = true; + { + specs->long_p = true; + specs->locations[cdw_long] = loc; + } break; case RID_SHORT: dupe = specs->short_p; @@ -9007,7 +9020,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<short%> and %<_Decimal128%> in " "declaration specifiers")); else - specs->short_p = true; + { + specs->short_p = true; + specs->locations[cdw_short] = loc; + } break; case RID_SIGNED: dupe = specs->signed_p; @@ -9044,7 +9060,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<signed%> and %<_Decimal128%> in " "declaration specifiers")); else - specs->signed_p = true; + { + specs->signed_p = true; + specs->locations[cdw_signed] = loc; + } break; case RID_UNSIGNED: dupe = specs->unsigned_p; @@ -9081,11 +9100,14 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<unsigned%> and %<_Decimal128%> in " "declaration specifiers")); else - specs->unsigned_p = true; + { + specs->unsigned_p = true; + specs->locations[cdw_unsigned] = loc; + } break; case RID_COMPLEX: dupe = specs->complex_p; - if (!flag_isoc99 && !in_system_header) + if (!flag_isoc99 && !in_system_header_at (loc)) pedwarn (loc, OPT_Wpedantic, "ISO C90 does not support complex types"); if (specs->typespec_word == cts_void) @@ -9121,7 +9143,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<complex%> and %<_Sat%> in " "declaration specifiers")); else - specs->complex_p = true; + { + specs->complex_p = true; + specs->locations[cdw_complex] = loc; + } break; case RID_SAT: dupe = specs->saturating_p; @@ -9174,7 +9199,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<_Sat%> and %<complex%> in " "declaration specifiers")); else - specs->saturating_p = true; + { + specs->saturating_p = true; + specs->locations[cdw_saturating] = loc; + } break; default: gcc_unreachable (); @@ -9220,7 +9248,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<__int128%> and %<short%> in " "declaration specifiers")); else - specs->typespec_word = cts_int128; + { + specs->typespec_word = cts_int128; + specs->locations[cdw_typespec] = loc; + } return specs; case RID_VOID: if (specs->long_p) @@ -9248,7 +9279,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<_Sat%> and %<void%> in " "declaration specifiers")); else - specs->typespec_word = cts_void; + { + specs->typespec_word = cts_void; + specs->locations[cdw_typespec] = loc; + } return specs; case RID_BOOL: if (specs->long_p) @@ -9276,7 +9310,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<_Sat%> and %<_Bool%> in " "declaration specifiers")); else - specs->typespec_word = cts_bool; + { + specs->typespec_word = cts_bool; + specs->locations[cdw_typespec] = loc; + } return specs; case RID_CHAR: if (specs->long_p) @@ -9292,7 +9329,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<_Sat%> and %<char%> in " "declaration specifiers")); else - specs->typespec_word = cts_char; + { + specs->typespec_word = cts_char; + specs->locations[cdw_typespec] = loc; + } return specs; case RID_INT: if (specs->saturating_p) @@ -9300,7 +9340,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<_Sat%> and %<int%> in " "declaration specifiers")); else - specs->typespec_word = cts_int; + { + specs->typespec_word = cts_int; + specs->locations[cdw_typespec] = loc; + } return specs; case RID_FLOAT: if (specs->long_p) @@ -9324,7 +9367,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<_Sat%> and %<float%> in " "declaration specifiers")); else - specs->typespec_word = cts_float; + { + specs->typespec_word = cts_float; + specs->locations[cdw_typespec] = loc; + } return specs; case RID_DOUBLE: if (specs->long_long_p) @@ -9348,7 +9394,10 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, ("both %<_Sat%> and %<double%> in " "declaration specifiers")); else - specs->typespec_word = cts_double; + { + specs->typespec_word = cts_double; + specs->locations[cdw_typespec] = loc; + } return specs; case RID_DFLOAT32: case RID_DFLOAT64: @@ -9402,6 +9451,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, specs->typespec_word = cts_dfloat64; else specs->typespec_word = cts_dfloat128; + specs->locations[cdw_typespec] = loc; } if (!targetm.decimal_float_supported_p ()) error_at (loc, @@ -9427,6 +9477,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, specs->typespec_word = cts_fract; else specs->typespec_word = cts_accum; + specs->locations[cdw_typespec] = loc; } if (!targetm.fixed_point_supported_p ()) error_at (loc, @@ -9460,6 +9511,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, specs->decl_attr = DECL_ATTRIBUTES (type); specs->typedef_p = true; specs->explicit_signed_p = C_TYPEDEF_EXPLICITLY_SIGNED (type); + specs->locations[cdw_typedef] = loc; /* If this typedef name is defined in a struct, then a C++ lookup would return a different value. */ @@ -9483,13 +9535,17 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, else if (TREE_TYPE (t) == error_mark_node) ; else - specs->type = TREE_TYPE (t); + { + specs->type = TREE_TYPE (t); + specs->locations[cdw_typespec] = loc; + } } else { if (TREE_CODE (type) != ERROR_MARK && spec.kind == ctsk_typeof) { specs->typedef_p = true; + specs->locations[cdw_typedef] = loc; if (spec.expr) { if (specs->expr) @@ -9510,7 +9566,9 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, declaration specifiers SPECS, returning SPECS. */ struct c_declspecs * -declspecs_add_scspec (struct c_declspecs *specs, tree scspec) +declspecs_add_scspec (source_location loc, + struct c_declspecs *specs, + tree scspec) { enum rid i; enum c_storage_class n = csc_none; @@ -9531,11 +9589,13 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) difference between gnu89 and C99 inline. */ dupe = false; specs->inline_p = true; + specs->locations[cdw_inline] = loc; break; case RID_NORETURN: /* Duplicate _Noreturn is permitted. */ dupe = false; specs->noreturn_p = true; + specs->locations[cdw_noreturn] = loc; break; case RID_THREAD: dupe = specs->thread_p; @@ -9546,7 +9606,10 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) else if (specs->storage_class == csc_typedef) error ("%<__thread%> used with %<typedef%>"); else - specs->thread_p = true; + { + specs->thread_p = true; + specs->locations[cdw_thread] = loc; + } break; case RID_AUTO: n = csc_auto; @@ -9585,6 +9648,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) else { specs->storage_class = n; + specs->locations[cdw_storage_class] = loc; if (n != csc_extern && n != csc_static && specs->thread_p) { error ("%<__thread%> used with %qE", scspec); @@ -9599,9 +9663,10 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) returning SPECS. */ struct c_declspecs * -declspecs_add_attrs (struct c_declspecs *specs, tree attrs) +declspecs_add_attrs (source_location loc, struct c_declspecs *specs, tree attrs) { specs->attrs = chainon (attrs, specs->attrs); + specs->locations[cdw_attributes] = loc; specs->declspecs_seen_p = true; return specs; } @@ -9610,10 +9675,12 @@ declspecs_add_attrs (struct c_declspecs *specs, tree attrs) alignment is ALIGN) to the declaration specifiers SPECS, returning SPECS. */ struct c_declspecs * -declspecs_add_alignas (struct c_declspecs *specs, tree align) +declspecs_add_alignas (source_location loc, + struct c_declspecs *specs, tree align) { int align_log; specs->alignas_p = true; + specs->locations[cdw_alignas] = loc; if (align == error_mark_node) return specs; align_log = check_user_alignment (align, true); @@ -9654,9 +9721,11 @@ finish_declspecs (struct c_declspecs *specs) { if (specs->saturating_p) { - error ("%<_Sat%> is used without %<_Fract%> or %<_Accum%>"); + error_at (specs->locations[cdw_saturating], + "%<_Sat%> is used without %<_Fract%> or %<_Accum%>"); if (!targetm.fixed_point_supported_p ()) - error ("fixed-point types not supported for this target"); + error_at (specs->locations[cdw_saturating], + "fixed-point types not supported for this target"); specs->typespec_word = cts_fract; } else if (specs->long_p || specs->short_p @@ -9667,7 +9736,7 @@ finish_declspecs (struct c_declspecs *specs) else if (specs->complex_p) { specs->typespec_word = cts_double; - pedwarn (input_location, OPT_Wpedantic, + pedwarn (specs->locations[cdw_complex], OPT_Wpedantic, "ISO C does not support plain %<complex%> meaning " "%<double complex%>"); } @@ -9712,7 +9781,7 @@ finish_declspecs (struct c_declspecs *specs) specs->type = char_type_node; if (specs->complex_p) { - pedwarn (input_location, OPT_Wpedantic, + pedwarn (specs->locations[cdw_complex], OPT_Wpedantic, "ISO C does not support complex integer types"); specs->type = build_complex_type (specs->type); } @@ -9725,7 +9794,7 @@ finish_declspecs (struct c_declspecs *specs) : int128_integer_type_node); if (specs->complex_p) { - pedwarn (input_location, OPT_Wpedantic, + pedwarn (specs->locations[cdw_complex], OPT_Wpedantic, "ISO C does not support complex integer types"); specs->type = build_complex_type (specs->type); } @@ -9751,7 +9820,7 @@ finish_declspecs (struct c_declspecs *specs) : integer_type_node); if (specs->complex_p) { - pedwarn (input_location, OPT_Wpedantic, + pedwarn (specs->locations[cdw_complex], OPT_Wpedantic, "ISO C does not support complex integer types"); specs->type = build_complex_type (specs->type); } diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 3575480f19a..1a84751f3c7 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,7 +1,24 @@ +2012-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org> + + * c.opt (--pedantic-errors,-pedantic-errors): Do not handle here. + * c-opts.c (c_common_handle_option): Do not handle explicitly + Wreturn-type, Wwrite-strings, warn_ecpp, and -pedantic-errors. + +2012-05-16 Dodji Seketeli <dodji@redhat.com> + + PR preprocessor/7263 + * c-lex.c (c_lex_with_flags): Pass a virtual location to the call + to cpp_classify_number. For diagnostics, use the precise location + instead of the global input_location. + +2012-05-15 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/11856 + * c-common.c (shorten_compare): Check c_inhibit_evaluation_warnings. + 2012-05-14 Bernd Schmidt <bernds@codesourcery.com> - * c-family/c-common.c (DEF_ATTR_STRING): Define and undefine as - necessary. + * c-common.c (DEF_ATTR_STRING): Define and undefine as necessary. 2012-05-14 Manuel López-Ibáñez <manu@gcc.gnu.org> diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index f32a94a7c65..f745365da1a 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -3754,7 +3754,8 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, type = c_common_unsigned_type (type); } - if (TREE_CODE (primop0) != INTEGER_CST) + if (TREE_CODE (primop0) != INTEGER_CST + && c_inhibit_evaluation_warnings == 0) { if (val == truthvalue_false_node) warning_at (loc, OPT_Wtype_limits, @@ -3834,6 +3835,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, warning. */ bool warn = warn_type_limits && !in_system_header + && c_inhibit_evaluation_warnings == 0 && !(TREE_CODE (primop0) == INTEGER_CST && !TREE_OVERFLOW (convert (c_common_signed_type (type), primop0))) diff --git a/gcc/c-family/c-lex.c b/gcc/c-family/c-lex.c index 2a605f65e82..b122dab3086 100644 --- a/gcc/c-family/c-lex.c +++ b/gcc/c-family/c-lex.c @@ -315,7 +315,7 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags, case CPP_NUMBER: { const char *suffix = NULL; - unsigned int flags = cpp_classify_number (parse_in, tok, &suffix); + unsigned int flags = cpp_classify_number (parse_in, tok, &suffix, *loc); switch (flags & CPP_N_CATEGORY) { @@ -417,7 +417,7 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags, *cpp_spell_token (parse_in, tok, name, true) = 0; - error ("stray %qs in program", name); + error_at (*loc, "stray %qs in program", name); } goto retry; diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index a7fadc817aa..c493c1096f3 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -510,10 +510,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, break; } - case OPT_Wreturn_type: - warn_return_type = value; - break; - case OPT_Wtraditional: cpp_opts->cpp_warn_traditional = value; break; @@ -540,12 +536,7 @@ c_common_handle_option (size_t scode, const char *arg, int value, warn_variadic_macros = value; break; - case OPT_Wwrite_strings: - warn_write_strings = value; - break; - case OPT_Weffc__: - warn_ecpp = value; if (value) warn_nonvdtor = true; break; @@ -740,10 +731,9 @@ c_common_handle_option (size_t scode, const char *arg, int value, error ("output filename specified twice"); break; - /* We need to handle the -Wpedantic switches here, rather than in + /* We need to handle the -Wpedantic switch here, rather than in c_common_post_options, so that a subsequent -Wno-endif-labels is not overridden. */ - case OPT_pedantic_errors: case OPT_Wpedantic: cpp_opts->cpp_pedantic = 1; cpp_opts->warn_endif_labels = 1; diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 0f13dc34eef..53d97521b1c 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -142,9 +142,6 @@ C ObjC C++ ObjC++ Joined Separate -pedantic C ObjC C++ ObjC++ Alias(pedantic) --pedantic-errors -C ObjC C++ ObjC++ Alias(pedantic-errors) - -preprocess C ObjC C++ ObjC++ Undocumented Alias(E) @@ -1203,10 +1200,6 @@ pedantic C ObjC C++ ObjC++ Alias(Wpedantic) ; Documented in common.opt -pedantic-errors -C ObjC C++ ObjC++ -; Documented in common.opt - print-objc-runtime-info ObjC ObjC++ Generate C header of platform-specific features diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 47908f14054..33420ca4622 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -2015,14 +2015,15 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs, if (c_parser_next_token_is (parser, CPP_NAME)) { - tree value = c_parser_peek_token (parser)->value; - c_id_kind kind = c_parser_peek_token (parser)->id_kind; + c_token *name_token = c_parser_peek_token (parser); + tree value = name_token->value; + c_id_kind kind = name_token->id_kind; if (kind == C_ID_ADDRSPACE) { addr_space_t as - = c_parser_peek_token (parser)->keyword - RID_FIRST_ADDR_SPACE; - declspecs_add_addrspace (specs, as); + = name_token->keyword - RID_FIRST_ADDR_SPACE; + declspecs_add_addrspace (name_token->location, specs, as); c_parser_consume_token (parser); attrs_ok = true; continue; @@ -2068,7 +2069,7 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs, } t.expr = NULL_TREE; t.expr_const_operands = true; - declspecs_add_type (loc, specs, t); + declspecs_add_type (name_token->location, specs, t); continue; } if (c_parser_next_token_is (parser, CPP_LESS)) @@ -2104,7 +2105,8 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs, /* TODO: Distinguish between function specifiers (inline, noreturn) and storage class specifiers, either here or in declspecs_add_scspec. */ - declspecs_add_scspec (specs, c_parser_peek_token (parser)->value); + declspecs_add_scspec (loc, specs, + c_parser_peek_token (parser)->value); c_parser_consume_token (parser); break; case RID_UNSIGNED: @@ -2171,18 +2173,18 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs, case RID_VOLATILE: case RID_RESTRICT: attrs_ok = true; - declspecs_add_qual (specs, c_parser_peek_token (parser)->value); + declspecs_add_qual (loc, specs, c_parser_peek_token (parser)->value); c_parser_consume_token (parser); break; case RID_ATTRIBUTE: if (!attrs_ok) goto out; attrs = c_parser_attributes (parser); - declspecs_add_attrs (specs, attrs); + declspecs_add_attrs (loc, specs, attrs); break; case RID_ALIGNAS: align = c_parser_alignas_specifier (parser); - declspecs_add_alignas (specs, align); + declspecs_add_alignas (loc, specs, align); break; default: goto out; @@ -3332,7 +3334,7 @@ c_parser_parameter_declaration (c_parser *parser, tree attrs) specs = build_null_declspecs (); if (attrs) { - declspecs_add_attrs (specs, attrs); + declspecs_add_attrs (input_location, specs, attrs); attrs = NULL_TREE; } c_parser_declspecs (parser, specs, true, true, true, cla_nonabstract_decl); diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 468cfe4a278..8f8c9d8e014 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -222,8 +222,45 @@ enum c_typespec_keyword { cts_accum }; -/* A sequence of declaration specifiers in C. */ +/* This enum lists all the possible declarator specifiers, storage + class or attribute that a user can write. There is at least one + enumerator per possible declarator specifier in the struct + c_declspecs below. + + It is used to index the array of declspec locations in struct + c_declspecs. */ +enum c_declspec_word { + cdw_typespec /* A catch-all for a typespec. */, + cdw_storage_class /* A catch-all for a storage class */, + cdw_attributes, + cdw_typedef, + cdw_explicit_signed, + cdw_deprecated, + cdw_default_int, + cdw_long, + cdw_long_long, + cdw_short, + cdw_signed, + cdw_unsigned, + cdw_complex, + cdw_inline, + cdw_noreturn, + cdw_thread, + cdw_const, + cdw_volatile, + cdw_restrict, + cdw_saturating, + cdw_alignas, + cdw_address_space, + cdw_number_of_elements /* This one must always be the last + enumerator. */ +}; + +/* A sequence of declaration specifiers in C. When a new declaration + specifier is added, please update the enum c_declspec_word above + accordingly. */ struct c_declspecs { + source_location locations[cdw_number_of_elements]; /* The type specified, if a single type specifier such as a struct, union or enum specifier, typedef name or typeof specifies the whole type, or NULL_TREE if none or a keyword such as "void" or @@ -509,15 +546,20 @@ extern struct c_declarator *build_id_declarator (tree); extern struct c_declarator *make_pointer_declarator (struct c_declspecs *, struct c_declarator *); extern struct c_declspecs *build_null_declspecs (void); -extern struct c_declspecs *declspecs_add_qual (struct c_declspecs *, tree); +extern struct c_declspecs *declspecs_add_qual (source_location, + struct c_declspecs *, tree); extern struct c_declspecs *declspecs_add_type (location_t, struct c_declspecs *, struct c_typespec); -extern struct c_declspecs *declspecs_add_scspec (struct c_declspecs *, tree); -extern struct c_declspecs *declspecs_add_attrs (struct c_declspecs *, tree); -extern struct c_declspecs *declspecs_add_addrspace (struct c_declspecs *, +extern struct c_declspecs *declspecs_add_scspec (source_location, + struct c_declspecs *, tree); +extern struct c_declspecs *declspecs_add_attrs (source_location, + struct c_declspecs *, tree); +extern struct c_declspecs *declspecs_add_addrspace (source_location, + struct c_declspecs *, addr_space_t); -extern struct c_declspecs *declspecs_add_alignas (struct c_declspecs *, tree); +extern struct c_declspecs *declspecs_add_alignas (source_location, + struct c_declspecs *, tree); extern struct c_declspecs *finish_declspecs (struct c_declspecs *); /* in c-objc-common.c */ diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 88ef1f14e93..86a94162236 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1242,6 +1242,7 @@ cgraph_remove_node (struct cgraph_node *node) && (cgraph_global_info_ready && (TREE_ASM_WRITTEN (n->symbol.decl) || DECL_EXTERNAL (n->symbol.decl) + || !n->analyzed || n->symbol.in_other_partition)))) cgraph_release_function_body (node); diff --git a/gcc/cgraph.h b/gcc/cgraph.h index a4c23b35ec5..de854f74b01 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -1123,11 +1123,12 @@ cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node) static inline bool varpool_can_remove_if_no_refs (struct varpool_node *node) { + if (DECL_EXTERNAL (node->symbol.decl)) + return true; return (!node->symbol.force_output && !node->symbol.used_from_other_partition && (DECL_COMDAT (node->symbol.decl) - || !node->symbol.externally_visible - || DECL_HAS_VALUE_EXPR_P (node->symbol.decl) - || DECL_EXTERNAL (node->symbol.decl))); + || !node->symbol.externally_visible + || DECL_HAS_VALUE_EXPR_P (node->symbol.decl))); } /* Return true when all references to VNODE must be visible in ipa_ref_list. diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c index ea5351342c0..ce8f2ee080a 100644 --- a/gcc/cgraphbuild.c +++ b/gcc/cgraphbuild.c @@ -54,7 +54,7 @@ record_reference (tree *tp, int *walk_subtrees, void *data) tree decl; struct record_reference_ctx *ctx = (struct record_reference_ctx *)data; - t = canonicalize_constructor_val (t); + t = canonicalize_constructor_val (t, NULL); if (!t) t = *tp; else if (t != *tp) diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 52c69b04f16..e3416c6adaa 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -205,6 +205,7 @@ static void expand_all_functions (void); static void mark_functions_to_output (void); static void expand_function (struct cgraph_node *); static void cgraph_analyze_function (struct cgraph_node *); +static void handle_alias_pairs (void); FILE *cgraph_dump_file; @@ -284,6 +285,8 @@ cgraph_process_new_functions (void) if (!cgraph_new_nodes) return false; + finish_aliases_1 (); + handle_alias_pairs (); /* Note that this queue may grow as its being processed, as the new functions may generate new ones. */ for (csi = csi_start (cgraph_new_nodes); !csi_end_p (csi); csi_next (&csi)) @@ -782,6 +785,10 @@ process_function_and_variable_attributes (struct cgraph_node *first, vnode = varpool_next_variable (vnode)) { tree decl = vnode->symbol.decl; + if (DECL_EXTERNAL (decl) + && DECL_INITIAL (decl) + && const_value_known_p (decl)) + varpool_finalize_decl (decl); if (DECL_PRESERVE_P (decl)) vnode->symbol.force_output = true; else if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (decl))) @@ -815,7 +822,7 @@ varpool_finalize_decl (tree decl) { struct varpool_node *node = varpool_node (decl); - gcc_assert (TREE_STATIC (decl)); + gcc_assert (TREE_STATIC (decl) || DECL_EXTERNAL (decl)); if (node->finalized) return; @@ -1026,52 +1033,15 @@ handle_alias_pairs (void) { alias_pair *p; unsigned i; - struct cgraph_node *target_node; - struct cgraph_node *src_node; - struct varpool_node *target_vnode; for (i = 0; VEC_iterate (alias_pair, alias_pairs, i, p);) { - if (TREE_CODE (p->decl) == FUNCTION_DECL - && (target_node = cgraph_node_for_asm (p->target)) != NULL) - { - src_node = cgraph_get_node (p->decl); - if (src_node && src_node->local.finalized) - cgraph_reset_node (src_node); - /* Normally EXTERNAL flag is used to mark external inlines, - however for aliases it seems to be allowed to use it w/o - any meaning. See gcc.dg/attr-alias-3.c - However for weakref we insist on EXTERNAL flag being set. - See gcc.dg/attr-alias-5.c */ - if (DECL_EXTERNAL (p->decl)) - DECL_EXTERNAL (p->decl) - = lookup_attribute ("weakref", - DECL_ATTRIBUTES (p->decl)) != NULL; - cgraph_create_function_alias (p->decl, target_node->symbol.decl); - VEC_unordered_remove (alias_pair, alias_pairs, i); - } - else if (TREE_CODE (p->decl) == VAR_DECL - && (target_vnode = varpool_node_for_asm (p->target)) != NULL) - { - /* Normally EXTERNAL flag is used to mark external inlines, - however for aliases it seems to be allowed to use it w/o - any meaning. See gcc.dg/attr-alias-3.c - However for weakref we insist on EXTERNAL flag being set. - See gcc.dg/attr-alias-5.c */ - if (DECL_EXTERNAL (p->decl)) - DECL_EXTERNAL (p->decl) - = lookup_attribute ("weakref", - DECL_ATTRIBUTES (p->decl)) != NULL; - varpool_create_variable_alias (p->decl, target_vnode->symbol.decl); - VEC_unordered_remove (alias_pair, alias_pairs, i); - } + symtab_node target_node = symtab_node_for_asm (p->target); + /* Weakrefs with target not defined in current unit are easy to handle; they behave just as external variables except we need to note the alias flag to later output the weakref pseudo op into asm file. */ - else if (lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)) != NULL - && (TREE_CODE (p->decl) == FUNCTION_DECL - ? (varpool_node_for_asm (p->target) == NULL) - : (cgraph_node_for_asm (p->target) == NULL))) + if (!target_node && lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)) != NULL) { if (TREE_CODE (p->decl) == FUNCTION_DECL) cgraph_get_create_node (p->decl)->alias = true; @@ -1079,17 +1049,50 @@ handle_alias_pairs (void) varpool_get_node (p->decl)->alias = true; DECL_EXTERNAL (p->decl) = 1; VEC_unordered_remove (alias_pair, alias_pairs, i); + continue; } - else + else if (!target_node) { - if (dump_file) - fprintf (dump_file, "Unhandled alias %s->%s\n", - IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (p->decl)), - IDENTIFIER_POINTER (p->target)); + error ("%q+D aliased to undefined symbol %qE", p->decl, p->target); + VEC_unordered_remove (alias_pair, alias_pairs, i); + continue; + } - i++; + /* Normally EXTERNAL flag is used to mark external inlines, + however for aliases it seems to be allowed to use it w/o + any meaning. See gcc.dg/attr-alias-3.c + However for weakref we insist on EXTERNAL flag being set. + See gcc.dg/attr-alias-5.c */ + if (DECL_EXTERNAL (p->decl)) + DECL_EXTERNAL (p->decl) + = lookup_attribute ("weakref", + DECL_ATTRIBUTES (p->decl)) != NULL; + + if (TREE_CODE (p->decl) == FUNCTION_DECL + && target_node && symtab_function_p (target_node)) + { + struct cgraph_node *src_node = cgraph_get_node (p->decl); + if (src_node && src_node->local.finalized) + cgraph_reset_node (src_node); + cgraph_create_function_alias (p->decl, target_node->symbol.decl); + VEC_unordered_remove (alias_pair, alias_pairs, i); + } + else if (TREE_CODE (p->decl) == VAR_DECL + && target_node && symtab_variable_p (target_node)) + { + varpool_create_variable_alias (p->decl, target_node->symbol.decl); + VEC_unordered_remove (alias_pair, alias_pairs, i); + } + else + { + error ("%q+D alias in between function and variable is not supported", + p->decl); + warning (0, "%q+D aliased declaration", + target_node->symbol.decl); + VEC_unordered_remove (alias_pair, alias_pairs, i); } } + VEC_free (alias_pair, gc, alias_pairs); } @@ -1152,6 +1155,7 @@ mark_functions_to_output (void) have analyzed node pointing to it. */ && !node->symbol.in_other_partition && !node->alias + && !node->clones && !DECL_EXTERNAL (decl)) { dump_cgraph_node (stderr, node); @@ -1161,6 +1165,8 @@ mark_functions_to_output (void) gcc_assert (node->global.inlined_to || !gimple_has_body_p (decl) || node->symbol.in_other_partition + || node->clones + || DECL_ARTIFICIAL (decl) || DECL_EXTERNAL (decl)); } @@ -1264,25 +1270,21 @@ thunk_adjust (gimple_stmt_iterator * bsi, } vtabletmp = - create_tmp_var (build_pointer_type - (build_pointer_type (vtable_entry_type)), "vptr"); + make_rename_temp (build_pointer_type + (build_pointer_type (vtable_entry_type)), "vptr"); /* The vptr is always at offset zero in the object. */ stmt = gimple_build_assign (vtabletmp, build1 (NOP_EXPR, TREE_TYPE (vtabletmp), ptr)); gsi_insert_after (bsi, stmt, GSI_NEW_STMT); - mark_symbols_for_renaming (stmt); - find_referenced_vars_in (stmt); /* Form the vtable address. */ - vtabletmp2 = create_tmp_var (TREE_TYPE (TREE_TYPE (vtabletmp)), - "vtableaddr"); + vtabletmp2 = make_rename_temp (TREE_TYPE (TREE_TYPE (vtabletmp)), + "vtableaddr"); stmt = gimple_build_assign (vtabletmp2, build_simple_mem_ref (vtabletmp)); gsi_insert_after (bsi, stmt, GSI_NEW_STMT); - mark_symbols_for_renaming (stmt); - find_referenced_vars_in (stmt); /* Find the entry with the vcall offset. */ stmt = gimple_build_assign (vtabletmp2, @@ -1292,13 +1294,11 @@ thunk_adjust (gimple_stmt_iterator * bsi, gsi_insert_after (bsi, stmt, GSI_NEW_STMT); /* Get the offset itself. */ - vtabletmp3 = create_tmp_var (TREE_TYPE (TREE_TYPE (vtabletmp2)), - "vcalloffset"); + vtabletmp3 = make_rename_temp (TREE_TYPE (TREE_TYPE (vtabletmp2)), + "vcalloffset"); stmt = gimple_build_assign (vtabletmp3, build_simple_mem_ref (vtabletmp2)); gsi_insert_after (bsi, stmt, GSI_NEW_STMT); - mark_symbols_for_renaming (stmt); - find_referenced_vars_in (stmt); /* Adjust the `this' pointer. */ ptr = fold_build_pointer_plus_loc (input_location, ptr, vtabletmp3); @@ -1316,21 +1316,17 @@ thunk_adjust (gimple_stmt_iterator * bsi, ptrtmp = ptr; else { - ptrtmp = create_tmp_var (TREE_TYPE (ptr), "ptr"); + ptrtmp = make_rename_temp (TREE_TYPE (ptr), "ptr"); stmt = gimple_build_assign (ptrtmp, ptr); gsi_insert_after (bsi, stmt, GSI_NEW_STMT); - mark_symbols_for_renaming (stmt); - find_referenced_vars_in (stmt); } ptr = fold_build_pointer_plus_hwi_loc (input_location, ptrtmp, fixed_offset); } /* Emit the statement and gimplify the adjustment expression. */ - ret = create_tmp_var (TREE_TYPE (ptr), "adjusted_this"); + ret = make_rename_temp (TREE_TYPE (ptr), "adjusted_this"); stmt = gimple_build_assign (ret, ptr); - mark_symbols_for_renaming (stmt); - find_referenced_vars_in (stmt); gsi_insert_after (bsi, stmt, GSI_NEW_STMT); return ret; @@ -1434,7 +1430,7 @@ assemble_thunk (struct cgraph_node *node) BLOCK_VARS (DECL_INITIAL (current_function_decl)) = restmp; } else - restmp = create_tmp_var_raw (restype, "retval"); + restmp = make_rename_temp (restype, "retval"); } for (arg = a; arg; arg = DECL_CHAIN (arg)) @@ -1447,17 +1443,22 @@ assemble_thunk (struct cgraph_node *node) virtual_offset)); else VEC_quick_push (tree, vargs, a); + add_referenced_var (a); + if (is_gimple_reg (a)) + mark_sym_for_renaming (a); for (i = 1, arg = DECL_CHAIN (a); i < nargs; i++, arg = DECL_CHAIN (arg)) - VEC_quick_push (tree, vargs, arg); + { + add_referenced_var (arg); + if (is_gimple_reg (arg)) + mark_sym_for_renaming (arg); + VEC_quick_push (tree, vargs, arg); + } call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs); VEC_free (tree, heap, vargs); gimple_call_set_from_thunk (call, true); if (restmp) gimple_call_set_lhs (call, restmp); gsi_insert_after (&bsi, call, GSI_NEW_STMT); - mark_symbols_for_renaming (call); - find_referenced_vars_in (call); - update_stmt (call); if (restmp && !this_adjusting) { @@ -1765,12 +1766,13 @@ output_in_order (void) } FOR_EACH_DEFINED_VARIABLE (pv) - { - i = pv->symbol.order; - gcc_assert (nodes[i].kind == ORDER_UNDEFINED); - nodes[i].kind = ORDER_VAR; - nodes[i].u.v = pv; - } + if (!DECL_EXTERNAL (pv->symbol.decl)) + { + i = pv->symbol.order; + gcc_assert (nodes[i].kind == ORDER_UNDEFINED); + nodes[i].kind = ORDER_VAR; + nodes[i].u.v = pv; + } for (pa = asm_nodes; pa; pa = pa->next) { diff --git a/gcc/config.gcc b/gcc/config.gcc index 6e4666ed7dc..5d73470bebd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2828,6 +2828,13 @@ if test x$with_cpu = x ; then mips*-*-vxworks) with_arch=mips2 ;; + powerpc*-*-*spe*) + if test x$enable_e500_double = xyes; then + with_cpu=8548 + else + with_cpu=8540 + fi + ;; sparc-leon*-*) with_cpu=v8; ;; @@ -3509,11 +3516,6 @@ case ${target} in c_target_objs="${c_target_objs} rs6000-c.o" cxx_target_objs="${cxx_target_objs} rs6000-c.o" tmake_file="rs6000/t-rs6000 ${tmake_file}" - - if test x$enable_e500_double = xyes - then - tm_file="$tm_file rs6000/e500-double.h" - fi ;; sh[123456ble]*-*-* | sh-*-*) diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index cb74d707c21..b3384701f0b 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -245,6 +245,9 @@ struct tune_params extern const struct tune_params *current_tune; extern int vfp3_const_double_for_fract_bits (rtx); + +extern void arm_emit_coreregs_64bit_shift (enum rtx_code, rtx, rtx, rtx, rtx, + rtx); #endif /* RTX_CODE */ extern void arm_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel); diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 2c62c518e67..3ad4c752ac8 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -25933,4 +25933,256 @@ arm_autoinc_modes_ok_p (enum machine_mode mode, enum arm_auto_incmodes code) return false; } +/* The default expansion of general 64-bit shifts in core-regs is suboptimal, + on ARM, since we know that shifts by negative amounts are no-ops. + Additionally, the default expansion code is not available or suitable + for post-reload insn splits (this can occur when the register allocator + chooses not to do a shift in NEON). + + This function is used in both initial expand and post-reload splits, and + handles all kinds of 64-bit shifts. + + Input requirements: + - It is safe for the input and output to be the same register, but + early-clobber rules apply for the shift amount and scratch registers. + - Shift by register requires both scratch registers. Shift by a constant + less than 32 in Thumb2 mode requires SCRATCH1 only. In all other cases + the scratch registers may be NULL. + - Ashiftrt by a register also clobbers the CC register. */ +void +arm_emit_coreregs_64bit_shift (enum rtx_code code, rtx out, rtx in, + rtx amount, rtx scratch1, rtx scratch2) +{ + rtx out_high = gen_highpart (SImode, out); + rtx out_low = gen_lowpart (SImode, out); + rtx in_high = gen_highpart (SImode, in); + rtx in_low = gen_lowpart (SImode, in); + + /* Terminology: + in = the register pair containing the input value. + out = the destination register pair. + up = the high- or low-part of each pair. + down = the opposite part to "up". + In a shift, we can consider bits to shift from "up"-stream to + "down"-stream, so in a left-shift "up" is the low-part and "down" + is the high-part of each register pair. */ + + rtx out_up = code == ASHIFT ? out_low : out_high; + rtx out_down = code == ASHIFT ? out_high : out_low; + rtx in_up = code == ASHIFT ? in_low : in_high; + rtx in_down = code == ASHIFT ? in_high : in_low; + + gcc_assert (code == ASHIFT || code == ASHIFTRT || code == LSHIFTRT); + gcc_assert (out + && (REG_P (out) || GET_CODE (out) == SUBREG) + && GET_MODE (out) == DImode); + gcc_assert (in + && (REG_P (in) || GET_CODE (in) == SUBREG) + && GET_MODE (in) == DImode); + gcc_assert (amount + && (((REG_P (amount) || GET_CODE (amount) == SUBREG) + && GET_MODE (amount) == SImode) + || CONST_INT_P (amount))); + gcc_assert (scratch1 == NULL + || (GET_CODE (scratch1) == SCRATCH) + || (GET_MODE (scratch1) == SImode + && REG_P (scratch1))); + gcc_assert (scratch2 == NULL + || (GET_CODE (scratch2) == SCRATCH) + || (GET_MODE (scratch2) == SImode + && REG_P (scratch2))); + gcc_assert (!REG_P (out) || !REG_P (amount) + || !HARD_REGISTER_P (out) + || (REGNO (out) != REGNO (amount) + && REGNO (out) + 1 != REGNO (amount))); + + /* Macros to make following code more readable. */ + #define SUB_32(DEST,SRC) \ + gen_addsi3 ((DEST), (SRC), gen_rtx_CONST_INT (VOIDmode, -32)) + #define RSB_32(DEST,SRC) \ + gen_subsi3 ((DEST), gen_rtx_CONST_INT (VOIDmode, 32), (SRC)) + #define SUB_S_32(DEST,SRC) \ + gen_addsi3_compare0 ((DEST), (SRC), \ + gen_rtx_CONST_INT (VOIDmode, -32)) + #define SET(DEST,SRC) \ + gen_rtx_SET (SImode, (DEST), (SRC)) + #define SHIFT(CODE,SRC,AMOUNT) \ + gen_rtx_fmt_ee ((CODE), SImode, (SRC), (AMOUNT)) + #define LSHIFT(CODE,SRC,AMOUNT) \ + gen_rtx_fmt_ee ((CODE) == ASHIFT ? ASHIFT : LSHIFTRT, \ + SImode, (SRC), (AMOUNT)) + #define REV_LSHIFT(CODE,SRC,AMOUNT) \ + gen_rtx_fmt_ee ((CODE) == ASHIFT ? LSHIFTRT : ASHIFT, \ + SImode, (SRC), (AMOUNT)) + #define ORR(A,B) \ + gen_rtx_IOR (SImode, (A), (B)) + #define BRANCH(COND,LABEL) \ + gen_arm_cond_branch ((LABEL), \ + gen_rtx_ ## COND (CCmode, cc_reg, \ + const0_rtx), \ + cc_reg) + + /* Shifts by register and shifts by constant are handled separately. */ + if (CONST_INT_P (amount)) + { + /* We have a shift-by-constant. */ + + /* First, handle out-of-range shift amounts. + In both cases we try to match the result an ARM instruction in a + shift-by-register would give. This helps reduce execution + differences between optimization levels, but it won't stop other + parts of the compiler doing different things. This is "undefined + behaviour, in any case. */ + if (INTVAL (amount) <= 0) + emit_insn (gen_movdi (out, in)); + else if (INTVAL (amount) >= 64) + { + if (code == ASHIFTRT) + { + rtx const31_rtx = gen_rtx_CONST_INT (VOIDmode, 31); + emit_insn (SET (out_down, SHIFT (code, in_up, const31_rtx))); + emit_insn (SET (out_up, SHIFT (code, in_up, const31_rtx))); + } + else + emit_insn (gen_movdi (out, const0_rtx)); + } + + /* Now handle valid shifts. */ + else if (INTVAL (amount) < 32) + { + /* Shifts by a constant less than 32. */ + rtx reverse_amount = gen_rtx_CONST_INT (VOIDmode, + 32 - INTVAL (amount)); + + emit_insn (SET (out_down, LSHIFT (code, in_down, amount))); + emit_insn (SET (out_down, + ORR (REV_LSHIFT (code, in_up, reverse_amount), + out_down))); + emit_insn (SET (out_up, SHIFT (code, in_up, amount))); + } + else + { + /* Shifts by a constant greater than 31. */ + rtx adj_amount = gen_rtx_CONST_INT (VOIDmode, INTVAL (amount) - 32); + + emit_insn (SET (out_down, SHIFT (code, in_up, adj_amount))); + if (code == ASHIFTRT) + emit_insn (gen_ashrsi3 (out_up, in_up, + gen_rtx_CONST_INT (VOIDmode, 31))); + else + emit_insn (SET (out_up, const0_rtx)); + } + } + else + { + /* We have a shift-by-register. */ + rtx cc_reg = gen_rtx_REG (CC_NOOVmode, CC_REGNUM); + + /* This alternative requires the scratch registers. */ + gcc_assert (scratch1 && REG_P (scratch1)); + gcc_assert (scratch2 && REG_P (scratch2)); + + /* We will need the values "amount-32" and "32-amount" later. + Swapping them around now allows the later code to be more general. */ + switch (code) + { + case ASHIFT: + emit_insn (SUB_32 (scratch1, amount)); + emit_insn (RSB_32 (scratch2, amount)); + break; + case ASHIFTRT: + emit_insn (RSB_32 (scratch1, amount)); + /* Also set CC = amount > 32. */ + emit_insn (SUB_S_32 (scratch2, amount)); + break; + case LSHIFTRT: + emit_insn (RSB_32 (scratch1, amount)); + emit_insn (SUB_32 (scratch2, amount)); + break; + default: + gcc_unreachable (); + } + + /* Emit code like this: + + arithmetic-left: + out_down = in_down << amount; + out_down = (in_up << (amount - 32)) | out_down; + out_down = ((unsigned)in_up >> (32 - amount)) | out_down; + out_up = in_up << amount; + + arithmetic-right: + out_down = in_down >> amount; + out_down = (in_up << (32 - amount)) | out_down; + if (amount < 32) + out_down = ((signed)in_up >> (amount - 32)) | out_down; + out_up = in_up << amount; + + logical-right: + out_down = in_down >> amount; + out_down = (in_up << (32 - amount)) | out_down; + if (amount < 32) + out_down = ((unsigned)in_up >> (amount - 32)) | out_down; + out_up = in_up << amount; + + The ARM and Thumb2 variants are the same but implemented slightly + differently. If this were only called during expand we could just + use the Thumb2 case and let combine do the right thing, but this + can also be called from post-reload splitters. */ + + emit_insn (SET (out_down, LSHIFT (code, in_down, amount))); + + if (!TARGET_THUMB2) + { + /* Emit code for ARM mode. */ + emit_insn (SET (out_down, + ORR (SHIFT (ASHIFT, in_up, scratch1), out_down))); + if (code == ASHIFTRT) + { + rtx done_label = gen_label_rtx (); + emit_jump_insn (BRANCH (LT, done_label)); + emit_insn (SET (out_down, ORR (SHIFT (ASHIFTRT, in_up, scratch2), + out_down))); + emit_label (done_label); + } + else + emit_insn (SET (out_down, ORR (SHIFT (LSHIFTRT, in_up, scratch2), + out_down))); + } + else + { + /* Emit code for Thumb2 mode. + Thumb2 can't do shift and or in one insn. */ + emit_insn (SET (scratch1, SHIFT (ASHIFT, in_up, scratch1))); + emit_insn (gen_iorsi3 (out_down, out_down, scratch1)); + + if (code == ASHIFTRT) + { + rtx done_label = gen_label_rtx (); + emit_jump_insn (BRANCH (LT, done_label)); + emit_insn (SET (scratch2, SHIFT (ASHIFTRT, in_up, scratch2))); + emit_insn (SET (out_down, ORR (out_down, scratch2))); + emit_label (done_label); + } + else + { + emit_insn (SET (scratch2, SHIFT (LSHIFTRT, in_up, scratch2))); + emit_insn (gen_iorsi3 (out_down, out_down, scratch2)); + } + } + + emit_insn (SET (out_up, SHIFT (code, in_up, amount))); + } + + #undef SUB_32 + #undef RSB_32 + #undef SUB_S_32 + #undef SET + #undef SHIFT + #undef LSHIFT + #undef REV_LSHIFT + #undef ORR + #undef BRANCH +} + #include "gt-arm.h" diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index b1ad3bf34eb..bc97a4a3f78 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -3520,21 +3520,37 @@ (match_operand:SI 2 "reg_or_int_operand" "")))] "TARGET_32BIT" " - if (GET_CODE (operands[2]) == CONST_INT) + if (!CONST_INT_P (operands[2]) + && (TARGET_REALLY_IWMMXT || (TARGET_HARD_FLOAT && TARGET_MAVERICK))) + ; /* No special preparation statements; expand pattern as above. */ + else { - if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + rtx scratch1, scratch2; + + if (CONST_INT_P (operands[2]) + && (HOST_WIDE_INT) INTVAL (operands[2]) == 1) { emit_insn (gen_arm_ashldi3_1bit (operands[0], operands[1])); DONE; } - /* Ideally we shouldn't fail here if we could know that operands[1] - ends up already living in an iwmmxt register. Otherwise it's - cheaper to have the alternate code being generated than moving - values to iwmmxt regs and back. */ - FAIL; + + /* Ideally we should use iwmmxt here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + + /* If we're optimizing for size, we prefer the libgcc calls. */ + if (optimize_function_for_size_p (cfun)) + FAIL; + + /* Expand operation using core-registers. + 'FAIL' would achieve the same thing, but this is a bit smarter. */ + scratch1 = gen_reg_rtx (SImode); + scratch2 = gen_reg_rtx (SImode); + arm_emit_coreregs_64bit_shift (ASHIFT, operands[0], operands[1], + operands[2], scratch1, scratch2); + DONE; } - else if (!TARGET_REALLY_IWMMXT && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)) - FAIL; " ) @@ -3579,21 +3595,37 @@ (match_operand:SI 2 "reg_or_int_operand" "")))] "TARGET_32BIT" " - if (GET_CODE (operands[2]) == CONST_INT) + if (!CONST_INT_P (operands[2]) + && (TARGET_REALLY_IWMMXT || (TARGET_HARD_FLOAT && TARGET_MAVERICK))) + ; /* No special preparation statements; expand pattern as above. */ + else { - if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + rtx scratch1, scratch2; + + if (CONST_INT_P (operands[2]) + && (HOST_WIDE_INT) INTVAL (operands[2]) == 1) { emit_insn (gen_arm_ashrdi3_1bit (operands[0], operands[1])); DONE; } - /* Ideally we shouldn't fail here if we could know that operands[1] - ends up already living in an iwmmxt register. Otherwise it's - cheaper to have the alternate code being generated than moving - values to iwmmxt regs and back. */ - FAIL; + + /* Ideally we should use iwmmxt here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + + /* If we're optimizing for size, we prefer the libgcc calls. */ + if (optimize_function_for_size_p (cfun)) + FAIL; + + /* Expand operation using core-registers. + 'FAIL' would achieve the same thing, but this is a bit smarter. */ + scratch1 = gen_reg_rtx (SImode); + scratch2 = gen_reg_rtx (SImode); + arm_emit_coreregs_64bit_shift (ASHIFTRT, operands[0], operands[1], + operands[2], scratch1, scratch2); + DONE; } - else if (!TARGET_REALLY_IWMMXT) - FAIL; " ) @@ -3636,21 +3668,37 @@ (match_operand:SI 2 "reg_or_int_operand" "")))] "TARGET_32BIT" " - if (GET_CODE (operands[2]) == CONST_INT) + if (!CONST_INT_P (operands[2]) + && (TARGET_REALLY_IWMMXT || (TARGET_HARD_FLOAT && TARGET_MAVERICK))) + ; /* No special preparation statements; expand pattern as above. */ + else { - if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + rtx scratch1, scratch2; + + if (CONST_INT_P (operands[2]) + && (HOST_WIDE_INT) INTVAL (operands[2]) == 1) { emit_insn (gen_arm_lshrdi3_1bit (operands[0], operands[1])); DONE; } - /* Ideally we shouldn't fail here if we could know that operands[1] - ends up already living in an iwmmxt register. Otherwise it's - cheaper to have the alternate code being generated than moving - values to iwmmxt regs and back. */ - FAIL; + + /* Ideally we should use iwmmxt here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + + /* If we're optimizing for size, we prefer the libgcc calls. */ + if (optimize_function_for_size_p (cfun)) + FAIL; + + /* Expand operation using core-registers. + 'FAIL' would achieve the same thing, but this is a bit smarter. */ + scratch1 = gen_reg_rtx (SImode); + scratch2 = gen_reg_rtx (SImode); + arm_emit_coreregs_64bit_shift (LSHIFTRT, operands[0], operands[1], + operands[2], scratch1, scratch2); + DONE; } - else if (!TARGET_REALLY_IWMMXT) - FAIL; " ) @@ -7755,7 +7803,7 @@ ;; Patterns to match conditional branch insns. ;; -(define_insn "*arm_cond_branch" +(define_insn "arm_cond_branch" [(set (pc) (if_then_else (match_operator 1 "arm_comparison_operator" [(match_operand 2 "cc_register" "") (const_int 0)]) diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index e93e8d9e5e7..94f38199f10 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -398,6 +398,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) unsigned int has_fma = 0, has_fma4 = 0, has_xop = 0; unsigned int has_bmi = 0, has_bmi2 = 0, has_tbm = 0, has_lzcnt = 0; unsigned int has_hle = 0, has_rtm = 0; + unsigned int has_rdrnd = 0, has_f16c = 0, has_fsgsbase = 0; bool arch; @@ -445,6 +446,8 @@ const char *host_detect_local_cpu (int argc, const char **argv) has_aes = ecx & bit_AES; has_pclmul = ecx & bit_PCLMUL; has_fma = ecx & bit_FMA; + has_f16c = ecx & bit_F16C; + has_rdrnd = ecx & bit_RDRND; has_cmpxchg8b = edx & bit_CMPXCHG8B; has_cmov = edx & bit_CMOV; @@ -461,6 +464,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) has_rtm = ebx & bit_RTM; has_avx2 = ebx & bit_AVX2; has_bmi2 = ebx & bit_BMI2; + has_fsgsbase = ebx & bit_FSGSBASE; } /* Check cpuid level of extended features. */ @@ -733,11 +737,14 @@ const char *host_detect_local_cpu (int argc, const char **argv) const char *lzcnt = has_lzcnt ? " -mlzcnt" : " -mno-lzcnt"; const char *hle = has_hle ? " -mhle" : " -mno-hle"; const char *rtm = has_rtm ? " -mrtm" : " -mno-rtm"; + const char *rdrnd = has_rdrnd ? " -mrdrnd" : " -mno-rdrnd"; + const char *f16c = has_f16c ? " -mf16c" : " -mno-f16c"; + const char *fsgsbase = has_fsgsbase ? " -mfsgsbase" : " -mno-fsgsbase"; options = concat (options, cx16, sahf, movbe, ase, pclmul, popcnt, abm, lwp, fma, fma4, xop, bmi, bmi2, tbm, avx, avx2, sse4_2, sse4_1, lzcnt, rtm, - hle, NULL); + hle, rdrnd, f16c, fsgsbase, NULL); } done: diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 01e2421de7d..67281d84bca 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -17465,6 +17465,9 @@ "(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ()) && peep2_reg_dead_p (4, operands[0]) && !reg_overlap_mentioned_p (operands[0], operands[1]) + && (<MODE>mode != QImode + || immediate_operand (operands[2], QImode) + || q_regs_operand (operands[2], QImode)) && ix86_match_ccmode (peep2_next_insn (3), (GET_CODE (operands[3]) == PLUS || GET_CODE (operands[3]) == MINUS) diff --git a/gcc/config/m68k/m68k-devices.def b/gcc/config/m68k/m68k-devices.def index 4838fb06296..41e11c88bd2 100644 --- a/gcc/config/m68k/m68k-devices.def +++ b/gcc/config/m68k/m68k-devices.def @@ -84,10 +84,16 @@ M68K_DEVICE ("cpu32", cpu32, "cpu32", "cpu32", cpu32, isa_cpu32, FL_MMU) /* For historical reasons, the 51 multilib is named 51qe. */ M68K_DEVICE ("51", mcf51, "51", "51qe", cfv1, isa_c, FL_CF_USP) M68K_DEVICE ("51ac", mcf51ac, "51", "51qe", cfv1, isa_c, FL_CF_USP) +M68K_DEVICE ("51ag", mcf51ag, "51", "51qe", cfv1, isa_c, FL_CF_USP) M68K_DEVICE ("51cn", mcf51cn, "51", "51qe", cfv1, isa_c, FL_CF_USP) M68K_DEVICE ("51em", mcf51em, "51", "51qe", cfv1, isa_c, FL_CF_USP | FL_CF_MAC) +M68K_DEVICE ("51je", mcf51je, "51", "51qe", cfv1, isa_c, FL_CF_USP | FL_CF_MAC) +M68K_DEVICE ("51jf", mcf51jf, "51", "51qe", cfv1, isa_c, FL_CF_USP | FL_CF_EMAC) +M68K_DEVICE ("51jg", mcf51jg, "51", "51qe", cfv1, isa_c, FL_CF_USP | FL_CF_EMAC) M68K_DEVICE ("51jm", mcf51jm, "51", "51qe", cfv1, isa_c, FL_CF_USP) +M68K_DEVICE ("51mm", mcf51mm, "51", "51qe", cfv1, isa_c, FL_CF_USP | FL_CF_MAC) M68K_DEVICE ("51qe", mcf51qe, "51", "51qe", cfv1, isa_c, FL_CF_USP) +M68K_DEVICE ("51qm", mcf51qm, "51", "51qe", cfv1, isa_c, FL_CF_USP | FL_CF_EMAC) /* ColdFire CFV2 processors. */ M68K_DEVICE ("5202", mcf5202, "5206", "5206", cfv2, isa_a, 0) diff --git a/gcc/config/m68k/m68k-tables.opt b/gcc/config/m68k/m68k-tables.opt index 96eabc7f262..6cac87535ac 100644 --- a/gcc/config/m68k/m68k-tables.opt +++ b/gcc/config/m68k/m68k-tables.opt @@ -58,18 +58,36 @@ EnumValue Enum(target_device) String(51ac) Value(mcf51ac) EnumValue +Enum(target_device) String(51ag) Value(mcf51ag) + +EnumValue Enum(target_device) String(51cn) Value(mcf51cn) EnumValue Enum(target_device) String(51em) Value(mcf51em) EnumValue +Enum(target_device) String(51je) Value(mcf51je) + +EnumValue +Enum(target_device) String(51jf) Value(mcf51jf) + +EnumValue +Enum(target_device) String(51jg) Value(mcf51jg) + +EnumValue Enum(target_device) String(51jm) Value(mcf51jm) EnumValue +Enum(target_device) String(51mm) Value(mcf51mm) + +EnumValue Enum(target_device) String(51qe) Value(mcf51qe) EnumValue +Enum(target_device) String(51qm) Value(mcf51qm) + +EnumValue Enum(target_device) String(5202) Value(mcf5202) EnumValue diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index a7ad6268bdd..8a7e6858c11 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -7190,12 +7190,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" (set (attr "length") (symbol_ref "pa_attr_length_call (insn, 0)"))]) (define_insn "call_symref_pic" - [(set (match_operand:SI 2 "register_operand" "=&r") (reg:SI 19)) - (call (mem:SI (match_operand 0 "call_operand_address" "")) + [(call (mem:SI (match_operand 0 "call_operand_address" "")) (match_operand 1 "" "i")) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:SI 19)) (use (const_int 0))] "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT" @@ -7211,12 +7210,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; terminate the basic block. The split has to contain more than one ;; insn. (define_split - [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19)) - (call (mem:SI (match_operand 0 "call_operand_address" "")) + [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" "")) (match_operand 1 "" "")) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:SI 19)) (use (const_int 0))])] "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed @@ -7231,12 +7229,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "") (define_split - [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19)) - (call (mem:SI (match_operand 0 "call_operand_address" "")) + [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" "")) (match_operand 1 "" "")) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:SI 19)) (use (const_int 0))])] "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed" @@ -7269,12 +7266,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; This pattern is split if it is necessary to save and restore the ;; PIC register. (define_insn "call_symref_64bit" - [(set (match_operand:DI 2 "register_operand" "=&r") (reg:DI 27)) - (call (mem:SI (match_operand 0 "call_operand_address" "")) + [(call (mem:SI (match_operand 0 "call_operand_address" "")) (match_operand 1 "" "i")) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 0))] @@ -7291,12 +7287,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; terminate the basic block. The split has to contain more than one ;; insn. (define_split - [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27)) - (call (mem:SI (match_operand 0 "call_operand_address" "")) + [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" "")) (match_operand 1 "" "")) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 0))])] @@ -7313,12 +7308,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "") (define_split - [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27)) - (call (mem:SI (match_operand 0 "call_operand_address" "")) + [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" "")) (match_operand 1 "" "")) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 0))])] @@ -7368,12 +7362,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; This pattern is split if it is necessary to save and restore the ;; PIC register. (define_insn "call_reg_pic" - [(set (match_operand:SI 1 "register_operand" "=&r") (reg:SI 19)) - (call (mem:SI (reg:SI 22)) + [(call (mem:SI (reg:SI 22)) (match_operand 0 "" "i")) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 1)) + (clobber (match_operand 1)) (use (reg:SI 19)) (use (const_int 1))] "!TARGET_64BIT" @@ -7389,12 +7382,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; terminate the basic block. The split has to contain more than one ;; insn. (define_split - [(parallel [(set (match_operand:SI 1 "register_operand" "") (reg:SI 19)) - (call (mem:SI (reg:SI 22)) + [(parallel [(call (mem:SI (reg:SI 22)) (match_operand 0 "" "")) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 1)) + (clobber (match_operand 1)) (use (reg:SI 19)) (use (const_int 1))])] "!TARGET_64BIT && reload_completed @@ -7409,12 +7401,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "") (define_split - [(parallel [(set (match_operand:SI 1 "register_operand" "") (reg:SI 19)) - (call (mem:SI (reg:SI 22)) + [(parallel [(call (mem:SI (reg:SI 22)) (match_operand 0 "" "")) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 1)) + (clobber (match_operand 1)) (use (reg:SI 19)) (use (const_int 1))])] "!TARGET_64BIT && reload_completed" @@ -7446,12 +7437,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; This pattern is split if it is necessary to save and restore the ;; PIC register. (define_insn "call_reg_64bit" - [(set (match_operand:DI 2 "register_operand" "=&r") (reg:DI 27)) - (call (mem:SI (match_operand:DI 0 "register_operand" "r")) + [(call (mem:SI (match_operand:DI 0 "register_operand" "r")) (match_operand 1 "" "i")) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 1))] @@ -7468,12 +7458,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; terminate the basic block. The split has to contain more than one ;; insn. (define_split - [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27)) - (call (mem:SI (match_operand 0 "register_operand" "")) + [(parallel [(call (mem:SI (match_operand 0 "register_operand" "")) (match_operand 1 "" "")) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 1))])] @@ -7490,12 +7479,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "") (define_split - [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27)) - (call (mem:SI (match_operand 0 "register_operand" "")) + [(parallel [(call (mem:SI (match_operand 0 "register_operand" "")) (match_operand 1 "" "")) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 1))])] @@ -7654,13 +7642,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" (set (attr "length") (symbol_ref "pa_attr_length_call (insn, 0)"))]) (define_insn "call_val_symref_pic" - [(set (match_operand:SI 3 "register_operand" "=&r") (reg:SI 19)) - (set (match_operand 0 "" "") + [(set (match_operand 0 "" "") (call (mem:SI (match_operand 1 "call_operand_address" "")) (match_operand 2 "" "i"))) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 3)) + (clobber (match_operand 3)) (use (reg:SI 19)) (use (const_int 0))] "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT" @@ -7676,13 +7663,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; terminate the basic block. The split has to contain more than one ;; insn. (define_split - [(parallel [(set (match_operand:SI 3 "register_operand" "") (reg:SI 19)) - (set (match_operand 0 "" "") + [(parallel [(set (match_operand 0 "" "") (call (mem:SI (match_operand 1 "call_operand_address" "")) (match_operand 2 "" ""))) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 3)) + (clobber (match_operand 3)) (use (reg:SI 19)) (use (const_int 0))])] "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed @@ -7698,13 +7684,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "") (define_split - [(parallel [(set (match_operand:SI 3 "register_operand" "") (reg:SI 19)) - (set (match_operand 0 "" "") + [(parallel [(set (match_operand 0 "" "") (call (mem:SI (match_operand 1 "call_operand_address" "")) (match_operand 2 "" ""))) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 3)) + (clobber (match_operand 3)) (use (reg:SI 19)) (use (const_int 0))])] "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed" @@ -7739,13 +7724,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; This pattern is split if it is necessary to save and restore the ;; PIC register. (define_insn "call_val_symref_64bit" - [(set (match_operand:DI 3 "register_operand" "=&r") (reg:DI 27)) - (set (match_operand 0 "" "") + [(set (match_operand 0 "" "") (call (mem:SI (match_operand 1 "call_operand_address" "")) (match_operand 2 "" "i"))) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 3)) + (clobber (match_operand 3)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 0))] @@ -7762,13 +7746,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; terminate the basic block. The split has to contain more than one ;; insn. (define_split - [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27)) - (set (match_operand 0 "" "") + [(parallel [(set (match_operand 0 "" "") (call (mem:SI (match_operand 1 "call_operand_address" "")) (match_operand 2 "" ""))) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 3)) + (clobber (match_operand 3)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 0))])] @@ -7786,13 +7769,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "") (define_split - [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27)) - (set (match_operand 0 "" "") + [(parallel [(set (match_operand 0 "" "") (call (mem:SI (match_operand 1 "call_operand_address" "")) (match_operand 2 "" ""))) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 3)) + (clobber (match_operand 3)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 0))])] @@ -7845,13 +7827,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; This pattern is split if it is necessary to save and restore the ;; PIC register. (define_insn "call_val_reg_pic" - [(set (match_operand:SI 2 "register_operand" "=&r") (reg:SI 19)) - (set (match_operand 0 "" "") + [(set (match_operand 0 "" "") (call (mem:SI (reg:SI 22)) (match_operand 1 "" "i"))) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:SI 19)) (use (const_int 1))] "!TARGET_64BIT" @@ -7867,13 +7848,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; terminate the basic block. The split has to contain more than one ;; insn. (define_split - [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19)) - (set (match_operand 0 "" "") + [(parallel [(set (match_operand 0 "" "") (call (mem:SI (reg:SI 22)) (match_operand 1 "" ""))) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:SI 19)) (use (const_int 1))])] "!TARGET_64BIT && reload_completed @@ -7889,13 +7869,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "") (define_split - [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19)) - (set (match_operand 0 "" "") + [(parallel [(set (match_operand 0 "" "") (call (mem:SI (reg:SI 22)) (match_operand 1 "" ""))) (clobber (reg:SI 1)) (clobber (reg:SI 2)) - (use (match_dup 2)) + (clobber (match_operand 2)) (use (reg:SI 19)) (use (const_int 1))])] "!TARGET_64BIT && reload_completed" @@ -7929,13 +7908,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; This pattern is split if it is necessary to save and restore the ;; PIC register. (define_insn "call_val_reg_64bit" - [(set (match_operand:DI 3 "register_operand" "=&r") (reg:DI 27)) - (set (match_operand 0 "" "") + [(set (match_operand 0 "" "") (call (mem:SI (match_operand:DI 1 "register_operand" "r")) (match_operand 2 "" "i"))) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 3)) + (clobber (match_operand 3)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 1))] @@ -7952,13 +7930,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" ;; terminate the basic block. The split has to contain more than one ;; insn. (define_split - [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27)) - (set (match_operand 0 "" "") + [(parallel [(set (match_operand 0 "" "") (call (mem:SI (match_operand:DI 1 "register_operand" "")) (match_operand 2 "" ""))) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 3)) + (clobber (match_operand 3)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 1))])] @@ -7976,13 +7953,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" "") (define_split - [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27)) - (set (match_operand 0 "" "") + [(parallel [(set (match_operand 0 "" "") (call (mem:SI (match_operand:DI 1 "register_operand" "")) (match_operand 2 "" ""))) (clobber (reg:DI 1)) (clobber (reg:DI 2)) - (use (match_dup 3)) + (clobber (match_operand 3)) (use (reg:DI 27)) (use (reg:DI 29)) (use (const_int 1))])] diff --git a/gcc/config/rs6000/8540.md b/gcc/config/rs6000/8540.md index 4096dff432c..c767c0d8aa3 100644 --- a/gcc/config/rs6000/8540.md +++ b/gcc/config/rs6000/8540.md @@ -87,18 +87,18 @@ (and (eq_attr "type" "integer,insert_word,insert_dword,cmp,compare,\ delayed_compare,var_delayed_compare,fast_compare,\ shift,trap,var_shift_rotate,cntlz,exts,isel") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire") (define_insn_reservation "ppc8540_two" 1 (and (eq_attr "type" "two") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire,\ ppc8540_issue+ppc8540_su_stage0+ppc8540_retire") (define_insn_reservation "ppc8540_three" 1 (and (eq_attr "type" "three") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire,\ ppc8540_issue+ppc8540_su_stage0+ppc8540_retire,\ ppc8540_issue+ppc8540_su_stage0+ppc8540_retire") @@ -106,13 +106,13 @@ ;; Branch. Actually this latency time is not used by the scheduler. (define_insn_reservation "ppc8540_branch" 1 (and (eq_attr "type" "jmpreg,branch,isync") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_bu,ppc8540_retire") ;; Multiply (define_insn_reservation "ppc8540_multiply" 4 (and (eq_attr "type" "imul,imul2,imul3,imul_compare") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_mu_stage0,ppc8540_mu_stage1,\ ppc8540_mu_stage2,ppc8540_mu_stage3+ppc8540_retire") @@ -122,57 +122,57 @@ ;; time. (define_insn_reservation "ppc8540_divide" 14 (and (eq_attr "type" "idiv") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_mu_stage0+ppc8540_mu_div,\ ppc8540_mu_div*13") ;; CR logical (define_insn_reservation "ppc8540_cr_logical" 1 (and (eq_attr "type" "cr_logical,delayed_cr") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_bu,ppc8540_retire") ;; Mfcr (define_insn_reservation "ppc8540_mfcr" 1 (and (eq_attr "type" "mfcr") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su1_stage0+ppc8540_retire") ;; Mtcrf (define_insn_reservation "ppc8540_mtcrf" 1 (and (eq_attr "type" "mtcr") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su1_stage0+ppc8540_retire") ;; Mtjmpr (define_insn_reservation "ppc8540_mtjmpr" 1 (and (eq_attr "type" "mtjmpr,mfjmpr") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire") ;; Loads (define_insn_reservation "ppc8540_load" 3 (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,\ load_l,sync") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_lsu,nothing,ppc8540_retire") ;; Stores. (define_insn_reservation "ppc8540_store" 3 (and (eq_attr "type" "store,store_ux,store_u,store_c") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_lsu,nothing,ppc8540_retire") ;; Simple FP (define_insn_reservation "ppc8540_simple_float" 1 (and (eq_attr "type" "fpsimple") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire") ;; FP (define_insn_reservation "ppc8540_float" 4 (and (eq_attr "type" "fp") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_mu_stage0,ppc8540_mu_stage1,\ ppc8540_mu_stage2,ppc8540_mu_stage3+ppc8540_retire") @@ -180,44 +180,44 @@ ;; because of the result automata will be huge. (define_insn_reservation "ppc8540_float_vector_divide" 29 (and (eq_attr "type" "vecfdiv") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_mu_stage0+ppc8540_mu_div,\ ppc8540_mu_div*28") ;; Brinc (define_insn_reservation "ppc8540_brinc" 1 (and (eq_attr "type" "brinc") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire") ;; Simple vector (define_insn_reservation "ppc8540_simple_vector" 1 (and (eq_attr "type" "vecsimple") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su1_stage0+ppc8540_retire") ;; Simple vector compare (define_insn_reservation "ppc8540_simple_vector_compare" 1 (and (eq_attr "type" "veccmpsimple") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire") ;; Vector compare (define_insn_reservation "ppc8540_vector_compare" 1 (and (eq_attr "type" "veccmp") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su1_stage0+ppc8540_retire") ;; evsplatfi evsplati (define_insn_reservation "ppc8540_vector_perm" 1 (and (eq_attr "type" "vecperm") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_su1_stage0+ppc8540_retire") ;; Vector float (define_insn_reservation "ppc8540_float_vector" 4 (and (eq_attr "type" "vecfloat") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_mu_stage0,ppc8540_mu_stage1,\ ppc8540_mu_stage2,ppc8540_mu_stage3+ppc8540_retire") @@ -226,25 +226,25 @@ ;; of miu_stage3 here because we use the average latency time. (define_insn_reservation "ppc8540_vector_divide" 14 (and (eq_attr "type" "vecdiv") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_mu_stage0+ppc8540_mu_div,\ ppc8540_mu_div*13") ;; Complex vector. (define_insn_reservation "ppc8540_complex_vector" 4 (and (eq_attr "type" "veccomplex") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_mu_stage0,ppc8540_mu_stage1,\ ppc8540_mu_stage2,ppc8540_mu_stage3+ppc8540_retire") ;; Vector load (define_insn_reservation "ppc8540_vector_load" 3 (and (eq_attr "type" "vecload") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_lsu,nothing,ppc8540_retire") ;; Vector store (define_insn_reservation "ppc8540_vector_store" 3 (and (eq_attr "type" "vecstore") - (eq_attr "cpu" "ppc8540")) + (eq_attr "cpu" "ppc8540,ppc8548")) "ppc8540_decode,ppc8540_issue+ppc8540_lsu,nothing,ppc8540_retire") diff --git a/gcc/config/rs6000/e500-double.h b/gcc/config/rs6000/e500-double.h deleted file mode 100644 index 2e73dd94c1b..00000000000 --- a/gcc/config/rs6000/e500-double.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Target definitions for E500 with double precision FP. - Copyright (C) 2004, 2006, 2007, 2011 Free Software Foundation, Inc. - Contributed by Aldy Hernandez (aldyh@redhat.com). - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. - - GCC is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING3. If not see - <http://www.gnu.org/licenses/>. */ - -#undef SUB3TARGET_OVERRIDE_OPTIONS -#define SUB3TARGET_OVERRIDE_OPTIONS \ - if (!global_options_set.x_rs6000_float_gprs) \ - rs6000_float_gprs = 2; diff --git a/gcc/config/rs6000/e500.h b/gcc/config/rs6000/e500.h index 807df0900a5..53a849a8646 100644 --- a/gcc/config/rs6000/e500.h +++ b/gcc/config/rs6000/e500.h @@ -19,7 +19,6 @@ #undef TARGET_SPE_ABI #undef TARGET_SPE -#undef TARGET_E500 #undef TARGET_FPRS #undef TARGET_E500_SINGLE #undef TARGET_E500_DOUBLE @@ -27,21 +26,20 @@ #define TARGET_SPE_ABI rs6000_spe_abi #define TARGET_SPE rs6000_spe -#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540) #define TARGET_FPRS (rs6000_float_gprs == 0) #define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1) #define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2) #define CHECK_E500_OPTIONS \ do { \ - if (TARGET_E500 || TARGET_SPE || TARGET_SPE_ABI \ + if (TARGET_SPE || TARGET_SPE_ABI \ || TARGET_E500_SINGLE || TARGET_E500_DOUBLE) \ { \ if (TARGET_ALTIVEC) \ - error ("AltiVec and E500 instructions cannot coexist"); \ + error ("AltiVec and SPE instructions cannot coexist"); \ if (TARGET_VSX) \ - error ("VSX and E500 instructions cannot coexist"); \ + error ("VSX and SPE instructions cannot coexist"); \ if (TARGET_64BIT) \ - error ("64-bit E500 not supported"); \ + error ("64-bit SPE not supported"); \ if (TARGET_HARD_FLOAT && TARGET_FPRS) \ error ("E500 and FPRs not supported"); \ } \ diff --git a/gcc/config/rs6000/eabispe.h b/gcc/config/rs6000/eabispe.h index 19f24726c2e..e7ffbe3decb 100644 --- a/gcc/config/rs6000/eabispe.h +++ b/gcc/config/rs6000/eabispe.h @@ -21,21 +21,8 @@ <http://www.gnu.org/licenses/>. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI \ - | MASK_STRICT_ALIGN) - -#undef SUBSUBTARGET_OVERRIDE_OPTIONS -#define SUBSUBTARGET_OVERRIDE_OPTIONS \ - if (!global_options_set.x_rs6000_cpu_index) \ - rs6000_cpu = PROCESSOR_PPC8540; \ - if (!global_options_set.x_rs6000_spe_abi) \ - rs6000_spe_abi = 1; \ - if (!global_options_set.x_rs6000_float_gprs) \ - rs6000_float_gprs = 1; \ - if (!global_options_set.x_rs6000_spe) \ - rs6000_spe = 1; \ - if (target_flags & MASK_64BIT) \ - error ("-m64 not supported in this configuration") +#define TARGET_DEFAULT \ + (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN | MASK_EABI) #undef ASM_DEFAULT_SPEC #define ASM_DEFAULT_SPEC "-mppc -mspe -me500" diff --git a/gcc/config/rs6000/linuxspe.h b/gcc/config/rs6000/linuxspe.h index 8b95d25ff5b..74f7b060633 100644 --- a/gcc/config/rs6000/linuxspe.h +++ b/gcc/config/rs6000/linuxspe.h @@ -22,20 +22,8 @@ /* Override rs6000.h and sysv4.h definition. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN) - -#undef SUBSUBTARGET_OVERRIDE_OPTIONS -#define SUBSUBTARGET_OVERRIDE_OPTIONS \ - if (!global_options_set.x_rs6000_cpu_index) \ - rs6000_cpu = PROCESSOR_PPC8540; \ - if (!global_options_set.x_rs6000_spe_abi) \ - rs6000_spe_abi = 1; \ - if (!global_options_set.x_rs6000_float_gprs) \ - rs6000_float_gprs = 1; \ - if (!global_options_set.x_rs6000_spe) \ - rs6000_spe = 1; \ - if (target_flags & MASK_64BIT) \ - error ("-m64 not supported in this configuration") +#define TARGET_DEFAULT \ + (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN) #undef ASM_DEFAULT_SPEC #define ASM_DEFAULT_SPEC "-mppc -mspe -me500" diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index 232773d5d14..70a4d2ca708 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -1,5 +1,5 @@ ;; Predicate definitions for POWER and PowerPC. -;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 +;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 ;; Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -824,8 +824,8 @@ ;; Return 1 if this operand is a valid input for a move insn. (define_predicate "input_operand" - (match_code "label_ref,symbol_ref,const,high,reg,subreg,mem, - const_double,const_vector,const_int,plus") + (match_code "symbol_ref,const,reg,subreg,mem, + const_double,const_vector,const_int") { /* Memory is always valid. */ if (memory_operand (op, mode)) @@ -833,7 +833,6 @@ /* For floating-point, easy constants are valid. */ if (SCALAR_FLOAT_MODE_P (mode) - && CONSTANT_P (op) && easy_fp_constant (op, mode)) return 1; @@ -866,14 +865,6 @@ if (register_operand (op, mode)) return 1; - /* A SYMBOL_REF referring to the TOC is valid. */ - if (legitimate_constant_pool_address_p (op, mode, false)) - return 1; - - /* A constant pool expression (relative to the TOC) is valid */ - if (toc_relative_expr_p (op)) - return 1; - /* V.4 allows SYMBOL_REFs and CONSTs that are in the small data region to be valid. */ if (DEFAULT_ABI == ABI_V4 @@ -886,8 +877,8 @@ ;; Return 1 if this operand is a valid input for a vsx_splat insn. (define_predicate "splat_input_operand" - (match_code "label_ref,symbol_ref,const,high,reg,subreg,mem, - const_double,const_vector,const_int,plus") + (match_code "symbol_ref,const,reg,subreg,mem, + const_double,const_vector,const_int") { if (MEM_P (op)) { @@ -1461,3 +1452,14 @@ && GET_MODE (XEXP (XVECEXP (op, 0, 0), 0)) == BLKmode && XEXP (XVECEXP (op, 0, 0), 1) == const0_rtx); }) + +;; Match a small code model toc reference (or medium and large +;; model toc references before reload). +(define_predicate "small_toc_ref" + (match_code "unspec,plus") +{ + if (GET_CODE (op) == PLUS && CONST_INT_P (XEXP (op, 1))) + op = XEXP (op, 0); + + return GET_CODE (op) == UNSPEC && XINT (op, 1) == UNSPEC_TOCREL; +}) diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def index 5da8917c440..6974b157771 100644 --- a/gcc/config/rs6000/rs6000-cpus.def +++ b/gcc/config/rs6000/rs6000-cpus.def @@ -76,8 +76,7 @@ RS6000_CPU ("821", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT) RS6000_CPU ("823", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT) RS6000_CPU ("8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN | MASK_ISEL) -/* 8548 has a dummy entry for now. */ -RS6000_CPU ("8548", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN +RS6000_CPU ("8548", PROCESSOR_PPC8548, POWERPC_BASE_MASK | MASK_STRICT_ALIGN | MASK_ISEL) RS6000_CPU ("a2", PROCESSOR_PPCA2, POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_POPCNTB diff --git a/gcc/config/rs6000/rs6000-opts.h b/gcc/config/rs6000/rs6000-opts.h index ea7e7c74f60..41c16f2733f 100644 --- a/gcc/config/rs6000/rs6000-opts.h +++ b/gcc/config/rs6000/rs6000-opts.h @@ -49,6 +49,7 @@ enum processor_type PROCESSOR_PPC7400, PROCESSOR_PPC7450, PROCESSOR_PPC8540, + PROCESSOR_PPC8548, PROCESSOR_PPCE300C2, PROCESSOR_PPCE300C3, PROCESSOR_PPCE500MC, diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 23327f853fd..119482fbafc 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000. Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, - 2010, 2011 + 2010, 2011, 2012 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) @@ -38,7 +38,7 @@ extern bool macho_lo_sum_memory_operand (rtx, enum machine_mode); extern int num_insns_constant (rtx, enum machine_mode); extern int num_insns_constant_wide (HOST_WIDE_INT); extern int small_data_operand (rtx, enum machine_mode); -extern bool toc_relative_expr_p (rtx); +extern bool toc_relative_expr_p (const_rtx, bool); extern bool invalid_e500_subreg (rtx, enum machine_mode); extern void validate_condition_mode (enum rtx_code, enum machine_mode); extern bool legitimate_constant_pool_address_p (const_rtx, enum machine_mode, diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index c3331dce213..dbd1b4a37ca 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2592,7 +2592,10 @@ rs6000_option_override_internal (bool global_init_p) { bool ret = true; bool have_cpu = false; - const char *default_cpu = OPTION_TARGET_CPU_DEFAULT; + + /* The default cpu requested at configure time, if any. */ + const char *implicit_cpu = OPTION_TARGET_CPU_DEFAULT; + int set_masks; int cpu_index; int tune_index; @@ -2611,11 +2614,6 @@ rs6000_option_override_internal (bool global_init_p) warning (0, "-malign-power is not supported for 64-bit Darwin;" " it is incompatible with the installed C and C++ libraries"); - if (global_options_set.x_rs6000_spe_abi - && rs6000_spe_abi - && !TARGET_SPE_ABI) - error ("not configured for SPE ABI"); - /* Numerous experiment shows that IRA based loop pressure calculation works better for RTL loop invariant motion on targets with enough (>= 32) registers. It is an expensive optimization. @@ -2651,7 +2649,8 @@ rs6000_option_override_internal (bool global_init_p) /* Process the -mcpu=<xxx> and -mtune=<xxx> argument. If the user changed the cpu in a target attribute or pragma, but did not specify a tuning option, use the cpu for the tuning option rather than the option specified - with -mtune on the command line. */ + with -mtune on the command line. Process a '--with-cpu' configuration + request as an implicit --cpu. */ if (rs6000_cpu_index >= 0) { cpu_index = rs6000_cpu_index; @@ -2664,10 +2663,12 @@ rs6000_option_override_internal (bool global_init_p) } else { - if (!default_cpu) - default_cpu = (TARGET_POWERPC64 ? "powerpc64" : "powerpc"); + const char *default_cpu = + (implicit_cpu ? implicit_cpu + : (TARGET_POWERPC64 ? "powerpc64" : "powerpc")); rs6000_cpu_index = cpu_index = rs6000_cpu_name_lookup (default_cpu); + have_cpu = implicit_cpu != 0; } gcc_assert (cpu_index >= 0); @@ -2698,6 +2699,42 @@ rs6000_option_override_internal (bool global_init_p) gcc_assert (tune_index >= 0); rs6000_cpu = processor_target_table[tune_index].processor; + /* Pick defaults for SPE related control flags. Do this early to make sure + that the TARGET_ macros are representative ASAP. */ + { + int spe_capable_cpu = + (rs6000_cpu == PROCESSOR_PPC8540 + || rs6000_cpu == PROCESSOR_PPC8548); + + if (!global_options_set.x_rs6000_spe_abi) + rs6000_spe_abi = spe_capable_cpu; + + if (!global_options_set.x_rs6000_spe) + rs6000_spe = spe_capable_cpu; + + if (!global_options_set.x_rs6000_float_gprs) + rs6000_float_gprs = + (rs6000_cpu == PROCESSOR_PPC8540 ? 1 + : rs6000_cpu == PROCESSOR_PPC8548 ? 2 + : 0); + } + + if (global_options_set.x_rs6000_spe_abi + && rs6000_spe_abi + && !TARGET_SPE_ABI) + error ("not configured for SPE ABI"); + + if (global_options_set.x_rs6000_spe + && rs6000_spe + && !TARGET_SPE) + error ("not configured for SPE instruction set"); + + if (main_target_opt != NULL + && ((main_target_opt->x_rs6000_spe_abi != rs6000_spe_abi) + || (main_target_opt->x_rs6000_spe != rs6000_spe) + || (main_target_opt->x_rs6000_float_gprs != rs6000_float_gprs))) + error ("target attribute or pragma changes SPE ABI"); + if (rs6000_cpu == PROCESSOR_PPCE300C2 || rs6000_cpu == PROCESSOR_PPCE300C3 || rs6000_cpu == PROCESSOR_PPCE500MC || rs6000_cpu == PROCESSOR_PPCE500MC64) { @@ -2933,35 +2970,44 @@ rs6000_option_override_internal (bool global_init_p) SUB3TARGET_OVERRIDE_OPTIONS; #endif - if (TARGET_E500 || rs6000_cpu == PROCESSOR_PPCE500MC - || rs6000_cpu == PROCESSOR_PPCE500MC64) + /* For the E500 family of cores, reset the single/double FP flags to let us + check that they remain constant across attributes or pragmas. Also, + clear a possible request for string instructions, not supported and which + we might have silently queried above for -Os. + + For other families, clear ISEL in case it was set implicitly. + */ + + switch (rs6000_cpu) { - /* The e500 and e500mc do not have string instructions, and we set - MASK_STRING above when optimizing for size. */ - if ((target_flags & MASK_STRING) != 0) - target_flags = target_flags & ~MASK_STRING; + case PROCESSOR_PPC8540: + case PROCESSOR_PPC8548: + case PROCESSOR_PPCE500MC: + case PROCESSOR_PPCE500MC64: + + rs6000_single_float = TARGET_E500_SINGLE || TARGET_E500_DOUBLE; + rs6000_double_float = TARGET_E500_DOUBLE; + + target_flags &= ~MASK_STRING; + + break; + + default: + + if (have_cpu && !(target_flags_explicit & MASK_ISEL)) + target_flags &= ~MASK_ISEL; + + break; } - else if (global_options_set.x_rs6000_cpu_index) + + if (main_target_opt) { - /* For the powerpc-eabispe configuration, we set all these by - default, so let's unset them if we manually set another - CPU that is not the E500. */ - if (main_target_opt != NULL - && ((main_target_opt->x_rs6000_spe_abi != rs6000_spe_abi) - || (main_target_opt->x_rs6000_spe != rs6000_spe) - || (main_target_opt->x_rs6000_float_gprs != rs6000_float_gprs))) - error ("target attribute or pragma changes SPE ABI"); - else - { - if (!global_options_set.x_rs6000_spe_abi) - rs6000_spe_abi = 0; - if (!global_options_set.x_rs6000_spe) - rs6000_spe = 0; - if (!global_options_set.x_rs6000_float_gprs) - rs6000_float_gprs = 0; - } - if (!(target_flags_explicit & MASK_ISEL)) - target_flags &= ~MASK_ISEL; + if (main_target_opt->x_rs6000_single_float != rs6000_single_float) + error ("target attribute or pragma changes single precision floating " + "point"); + if (main_target_opt->x_rs6000_double_float != rs6000_double_float) + error ("target attribute or pragma changes double precision floating " + "point"); } /* Detect invalid option combinations with E500. */ @@ -3188,6 +3234,7 @@ rs6000_option_override_internal (bool global_init_p) break; case PROCESSOR_PPC8540: + case PROCESSOR_PPC8548: rs6000_cost = &ppc8540_cost; break; @@ -3260,26 +3307,6 @@ rs6000_option_override_internal (bool global_init_p) && rs6000_single_float == 0 && rs6000_double_float == 0) rs6000_single_float = rs6000_double_float = 1; - /* Reset single and double FP flags if target is E500. */ - if (TARGET_E500) - { - rs6000_single_float = rs6000_double_float = 0; - if (TARGET_E500_SINGLE) - rs6000_single_float = 1; - if (TARGET_E500_DOUBLE) - rs6000_single_float = rs6000_double_float = 1; - } - - if (main_target_opt) - { - if (main_target_opt->x_rs6000_single_float != rs6000_single_float) - error ("target attribute or pragma changes single precision floating " - "point"); - if (main_target_opt->x_rs6000_double_float != rs6000_double_float) - error ("target attribute or pragma changes double precision floating " - "point"); - } - /* If not explicitly specified via option, decide whether to generate indexed load/store instructions. */ if (TARGET_AVOID_XFORM == -1) @@ -5280,15 +5307,37 @@ constant_pool_expr_p (rtx op) && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (base), Pmode)); } -static rtx tocrel_base, tocrel_offset; +static const_rtx tocrel_base, tocrel_offset; + +/* Return true if OP is a toc pointer relative address (the output + of create_TOC_reference). If STRICT, do not match high part or + non-split -mcmodel=large/medium toc pointer relative addresses. */ bool -toc_relative_expr_p (rtx op) +toc_relative_expr_p (const_rtx op, bool strict) { - if (GET_CODE (op) != CONST) + if (!TARGET_TOC) return false; - split_const (op, &tocrel_base, &tocrel_offset); + if (TARGET_CMODEL != CMODEL_SMALL) + { + /* Only match the low part. */ + if (GET_CODE (op) == LO_SUM + && REG_P (XEXP (op, 0)) + && INT_REG_OK_FOR_BASE_P (XEXP (op, 0), strict)) + op = XEXP (op, 1); + else if (strict) + return false; + } + + tocrel_base = op; + tocrel_offset = const0_rtx; + if (GET_CODE (op) == PLUS && CONST_INT_P (XEXP (op, 1))) + { + tocrel_base = XEXP (op, 0); + tocrel_offset = XEXP (op, 1); + } + return (GET_CODE (tocrel_base) == UNSPEC && XINT (tocrel_base, 1) == UNSPEC_TOCREL); } @@ -5300,14 +5349,7 @@ bool legitimate_constant_pool_address_p (const_rtx x, enum machine_mode mode, bool strict) { - return (TARGET_TOC - && (GET_CODE (x) == PLUS || GET_CODE (x) == LO_SUM) - && GET_CODE (XEXP (x, 0)) == REG - && (REGNO (XEXP (x, 0)) == TOC_REGISTER - || ((TARGET_MINIMAL_TOC - || TARGET_CMODEL != CMODEL_SMALL) - && INT_REG_OK_FOR_BASE_P (XEXP (x, 0), strict))) - && toc_relative_expr_p (XEXP (x, 1)) + return (toc_relative_expr_p (x, strict) && (TARGET_CMODEL != CMODEL_MEDIUM || constant_pool_expr_p (XVECEXP (tocrel_base, 0, 0)) || mode == QImode @@ -5687,10 +5729,7 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, && GET_CODE (x) == SYMBOL_REF && constant_pool_expr_p (x) && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (x), Pmode)) - { - rtx reg = TARGET_CMODEL != CMODEL_SMALL ? gen_reg_rtx (Pmode) : NULL_RTX; - return create_TOC_reference (x, reg); - } + return create_TOC_reference (x, NULL_RTX); else return x; } @@ -5773,49 +5812,55 @@ rs6000_output_dwarf_dtprel (FILE *file, int size, rtx x) static rtx rs6000_delegitimize_address (rtx orig_x) { - rtx x, y; + rtx x, y, offset; orig_x = delegitimize_mem_from_attrs (orig_x); x = orig_x; if (MEM_P (x)) x = XEXP (x, 0); - if (GET_CODE (x) == (TARGET_CMODEL != CMODEL_SMALL ? LO_SUM : PLUS) - && GET_CODE (XEXP (x, 1)) == CONST) + y = x; + if (TARGET_CMODEL != CMODEL_SMALL + && GET_CODE (y) == LO_SUM) + y = XEXP (y, 1); + + offset = NULL_RTX; + if (GET_CODE (y) == PLUS + && GET_MODE (y) == Pmode + && CONST_INT_P (XEXP (y, 1))) { - rtx offset = NULL_RTX; + offset = XEXP (y, 1); + y = XEXP (y, 0); + } - y = XEXP (XEXP (x, 1), 0); - if (GET_CODE (y) == PLUS - && GET_MODE (y) == Pmode - && CONST_INT_P (XEXP (y, 1))) + if (GET_CODE (y) == UNSPEC + && XINT (y, 1) == UNSPEC_TOCREL) + { +#ifdef ENABLE_CHECKING + if (REG_P (XVECEXP (y, 0, 1)) + && REGNO (XVECEXP (y, 0, 1)) == TOC_REGISTER) { - offset = XEXP (y, 1); - y = XEXP (y, 0); + /* All good. */ } - if (GET_CODE (y) == UNSPEC - && XINT (y, 1) == UNSPEC_TOCREL - && ((GET_CODE (XEXP (x, 0)) == REG - && (REGNO (XEXP (x, 0)) == TOC_REGISTER - || TARGET_MINIMAL_TOC - || TARGET_CMODEL != CMODEL_SMALL)) - || (TARGET_CMODEL != CMODEL_SMALL - && GET_CODE (XEXP (x, 0)) == CONST - && GET_CODE (XEXP (XEXP (x, 0), 0)) == PLUS - && GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) == REG - && REGNO (XEXP (XEXP (XEXP (x, 0), 0), 0)) == TOC_REGISTER - && GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 1)) == HIGH - && rtx_equal_p (XEXP (x, 1), - XEXP (XEXP (XEXP (XEXP (x, 0), 0), 1), 0))))) - { - y = XVECEXP (y, 0, 0); - if (offset != NULL_RTX) - y = gen_rtx_PLUS (Pmode, y, offset); - if (!MEM_P (orig_x)) - return y; - else - return replace_equiv_address_nv (orig_x, y); + else if (GET_CODE (XVECEXP (y, 0, 1)) == DEBUG_EXPR) + { + /* Weirdness alert. df_note_compute can replace r2 with a + debug_expr when this unspec is in a debug_insn. + Seen in gcc.dg/pr51957-1.c */ + } + else + { + debug_rtx (orig_x); + abort (); } +#endif + y = XVECEXP (y, 0, 0); + if (offset != NULL_RTX) + y = gen_rtx_PLUS (Pmode, y, offset); + if (!MEM_P (orig_x)) + return y; + else + return replace_equiv_address_nv (orig_x, y); } if (TARGET_MACHO @@ -6077,9 +6122,8 @@ rs6000_tls_referenced_p (rtx x) static bool rs6000_cannot_force_const_mem (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x) { - if (GET_CODE (x) == CONST - && GET_CODE (XEXP (x, 0)) == PLUS - && GET_CODE (XEXP (XEXP (x, 0), 1)) == HIGH) + if (GET_CODE (x) == HIGH + && GET_CODE (XEXP (x, 0)) == UNSPEC) return true; return rs6000_tls_referenced_p (x); @@ -6094,6 +6138,21 @@ rs6000_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED) return RS6000_SYMBOL_REF_TLS_P (*x); } +/* Return true iff the given SYMBOL_REF refers to a constant pool entry + that we have put in the TOC, or for cmodel=medium, if the SYMBOL_REF + can be addressed relative to the toc pointer. */ + +static bool +use_toc_relative_ref (rtx sym) +{ + return ((constant_pool_expr_p (sym) + && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (sym), + get_pool_mode (sym))) + || (TARGET_CMODEL == CMODEL_MEDIUM + && !CONSTANT_POOL_ADDRESS_P (sym) + && SYMBOL_REF_LOCAL_P (sym))); +} + /* Our implementation of LEGITIMIZE_RELOAD_ADDRESS. Returns a value to replace the input X, or the original X if no replacement is called for. The output parameter *WIN is 1 if the calling macro should goto WIN, @@ -6131,7 +6190,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, { push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, BASE_REG_CLASS, GET_MODE (x), VOIDmode, 0, 0, - opnum, (enum reload_type)type); + opnum, (enum reload_type) type); *win = 1; return x; } @@ -6142,7 +6201,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, { push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, - opnum, (enum reload_type)type); + opnum, (enum reload_type) type); *win = 1; return x; } @@ -6160,24 +6219,18 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, floating point constant. */ push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, - opnum, (enum reload_type)type); + opnum, (enum reload_type) type); *win = 1; return x; } #endif if (TARGET_CMODEL != CMODEL_SMALL - && GET_CODE (x) == LO_SUM - && GET_CODE (XEXP (x, 0)) == PLUS - && GET_CODE (XEXP (XEXP (x, 0), 0)) == REG - && REGNO (XEXP (XEXP (x, 0), 0)) == TOC_REGISTER - && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST - && GET_CODE (XEXP (XEXP (XEXP (x, 0), 1), 0)) == HIGH - && GET_CODE (XEXP (x, 1)) == CONST - && GET_CODE (XEXP (XEXP (x, 1), 0)) == UNSPEC - && XINT (XEXP (XEXP (x, 1), 0), 1) == UNSPEC_TOCREL - && rtx_equal_p (XEXP (XEXP (XEXP (XEXP (x, 0), 1), 0), 0), XEXP (x, 1))) + && reg_offset_p + && small_toc_ref (x, VOIDmode)) { + rtx hi = gen_rtx_HIGH (Pmode, copy_rtx (x)); + x = gen_rtx_LO_SUM (Pmode, hi, x); push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, opnum, (enum reload_type) type); @@ -6240,7 +6293,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, BASE_REG_CLASS, GET_MODE (x), VOIDmode, 0, 0, - opnum, (enum reload_type)type); + opnum, (enum reload_type) type); *win = 1; return x; } @@ -6281,7 +6334,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, - opnum, (enum reload_type)type); + opnum, (enum reload_type) type); *win = 1; return x; } @@ -6308,8 +6361,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, if (TARGET_TOC && reg_offset_p && GET_CODE (x) == SYMBOL_REF - && constant_pool_expr_p (x) - && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (x), mode)) + && use_toc_relative_ref (x)) { x = create_TOC_reference (x, NULL_RTX); if (TARGET_CMODEL != CMODEL_SMALL) @@ -6544,9 +6596,13 @@ rs6000_debug_mode_dependent_address (const_rtx addr) rtx rs6000_find_base_term (rtx op) { - rtx base, offset; + rtx base; - split_const (op, &base, &offset); + base = op; + if (GET_CODE (base) == CONST) + base = XEXP (base, 0); + if (GET_CODE (base) == PLUS) + base = XEXP (base, 0); if (GET_CODE (base) == UNSPEC) switch (XINT (base, 1)) { @@ -7198,33 +7254,13 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) /* If this is a SYMBOL_REF that refers to a constant pool entry, and we have put it in the TOC, we just need to make a TOC-relative reference to it. */ - if ((TARGET_TOC - && GET_CODE (operands[1]) == SYMBOL_REF - && constant_pool_expr_p (operands[1]) - && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (operands[1]), - get_pool_mode (operands[1]))) - || (TARGET_CMODEL == CMODEL_MEDIUM - && GET_CODE (operands[1]) == SYMBOL_REF - && !CONSTANT_POOL_ADDRESS_P (operands[1]) - && SYMBOL_REF_LOCAL_P (operands[1]))) - { - rtx reg = NULL_RTX; - if (TARGET_CMODEL != CMODEL_SMALL) - { - if (can_create_pseudo_p ()) - reg = gen_reg_rtx (Pmode); - else - reg = operands[0]; - } - operands[1] = create_TOC_reference (operands[1], reg); - } + if (TARGET_TOC + && GET_CODE (operands[1]) == SYMBOL_REF + && use_toc_relative_ref (operands[1])) + operands[1] = create_TOC_reference (operands[1], operands[0]); else if (mode == Pmode && CONSTANT_P (operands[1]) && GET_CODE (operands[1]) != HIGH - && !(TARGET_CMODEL != CMODEL_SMALL - && GET_CODE (operands[1]) == CONST - && GET_CODE (XEXP (operands[1], 0)) == PLUS - && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == HIGH) && ((GET_CODE (operands[1]) != CONST_INT && ! easy_fp_constant (operands[1], mode)) || (GET_CODE (operands[1]) == CONST_INT @@ -7232,9 +7268,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) > (TARGET_CMODEL != CMODEL_SMALL ? 3 : 2))) || (GET_CODE (operands[0]) == REG && FP_REGNO_P (REGNO (operands[0])))) - && ! legitimate_constant_pool_address_p (operands[1], mode, - false) - && ! toc_relative_expr_p (operands[1]) + && !toc_relative_expr_p (operands[1], false) && (TARGET_CMODEL == CMODEL_SMALL || can_create_pseudo_p () || (REG_P (operands[0]) @@ -7284,16 +7318,8 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) get_pool_constant (XEXP (operands[1], 0)), get_pool_mode (XEXP (operands[1], 0)))) { - rtx tocref; - rtx reg = NULL_RTX; - if (TARGET_CMODEL != CMODEL_SMALL) - { - if (can_create_pseudo_p ()) - reg = gen_reg_rtx (Pmode); - else - reg = operands[0]; - } - tocref = create_TOC_reference (XEXP (operands[1], 0), reg); + rtx tocref = create_TOC_reference (XEXP (operands[1], 0), + operands[0]); operands[1] = gen_const_mem (mode, tocref); set_mem_alias_set (operands[1], get_TOC_alias_set ()); } @@ -14652,7 +14678,6 @@ void print_operand (FILE *file, rtx x, int code) { int i; - HOST_WIDE_INT val; unsigned HOST_WIDE_INT uval; switch (code) @@ -14704,7 +14729,7 @@ print_operand (FILE *file, rtx x, int code) case 'D': /* Like 'J' but get to the GT bit only. */ - gcc_assert (GET_CODE (x) == REG); + gcc_assert (REG_P (x)); /* Bit 1 is GT bit. */ i = 4 * (REGNO (x) - CR0_REGNO) + 1; @@ -14824,9 +14849,9 @@ print_operand (FILE *file, rtx x, int code) case 'L': /* Write second word of DImode or DFmode reference. Works on register or non-indexed memory only. */ - if (GET_CODE (x) == REG) + if (REG_P (x)) fputs (reg_names[REGNO (x) + 1], file); - else if (GET_CODE (x) == MEM) + else if (MEM_P (x)) { /* Handle possible auto-increment. Since it is pre-increment and we have already done it, we can just use an offset of word. */ @@ -14995,7 +15020,7 @@ print_operand (FILE *file, rtx x, int code) case 't': /* Like 'J' but get to the OVERFLOW/UNORDERED bit. */ - gcc_assert (GET_CODE (x) == REG && GET_MODE (x) == CCmode); + gcc_assert (REG_P (x) && GET_MODE (x) == CCmode); /* Bit 3 is OV bit. */ i = 4 * (REGNO (x) - CR0_REGNO) + 3; @@ -15035,7 +15060,7 @@ print_operand (FILE *file, rtx x, int code) case 'U': /* Print `u' if this has an auto-increment or auto-decrement. */ - if (GET_CODE (x) == MEM + if (MEM_P (x) && (GET_CODE (XEXP (x, 0)) == PRE_INC || GET_CODE (XEXP (x, 0)) == PRE_DEC || GET_CODE (XEXP (x, 0)) == PRE_MODIFY)) @@ -15093,34 +15118,17 @@ print_operand (FILE *file, rtx x, int code) case 'W': /* MB value for a PowerPC64 rldic operand. */ - val = (GET_CODE (x) == CONST_INT - ? INTVAL (x) : CONST_DOUBLE_HIGH (x)); - - if (val < 0) - i = -1; - else - for (i = 0; i < HOST_BITS_PER_WIDE_INT; i++) - if ((val <<= 1) < 0) - break; + i = clz_hwi (GET_CODE (x) == CONST_INT + ? INTVAL (x) : CONST_DOUBLE_HIGH (x)); #if HOST_BITS_PER_WIDE_INT == 32 - if (GET_CODE (x) == CONST_INT && i >= 0) + if (GET_CODE (x) == CONST_INT && i > 0) i += 32; /* zero-extend high-part was all 0's */ else if (GET_CODE (x) == CONST_DOUBLE && i == 32) - { - val = CONST_DOUBLE_LOW (x); - - gcc_assert (val); - if (val < 0) - --i; - else - for ( ; i < 64; i++) - if ((val <<= 1) < 0) - break; - } + i = clz_hwi (CONST_DOUBLE_LOW (x)) + 32; #endif - fprintf (file, "%d", i + 1); + fprintf (file, "%d", i); return; case 'x': @@ -15144,7 +15152,7 @@ print_operand (FILE *file, rtx x, int code) return; case 'X': - if (GET_CODE (x) == MEM + if (MEM_P (x) && (legitimate_indexed_address_p (XEXP (x, 0), 0) || (GET_CODE (XEXP (x, 0)) == PRE_MODIFY && legitimate_indexed_address_p (XEXP (XEXP (x, 0), 1), 0)))) @@ -15153,9 +15161,9 @@ print_operand (FILE *file, rtx x, int code) case 'Y': /* Like 'L', for third word of TImode */ - if (GET_CODE (x) == REG) + if (REG_P (x)) fputs (reg_names[REGNO (x) + 2], file); - else if (GET_CODE (x) == MEM) + else if (MEM_P (x)) { if (GET_CODE (XEXP (x, 0)) == PRE_INC || GET_CODE (XEXP (x, 0)) == PRE_DEC) @@ -15203,9 +15211,9 @@ print_operand (FILE *file, rtx x, int code) case 'Z': /* Like 'L', for last word of TImode. */ - if (GET_CODE (x) == REG) + if (REG_P (x)) fputs (reg_names[REGNO (x) + 3], file); - else if (GET_CODE (x) == MEM) + else if (MEM_P (x)) { if (GET_CODE (XEXP (x, 0)) == PRE_INC || GET_CODE (XEXP (x, 0)) == PRE_DEC) @@ -15225,7 +15233,7 @@ print_operand (FILE *file, rtx x, int code) { rtx tmp; - gcc_assert (GET_CODE (x) == MEM); + gcc_assert (MEM_P (x)); tmp = XEXP (x, 0); @@ -15236,7 +15244,7 @@ print_operand (FILE *file, rtx x, int code) || GET_MODE (x) == TImode)) { /* Handle [reg]. */ - if (GET_CODE (tmp) == REG) + if (REG_P (tmp)) { fprintf (file, "0(%s)", reg_names[REGNO (tmp)]); break; @@ -15247,7 +15255,7 @@ print_operand (FILE *file, rtx x, int code) { int x; - gcc_assert (GET_CODE (XEXP (tmp, 0)) == REG); + gcc_assert (REG_P (XEXP (tmp, 0))); x = INTVAL (XEXP (tmp, 1)); fprintf (file, "%d(%s)", x, reg_names[REGNO (XEXP (tmp, 0))]); @@ -15264,7 +15272,7 @@ print_operand (FILE *file, rtx x, int code) else if (VECTOR_MEM_VSX_P (GET_MODE (x)) && GET_CODE (tmp) == PRE_MODIFY) tmp = XEXP (tmp, 1); - if (GET_CODE (tmp) == REG) + if (REG_P (tmp)) fprintf (file, "0,%s", reg_names[REGNO (tmp)]); else { @@ -15287,9 +15295,9 @@ print_operand (FILE *file, rtx x, int code) } case 0: - if (GET_CODE (x) == REG) + if (REG_P (x)) fprintf (file, "%s", reg_names[REGNO (x)]); - else if (GET_CODE (x) == MEM) + else if (MEM_P (x)) { /* We need to handle PRE_INC and PRE_DEC here, since we need to know the width from the mode. */ @@ -15306,14 +15314,14 @@ print_operand (FILE *file, rtx x, int code) } else { - if (toc_relative_expr_p (x)) + if (toc_relative_expr_p (x, false)) /* This hack along with a corresponding hack in rs6000_output_addr_const_extra arranges to output addends where the assembler expects to find them. eg. - (const (plus (unspec [symbol_ref ("x") tocrel]) 4)) + (plus (unspec [(symbol_ref ("x")) (reg 2)] tocrel) 4) without this hack would be output as "x@toc+4". We want "x+4@toc". */ - output_addr_const (file, tocrel_base); + output_addr_const (file, CONST_CAST_RTX (tocrel_base)); else output_addr_const (file, x); } @@ -15333,7 +15341,7 @@ print_operand (FILE *file, rtx x, int code) void print_operand_address (FILE *file, rtx x) { - if (GET_CODE (x) == REG) + if (REG_P (x)) fprintf (file, "0(%s)", reg_names[ REGNO (x) ]); else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == CONST || GET_CODE (x) == LABEL_REF) @@ -15345,9 +15353,9 @@ print_operand_address (FILE *file, rtx x) else gcc_assert (!TARGET_TOC); } - else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == REG) + else if (GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) + && REG_P (XEXP (x, 1))) { - gcc_assert (REG_P (XEXP (x, 0))); if (REGNO (XEXP (x, 0)) == 0) fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (x, 1)) ], reg_names[ REGNO (XEXP (x, 0)) ]); @@ -15355,11 +15363,12 @@ print_operand_address (FILE *file, rtx x) fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (x, 0)) ], reg_names[ REGNO (XEXP (x, 1)) ]); } - else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT) + else if (GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) + && GET_CODE (XEXP (x, 1)) == CONST_INT) fprintf (file, HOST_WIDE_INT_PRINT_DEC "(%s)", INTVAL (XEXP (x, 1)), reg_names[ REGNO (XEXP (x, 0)) ]); #if TARGET_MACHO - else if (GET_CODE (x) == LO_SUM && GET_CODE (XEXP (x, 0)) == REG + else if (GET_CODE (x) == LO_SUM && REG_P (XEXP (x, 0)) && CONSTANT_P (XEXP (x, 1))) { fprintf (file, "lo16("); @@ -15367,29 +15376,29 @@ print_operand_address (FILE *file, rtx x) fprintf (file, ")(%s)", reg_names[ REGNO (XEXP (x, 0)) ]); } #endif - else if (legitimate_constant_pool_address_p (x, QImode, true)) +#if TARGET_ELF + else if (GET_CODE (x) == LO_SUM && REG_P (XEXP (x, 0)) + && CONSTANT_P (XEXP (x, 1))) + { + output_addr_const (file, XEXP (x, 1)); + fprintf (file, "@l(%s)", reg_names[ REGNO (XEXP (x, 0)) ]); + } +#endif + else if (toc_relative_expr_p (x, false)) { /* This hack along with a corresponding hack in rs6000_output_addr_const_extra arranges to output addends where the assembler expects to find them. eg. (lo_sum (reg 9) - . (const (plus (unspec [symbol_ref ("x") tocrel]) 8))) + . (plus (unspec [(symbol_ref ("x")) (reg 2)] tocrel) 8)) without this hack would be output as "x@toc+8@l(9)". We want "x+8@toc@l(9)". */ - output_addr_const (file, tocrel_base); + output_addr_const (file, CONST_CAST_RTX (tocrel_base)); if (GET_CODE (x) == LO_SUM) - fprintf (file, "@l(%s)", reg_names[ REGNO (XEXP (x, 0)) ]); + fprintf (file, "@l(%s)", reg_names[REGNO (XEXP (x, 0))]); else - fprintf (file, "(%s)", reg_names[REGNO (XEXP (x, 0))]); + fprintf (file, "(%s)", reg_names[REGNO (XVECEXP (tocrel_base, 0, 1))]); } -#if TARGET_ELF - else if (GET_CODE (x) == LO_SUM && GET_CODE (XEXP (x, 0)) == REG - && CONSTANT_P (XEXP (x, 1))) - { - output_addr_const (file, XEXP (x, 1)); - fprintf (file, "@l(%s)", reg_names[ REGNO (XEXP (x, 0)) ]); - } -#endif else gcc_unreachable (); } @@ -15403,13 +15412,15 @@ rs6000_output_addr_const_extra (FILE *file, rtx x) switch (XINT (x, 1)) { case UNSPEC_TOCREL: - gcc_assert (GET_CODE (XVECEXP (x, 0, 0)) == SYMBOL_REF); + gcc_checking_assert (GET_CODE (XVECEXP (x, 0, 0)) == SYMBOL_REF + && REG_P (XVECEXP (x, 0, 1)) + && REGNO (XVECEXP (x, 0, 1)) == TOC_REGISTER); output_addr_const (file, XVECEXP (x, 0, 0)); if (x == tocrel_base && tocrel_offset != const0_rtx) { if (INTVAL (tocrel_offset) >= 0) fprintf (file, "+"); - output_addr_const (file, tocrel_offset); + output_addr_const (file, CONST_CAST_RTX (tocrel_offset)); } if (!TARGET_AIX || (TARGET_ELF && TARGET_MINIMAL_TOC)) { @@ -18492,7 +18503,7 @@ uses_TOC (void) rtx create_TOC_reference (rtx symbol, rtx largetoc_reg) { - rtx tocrel, tocreg; + rtx tocrel, tocreg, hi; if (TARGET_DEBUG_ADDR) { @@ -18510,24 +18521,18 @@ create_TOC_reference (rtx symbol, rtx largetoc_reg) if (!can_create_pseudo_p ()) df_set_regs_ever_live (TOC_REGISTER, true); - tocrel = gen_rtx_CONST (Pmode, - gen_rtx_UNSPEC (Pmode, gen_rtvec (1, symbol), - UNSPEC_TOCREL)); tocreg = gen_rtx_REG (Pmode, TOC_REGISTER); - if (TARGET_CMODEL != CMODEL_SMALL) + tocrel = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, symbol, tocreg), UNSPEC_TOCREL); + if (TARGET_CMODEL == CMODEL_SMALL || can_create_pseudo_p ()) + return tocrel; + + hi = gen_rtx_HIGH (Pmode, copy_rtx (tocrel)); + if (largetoc_reg != NULL) { - rtx hi = gen_rtx_CONST (Pmode, - gen_rtx_PLUS (Pmode, tocreg, - gen_rtx_HIGH (Pmode, tocrel))); - if (largetoc_reg != NULL) - { - emit_move_insn (largetoc_reg, hi); - hi = largetoc_reg; - } - return gen_rtx_LO_SUM (Pmode, hi, copy_rtx (tocrel)); + emit_move_insn (largetoc_reg, hi); + hi = largetoc_reg; } - else - return gen_rtx_PLUS (Pmode, tocreg, tocrel); + return gen_rtx_LO_SUM (Pmode, hi, tocrel); } /* Issue assembly directives that create a reference to the given DWARF @@ -23126,6 +23131,7 @@ rs6000_issue_rate (void) case CPU_PPC750: case CPU_PPC7400: case CPU_PPC8540: + case CPU_PPC8548: case CPU_CELL: case CPU_PPCE300C2: case CPU_PPCE300C3: @@ -23156,11 +23162,18 @@ rs6000_issue_rate (void) static int rs6000_use_sched_lookahead (void) { - if (rs6000_cpu_attr == CPU_PPC8540) - return 4; - if (rs6000_cpu_attr == CPU_CELL) - return (reload_completed ? 8 : 0); - return 0; + switch (rs6000_cpu_attr) + { + case CPU_PPC8540: + case CPU_PPC8548: + return 4; + + case CPU_CELL: + return (reload_completed ? 8 : 0); + + default: + return 0; + } } /* We are choosing insn from the ready queue. Return nonzero if INSN can be chosen. */ diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index c69a209fc8a..38db1f484f9 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -457,7 +457,6 @@ extern int rs6000_vector_align[]; #define TARGET_SPE_ABI 0 #define TARGET_SPE 0 -#define TARGET_E500 0 #define TARGET_ISEL64 (TARGET_ISEL && TARGET_POWERPC64) #define TARGET_FPRS 1 #define TARGET_E500_SINGLE 0 @@ -500,11 +499,11 @@ extern int rs6000_vector_align[]; || TARGET_ALTIVEC \ || TARGET_VSX))) +/* E500 cores only support plain "sync", not lwsync. */ +#define TARGET_NO_LWSYNC (rs6000_cpu == PROCESSOR_PPC8540 \ + || rs6000_cpu == PROCESSOR_PPC8548) -/* E500 processors only support plain "sync", not lwsync. */ -#define TARGET_NO_LWSYNC TARGET_E500 - /* Which machine supports the various reciprocal estimate instructions. */ #define TARGET_FRES (TARGET_HARD_FLOAT && TARGET_PPC_GFXOPT \ && TARGET_FPRS && TARGET_SINGLE_FLOAT) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 78e56030b04..e852c3e5306 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -1,6 +1,7 @@ ;; Machine description for IBM RISC System 6000 (POWER) for GNU C compiler ;; Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +;; 2011, 2012 ;; Free Software Foundation, Inc. ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) @@ -165,7 +166,7 @@ ;; Processor type -- this attribute must exactly match the processor_type ;; enumeration in rs6000.h. -(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc476,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,ppce300c2,ppce300c3,ppce500mc,ppce500mc64,power4,power5,power6,power7,cell,ppca2,titan" +(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc440,ppc476,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,ppc8548,ppce300c2,ppce300c3,ppce500mc,ppce500mc64,power4,power5,power6,power7,cell,ppca2,titan" (const (symbol_ref "rs6000_cpu_attr"))) @@ -9305,8 +9306,8 @@ (set_attr "length" "4")]) (define_insn "*movsi_internal1" - [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,r,r,m,r,r,r,r,r,*q,*c*l,*h,*h") - (match_operand:SI 1 "input_operand" "r,U,m,r,I,L,n,R,*h,r,r,r,0"))] + [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,r,r,m,r,r,r,r,*q,*c*l,*h,*h") + (match_operand:SI 1 "input_operand" "r,U,m,r,I,L,n,*h,r,r,r,0"))] "!TARGET_SINGLE_FPU && (gpc_reg_operand (operands[0], SImode) || gpc_reg_operand (operands[1], SImode))" "@ @@ -9317,18 +9318,17 @@ {lil|li} %0,%1 {liu|lis} %0,%v1 # - {cal|la} %0,%a1 mf%1 %0 mt%0 %1 mt%0 %1 mt%0 %1 {cror 0,0,0|nop}" - [(set_attr "type" "*,*,load,store,*,*,*,*,mfjmpr,*,mtjmpr,*,*") - (set_attr "length" "4,4,4,4,4,4,8,4,4,4,4,4,4")]) + [(set_attr "type" "*,*,load,store,*,*,*,mfjmpr,*,mtjmpr,*,*") + (set_attr "length" "4,4,4,4,4,4,8,4,4,4,4,4")]) (define_insn "*movsi_internal1_single" - [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,r,r,m,r,r,r,r,r,*q,*c*l,*h,*h,m,*f") - (match_operand:SI 1 "input_operand" "r,U,m,r,I,L,n,R,*h,r,r,r,0,f,m"))] + [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,r,r,m,r,r,r,r,*q,*c*l,*h,*h,m,*f") + (match_operand:SI 1 "input_operand" "r,U,m,r,I,L,n,*h,r,r,r,0,f,m"))] "TARGET_SINGLE_FPU && (gpc_reg_operand (operands[0], SImode) || gpc_reg_operand (operands[1], SImode))" "@ @@ -9339,7 +9339,6 @@ {lil|li} %0,%1 {liu|lis} %0,%v1 # - {cal|la} %0,%a1 mf%1 %0 mt%0 %1 mt%0 %1 @@ -9347,8 +9346,8 @@ {cror 0,0,0|nop} stfs%U0%X0 %1, %0 lfs%U1%X1 %0, %1" - [(set_attr "type" "*,*,load,store,*,*,*,*,mfjmpr,*,mtjmpr,*,*,*,*") - (set_attr "length" "4,4,4,4,4,4,8,4,4,4,4,4,4,4,4")]) + [(set_attr "type" "*,*,load,store,*,*,*,mfjmpr,*,mtjmpr,*,*,*,*") + (set_attr "length" "4,4,4,4,4,4,8,4,4,4,4,4,4,4")]) ;; Split a load of a large constant into the appropriate two-insn ;; sequence. @@ -9543,8 +9542,8 @@ (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,8")]) (define_insn "*movsf_softfloat" - [(set (match_operand:SF 0 "nonimmediate_operand" "=r,cl,q,r,r,m,r,r,r,r,r,*h") - (match_operand:SF 1 "input_operand" "r,r,r,h,m,r,I,L,R,G,Fn,0"))] + [(set (match_operand:SF 0 "nonimmediate_operand" "=r,cl,q,r,r,m,r,r,r,r,*h") + (match_operand:SF 1 "input_operand" "r,r,r,h,m,r,I,L,G,Fn,0"))] "(gpc_reg_operand (operands[0], SFmode) || gpc_reg_operand (operands[1], SFmode)) && (TARGET_SOFT_FLOAT || !TARGET_FPRS)" @@ -9557,12 +9556,11 @@ {st%U0%X0|stw%U0%X0} %1,%0 {lil|li} %0,%1 {liu|lis} %0,%v1 - {cal|la} %0,%a1 # # {cror 0,0,0|nop}" - [(set_attr "type" "*,mtjmpr,*,mfjmpr,load,store,*,*,*,*,*,*") - (set_attr "length" "4,4,4,4,4,4,4,4,4,4,8,4")]) + [(set_attr "type" "*,mtjmpr,*,mfjmpr,load,store,*,*,*,*,*") + (set_attr "length" "4,4,4,4,4,4,4,4,4,8,4")]) (define_expand "movdf" @@ -10190,8 +10188,8 @@ { rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) (define_insn "*movdi_mfpgpr" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,*d,*d,m,r,*h,*h,r,*d") - (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,R,d,m,d,*h,r,0,*d,r"))] + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,*d,*d,m,r,*h,*h,r,*d") + (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,d,m,d,*h,r,0,*d,r"))] "TARGET_POWERPC64 && TARGET_MFPGPR && TARGET_HARD_FLOAT && TARGET_FPRS && (gpc_reg_operand (operands[0], DImode) || gpc_reg_operand (operands[1], DImode))" @@ -10202,7 +10200,6 @@ li %0,%1 lis %0,%v1 # - la %0,%a1 fmr %0,%1 lfd%U1%X1 %0,%1 stfd%U0%X0 %1,%0 @@ -10211,12 +10208,12 @@ {cror 0,0,0|nop} mftgpr %0,%1 mffgpr %0,%1" - [(set_attr "type" "*,load,store,*,*,*,*,fp,fpload,fpstore,mfjmpr,mtjmpr,*,mftgpr,mffgpr") - (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4")]) + [(set_attr "type" "*,load,store,*,*,*,fp,fpload,fpstore,mfjmpr,mtjmpr,*,mftgpr,mffgpr") + (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4")]) (define_insn "*movdi_internal64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,*d,*d,m,r,*h,*h,?wa") - (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,R,d,m,d,*h,r,0,O"))] + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,*d,*d,m,r,*h,*h,?wa") + (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,d,m,d,*h,r,0,O"))] "TARGET_POWERPC64 && (!TARGET_MFPGPR || !TARGET_HARD_FLOAT || !TARGET_FPRS) && (gpc_reg_operand (operands[0], DImode) || gpc_reg_operand (operands[1], DImode))" @@ -10227,7 +10224,6 @@ li %0,%1 lis %0,%v1 # - la %0,%a1 fmr %0,%1 lfd%U1%X1 %0,%1 stfd%U0%X0 %1,%0 @@ -10235,8 +10231,8 @@ mt%0 %1 {cror 0,0,0|nop} xxlxor %x0,%x0,%x0" - [(set_attr "type" "*,load,store,*,*,*,*,fp,fpload,fpstore,mfjmpr,mtjmpr,*,vecsimple") - (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4")]) + [(set_attr "type" "*,load,store,*,*,*,fp,fpload,fpstore,mfjmpr,mtjmpr,*,vecsimple") + (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4")]) ;; immediate value valid for a single instruction hiding in a const_double (define_insn "" @@ -11592,10 +11588,8 @@ "addi %0,%1,%2@got@tlsgd" "&& TARGET_CMODEL != CMODEL_SMALL" [(set (match_dup 3) - (const:TLSmode - (plus:TLSmode (match_dup 1) - (high:TLSmode - (unspec:TLSmode [(match_dup 2)] UNSPEC_TLSGD))))) + (high:TLSmode + (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGD))) (set (match_dup 0) (lo_sum:TLSmode (match_dup 3) (unspec:TLSmode [(match_dup 2)] UNSPEC_TLSGD)))] @@ -11610,11 +11604,10 @@ (define_insn "*tls_gd_high<TLSmode:tls_abi_suffix>" [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (const:TLSmode - (plus:TLSmode (match_operand:TLSmode 1 "gpc_reg_operand" "b") - (high:TLSmode - (unspec:TLSmode [(match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGD)))))] + (high:TLSmode + (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") + (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGD)))] "HAVE_AS_TLS && TARGET_TLS_MARKERS && TARGET_CMODEL != CMODEL_SMALL" "addis %0,%1,%2@got@tlsgd@ha" [(set_attr "length" "4")]) @@ -11729,10 +11722,8 @@ "addi %0,%1,%&@got@tlsld" "&& TARGET_CMODEL != CMODEL_SMALL" [(set (match_dup 2) - (const:TLSmode - (plus:TLSmode (match_dup 1) - (high:TLSmode - (unspec:TLSmode [(const_int 0)] UNSPEC_TLSLD))))) + (high:TLSmode + (unspec:TLSmode [(const_int 0) (match_dup 1)] UNSPEC_TLSLD))) (set (match_dup 0) (lo_sum:TLSmode (match_dup 2) (unspec:TLSmode [(const_int 0)] UNSPEC_TLSLD)))] @@ -11747,10 +11738,10 @@ (define_insn "*tls_ld_high<TLSmode:tls_abi_suffix>" [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (const:TLSmode - (plus:TLSmode (match_operand:TLSmode 1 "gpc_reg_operand" "b") - (high:TLSmode - (unspec:TLSmode [(const_int 0)] UNSPEC_TLSLD)))))] + (high:TLSmode + (unspec:TLSmode [(const_int 0) + (match_operand:TLSmode 1 "gpc_reg_operand" "b")] + UNSPEC_TLSLD)))] "HAVE_AS_TLS && TARGET_TLS_MARKERS && TARGET_CMODEL != CMODEL_SMALL" "addis %0,%1,%&@got@tlsld@ha" [(set_attr "length" "4")]) @@ -11826,10 +11817,8 @@ "l<TLSmode:tls_insn_suffix> %0,%2@got@dtprel(%1)" "&& TARGET_CMODEL != CMODEL_SMALL" [(set (match_dup 3) - (const:TLSmode - (plus:TLSmode (match_dup 1) - (high:TLSmode - (unspec:TLSmode [(match_dup 2)] UNSPEC_TLSGOTDTPREL))))) + (high:TLSmode + (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTDTPREL))) (set (match_dup 0) (lo_sum:TLSmode (match_dup 3) (unspec:TLSmode [(match_dup 2)] UNSPEC_TLSGOTDTPREL)))] @@ -11844,11 +11833,10 @@ (define_insn "*tls_got_dtprel_high<TLSmode:tls_abi_suffix>" [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (const:TLSmode - (plus:TLSmode (match_operand:TLSmode 1 "gpc_reg_operand" "b") - (high:TLSmode - (unspec:TLSmode [(match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGOTDTPREL)))))] + (high:TLSmode + (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") + (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGOTDTPREL)))] "HAVE_AS_TLS && TARGET_CMODEL != CMODEL_SMALL" "addis %0,%1,%2@got@dtprel@ha" [(set_attr "length" "4")]) @@ -11898,10 +11886,8 @@ "l<TLSmode:tls_insn_suffix> %0,%2@got@tprel(%1)" "&& TARGET_CMODEL != CMODEL_SMALL" [(set (match_dup 3) - (const:TLSmode - (plus:TLSmode (match_dup 1) - (high:TLSmode - (unspec:TLSmode [(match_dup 2)] UNSPEC_TLSGOTTPREL))))) + (high:TLSmode + (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTTPREL))) (set (match_dup 0) (lo_sum:TLSmode (match_dup 3) (unspec:TLSmode [(match_dup 2)] UNSPEC_TLSGOTTPREL)))] @@ -11916,11 +11902,10 @@ (define_insn "*tls_got_tprel_high<TLSmode:tls_abi_suffix>" [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (const:TLSmode - (plus:TLSmode (match_operand:TLSmode 1 "gpc_reg_operand" "b") - (high:TLSmode - (unspec:TLSmode [(match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGOTTPREL)))))] + (high:TLSmode + (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") + (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGOTTPREL)))] "HAVE_AS_TLS && TARGET_CMODEL != CMODEL_SMALL" "addis %0,%1,%2@got@tprel@ha" [(set_attr "length" "4")]) @@ -12277,6 +12262,45 @@ DONE; }") +;; Largetoc support +(define_insn "*largetoc_high" + [(set (match_operand:DI 0 "gpc_reg_operand" "=b*r") + (high:DI + (unspec [(match_operand:DI 1 "" "") + (match_operand:DI 2 "gpc_reg_operand" "b")] + UNSPEC_TOCREL)))] + "TARGET_ELF && TARGET_CMODEL != CMODEL_SMALL" + "{cau|addis} %0,%2,%1@toc@ha") + +(define_insn "*largetoc_high_plus" + [(set (match_operand:DI 0 "gpc_reg_operand" "=b*r") + (high:DI + (plus:DI + (unspec [(match_operand:DI 1 "" "") + (match_operand:DI 2 "gpc_reg_operand" "b")] + UNSPEC_TOCREL) + (match_operand 3 "const_int_operand" "n"))))] + "TARGET_ELF && TARGET_CMODEL != CMODEL_SMALL" + "{cau|addis} %0,%2,%1+%3@toc@ha") + +(define_insn "*largetoc_low" + [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") + (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b,!*r") + (match_operand:DI 2 "" "")))] + "TARGET_ELF && TARGET_CMODEL != CMODEL_SMALL" + "@ + {cal %0,%2@l(%1)|addi %0,%1,%2@l} + {ai|addic} %0,%1,%2@l") + +(define_insn_and_split "*tocref<mode>" + [(set (match_operand:P 0 "gpc_reg_operand" "=b*r") + (match_operand:P 1 "small_toc_ref" "R"))] + "TARGET_TOC" + "{cal|la} %0,%a1" + "&& TARGET_ELF && TARGET_CMODEL != CMODEL_SMALL && reload_completed" + [(set (match_dup 0) (high:P (match_dup 1))) + (set (match_dup 0) (lo_sum:P (match_dup 0) (match_dup 1)))]) + ;; Elf specific ways of loading addresses for non-PIC code. ;; The output of this could be r0, but we make a very strong ;; preference for a base register because it will usually @@ -12295,22 +12319,6 @@ "@ {cal|la} %0,%2@l(%1) {ai|addic} %0,%1,%K2") - -;; Largetoc support -(define_insn "largetoc_high" - [(set (match_operand:DI 0 "gpc_reg_operand" "=b") - (const:DI - (plus:DI (match_operand:DI 1 "gpc_reg_operand" "b") - (high:DI (match_operand:DI 2 "" "")))))] - "TARGET_ELF && TARGET_CMODEL != CMODEL_SMALL" - "{cau|addis} %0,%1,%2@ha") - -(define_insn "largetoc_low" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b") - (match_operand:DI 2 "" "")))] - "TARGET_ELF && TARGET_CMODEL != CMODEL_SMALL" - "{cal %0,%2@l(%1)|addi %0,%1,%2@l}") ;; Call and call_value insns (define_expand "call" diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h index 5641162fab4..60398df4849 100644 --- a/gcc/config/rs6000/rtems.h +++ b/gcc/config/rs6000/rtems.h @@ -55,17 +55,3 @@ #undef SUBSUBTARGET_EXTRA_SPECS #define SUBSUBTARGET_EXTRA_SPECS \ { "cpp_os_rtems", CPP_OS_RTEMS_SPEC } - -#undef SUBSUBTARGET_OVERRIDE_OPTIONS -#define SUBSUBTARGET_OVERRIDE_OPTIONS \ - do { \ - if (TARGET_E500) \ - { \ - if (TARGET_HARD_FLOAT && !global_options_set.x_rs6000_float_gprs) \ - rs6000_float_gprs = 1; \ - if (rs6000_float_gprs != 0 && !global_options_set.x_rs6000_spe) \ - rs6000_spe = 1; \ - if (rs6000_spe && !global_options_set.x_rs6000_spe_abi) \ - rs6000_spe_abi = 1; \ - } \ - } while(0) diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h index bef041cf39e..dc311d206c4 100644 --- a/gcc/config/rs6000/vxworks.h +++ b/gcc/config/rs6000/vxworks.h @@ -122,19 +122,8 @@ VXWORKS_ADDITIONAL_CPP_SPEC #undef ABI_STACK_BOUNDARY -/* Make -mcpu=8540 imply SPE. ISEL is automatically enabled, the - others must be done by hand. Handle -mrtp. Disable -fPIC - for -mrtp - the VxWorks PIC model is not compatible with it. */ #undef SUBSUBTARGET_OVERRIDE_OPTIONS #define SUBSUBTARGET_OVERRIDE_OPTIONS \ - do { \ - if (TARGET_E500) \ - { \ - rs6000_spe = 1; \ - rs6000_spe_abi = 1; \ - rs6000_float_gprs = 1; \ - } \ - \ if (!global_options_set.x_g_switch_value) \ g_switch_value = SDATA_DEFAULT_SIZE; \ VXWORKS_OVERRIDE_OPTIONS; \ diff --git a/gcc/configure b/gcc/configure index 557a4cc794d..db2021ca2d4 100755 --- a/gcc/configure +++ b/gcc/configure @@ -13746,7 +13746,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -17960,7 +17967,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17963 "configure" +#line 17970 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18066,7 +18073,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18069 "configure" +#line 18076 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -26657,6 +26664,11 @@ else $target_header_dir/bits/uClibc_config.h > /dev/null; then gcc_cv_libc_provides_ssp=yes fi + # all versions of Bionic support stack protector + elif test -f $target_header_dir/sys/cdefs.h \ + && $EGREP '^[ ]*#[ ]*define[ ]+__BIONIC__[ ]+1' \ + $target_header_dir/sys/cdefs.h > /dev/null; then + gcc_cv_libc_provides_ssp=yes fi ;; *-*-gnu*) diff --git a/gcc/configure.ac b/gcc/configure.ac index 2c17736edf2..6b793c4b205 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4566,6 +4566,11 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library, $target_header_dir/bits/uClibc_config.h > /dev/null; then gcc_cv_libc_provides_ssp=yes fi + # all versions of Bionic support stack protector + elif test -f $target_header_dir/sys/cdefs.h \ + && $EGREP '^[ ]*#[ ]*define[ ]+__BIONIC__[ ]+1' \ + $target_header_dir/sys/cdefs.h > /dev/null; then + gcc_cv_libc_provides_ssp=yes fi] ;; *-*-gnu*) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3555be4c22f..2d69a3feb21 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,85 @@ +2012-05-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/39681 + * parser.c (cp_parser_new_type_id): Early return error_mark_node + if the cp_parser_type_specifier_seq call has type_specifier_seq.type + error_mark_node; tidy. + (cp_parser_new_expression): Always initialize nelts to NULL_TREE to + avoid uninitialized warnings. + (cp_parser_init_declarator, cp_parser_late_parse_one_default_arg): + Call cp_parser_skip_to_end_of_statement if cp_parser_initializer + returns error_mark_node. + +2012-05-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/53371 + * except.c (is_admissible_throw_operand): Rename to + is_admissible_throw_operand_or_catch_parameter and handle + catch parameter too. + (expand_start_catch_block): Use it. + (build_throw): Adjust. + +2012-05-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/44516 + * typeck.c (build_x_array_ref, build_x_conditional_expr, + build_x_compound_expr, build_x_modify_expr): Add location_t parameter. + (finish_class_member_access_expr, build_x_indirect_ref, + build_x_binary_op, build_x_compound_expr_from_list, + build_x_compound_expr_from_vec): Adjust callers. + * tree.c (build_min_nt_loc): New. + (build_min_nt): Remove. + * typeck2.c (build_x_arrow): Adjust callers. + * pt.c (tsubst_qualified_id, tsubst_omp_for_iterator, + tsubst_copy_and_build): Likewise. + * semantics.c (finish_mem_initializers, handle_omp_for_class_iterator, + finish_omp_atomic): Likewise. + * decl2.c (grok_array_decl, build_anon_union_vars): Adjust. + * parser.c (cp_parser_question_colon_clause, + cp_parser_assignment_expression, cp_parser_expression, + cp_parser_template_id, cp_parser_omp_for_loop): Likewise. + * cp-tree.h: Update. + +2012-05-16 Dodji Seketeli <dodji@redhat.com> + + PR preprocessor/7263 + * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all + the possible declarator specifiers so far. + (struct cp_decl_specifier_seq::locations): Declare new member. + (cp_decl_specifier_seq::{specs, type_location}): Remove. + (decl_spec_seq_has_spec_p): Declare new function. + * parser.c (cp_parser_check_decl_spec): Remove. + (set_and_check_decl_spec_loc): Define new static function. + (decl_spec_seq_has_spec_p): Define new public function. + (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt) + (cp_parser_type_specifier, cp_parser_simple_type_specifier) + (cp_parser_set_storage_class, cp_parser_set_decl_spec_type) + (cp_parser_alias_declaration): Set the locations for each + declspec, using set_and_check_decl_spec_loc. + (cp_parser_explicit_instantiation, cp_parser_init_declarator) + (cp_parser_member_declaration, cp_parser_init_declarator): Use the + new declspec location for specifiers. Use the new + decl_spec_seq_has_spec_p. + (cp_parser_type_specifier_seq): Use the new + set_and_check_decl_spec_loc. Stop using + cp_parser_check_decl_spec. Use the new decl_spec_seq_has_spec_p. + (, cp_parser_init_declarator): Use the new + set_and_check_decl_spec_loc. + (cp_parser_single_declaration, cp_parser_friend_p) + (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration): + Use the new decl_spec_seq_has_spec_p. + * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p. Use + the more precise ds_redefined_builtin_type_spec location for + diagnostics about re-declaring C++ built-in types. + (start_decl, grokvardecl, grokdeclarator): Use the new + decl_spec_seq_has_spec_p. + +2012-05-15 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/11856 + * pt.c (tsubst_copy_and_build): Increase / decrease + c_inhibit_evaluation_warnings around build_x_binary_op call. + 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com> * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index e5ec1d4841f..f2e98c81bb0 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4647,7 +4647,9 @@ typedef enum cp_storage_class { sc_mutable } cp_storage_class; -/* An individual decl-specifier. */ +/* An individual decl-specifier. This is used to index the array of + locations for the declspecs in struct cp_decl_specifier_seq + below. */ typedef enum cp_decl_spec { ds_first, @@ -4667,17 +4669,20 @@ typedef enum cp_decl_spec { ds_constexpr, ds_complex, ds_thread, - ds_last + ds_type_spec, + ds_redefined_builtin_type_spec, + ds_attribute, + ds_storage_class, + ds_long_long, + ds_last /* This enumerator must always be the last one. */ } cp_decl_spec; /* A decl-specifier-seq. */ typedef struct cp_decl_specifier_seq { - /* The number of times each of the keywords has been seen. */ - unsigned specs[(int) ds_last]; - /* The location of the primary type. Mainly used for error - reporting. */ - location_t type_location; + /* An array of locations for the declaration sepecifiers, indexed by + enum cp_decl_spec_word. */ + source_location locations[ds_last]; /* The primary type, if any, given by the decl-specifier-seq. Modifiers, like "short", "const", and "unsigned" are not reflected here. This field will be a TYPE, unless a typedef-name @@ -4827,6 +4832,8 @@ struct GTY((chain_next ("%h.next"))) tinst_level { bool in_system_header_p; }; +bool decl_spec_seq_has_spec_p (const cp_decl_specifier_seq *, cp_decl_spec); + /* Return the type of the `this' parameter of FNTYPE. */ static inline tree @@ -5684,7 +5691,8 @@ extern bool lvalue_or_rvalue_with_address_p (const_tree); extern bool xvalue_p (const_tree); extern bool builtin_valid_in_constant_expr_p (const_tree); extern tree build_min (enum tree_code, tree, ...); -extern tree build_min_nt (enum tree_code, ...); +extern tree build_min_nt_loc (location_t, enum tree_code, + ...); extern tree build_min_non_dep (enum tree_code, tree, ...); extern tree build_min_non_dep_call_vec (tree, tree, VEC(tree,gc) *); extern tree build_cplus_new (tree, tree, tsubst_flags_t); @@ -5813,7 +5821,8 @@ extern tree build_x_binary_op (location_t, enum tree_code, tree, enum tree_code, tree *, tsubst_flags_t); -extern tree build_x_array_ref (tree, tree, tsubst_flags_t); +extern tree build_x_array_ref (location_t, tree, tree, + tsubst_flags_t); extern tree build_x_unary_op (location_t, enum tree_code, tree, tsubst_flags_t); @@ -5822,12 +5831,13 @@ extern tree cp_build_addr_expr_strict (tree, tsubst_flags_t); extern tree cp_build_unary_op (enum tree_code, tree, int, tsubst_flags_t); extern tree unary_complex_lvalue (enum tree_code, tree); -extern tree build_x_conditional_expr (tree, tree, tree, +extern tree build_x_conditional_expr (location_t, tree, tree, tree, tsubst_flags_t); extern tree build_x_compound_expr_from_list (tree, expr_list_kind, tsubst_flags_t); extern tree build_x_compound_expr_from_vec (VEC(tree,gc) *, const char *); -extern tree build_x_compound_expr (tree, tree, tsubst_flags_t); +extern tree build_x_compound_expr (location_t, tree, tree, + tsubst_flags_t); extern tree build_compound_expr (location_t, tree, tree); extern tree cp_build_compound_expr (tree, tree, tsubst_flags_t); extern tree build_static_cast (tree, tree, tsubst_flags_t); @@ -5835,7 +5845,8 @@ extern tree build_reinterpret_cast (tree, tree, tsubst_flags_t); extern tree build_const_cast (tree, tree, tsubst_flags_t); extern tree build_c_cast (location_t, tree, tree); extern tree cp_build_c_cast (tree, tree, tsubst_flags_t); -extern tree build_x_modify_expr (tree, enum tree_code, tree, +extern tree build_x_modify_expr (location_t, tree, + enum tree_code, tree, tsubst_flags_t); extern tree cp_build_modify_expr (tree, enum tree_code, tree, tsubst_flags_t); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 8d7d7451768..fa9fcc8da9b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4129,8 +4129,8 @@ fixup_anonymous_aggr (tree t) tree check_tag_decl (cp_decl_specifier_seq *declspecs) { - int saw_friend = declspecs->specs[(int)ds_friend] != 0; - int saw_typedef = declspecs->specs[(int)ds_typedef] != 0; + int saw_friend = decl_spec_seq_has_spec_p (declspecs, ds_friend); + int saw_typedef = decl_spec_seq_has_spec_p (declspecs, ds_typedef); /* If a class, struct, or enum type is declared by the DECLSPECS (i.e, if a class-specifier, enum-specifier, or non-typename elaborated-type-specifier appears in the DECLSPECS), @@ -4143,7 +4143,8 @@ check_tag_decl (cp_decl_specifier_seq *declspecs) else if (declspecs->redefined_builtin_type) { if (!in_system_header) - permerror (input_location, "redeclaration of C++ built-in type %qT", + permerror (declspecs->locations[ds_redefined_builtin_type_spec], + "redeclaration of C++ built-in type %qT", declspecs->redefined_builtin_type); return NULL_TREE; } @@ -4198,29 +4199,29 @@ check_tag_decl (cp_decl_specifier_seq *declspecs) else { - if (declspecs->specs[(int)ds_inline] - || declspecs->specs[(int)ds_virtual]) + if (decl_spec_seq_has_spec_p (declspecs, ds_inline) + || decl_spec_seq_has_spec_p (declspecs, ds_virtual)) error ("%qs can only be specified for functions", - declspecs->specs[(int)ds_inline] + decl_spec_seq_has_spec_p (declspecs, ds_inline) ? "inline" : "virtual"); else if (saw_friend && (!current_class_type || current_scope () != current_class_type)) error ("%<friend%> can only be specified inside a class"); - else if (declspecs->specs[(int)ds_explicit]) + else if (decl_spec_seq_has_spec_p (declspecs, ds_explicit)) error ("%<explicit%> can only be specified for constructors"); else if (declspecs->storage_class) error ("a storage class can only be specified for objects " "and functions"); - else if (declspecs->specs[(int)ds_const] - || declspecs->specs[(int)ds_volatile] - || declspecs->specs[(int)ds_restrict] - || declspecs->specs[(int)ds_thread]) + else if (decl_spec_seq_has_spec_p (declspecs, ds_const) + || decl_spec_seq_has_spec_p (declspecs, ds_volatile) + || decl_spec_seq_has_spec_p (declspecs, ds_restrict) + || decl_spec_seq_has_spec_p (declspecs, ds_thread)) error ("qualifiers can only be specified for objects " "and functions"); else if (saw_typedef) warning (0, "%<typedef%> was ignored in this declaration"); - else if (declspecs->specs[(int) ds_constexpr]) + else if (decl_spec_seq_has_spec_p (declspecs, ds_constexpr)) error ("%<constexpr%> cannot be used for type declarations"); } @@ -4472,7 +4473,7 @@ start_decl (const cp_declarator *declarator, error ("duplicate initialization of %qD", decl); if (duplicate_decls (decl, field, /*newdecl_is_friend=*/false)) decl = field; - if (declspecs->specs[(int) ds_constexpr] + if (decl_spec_seq_has_spec_p (declspecs, ds_constexpr) && !DECL_DECLARED_CONSTEXPR_P (field)) error ("%qD declared %<constexpr%> outside its class", field); } @@ -7682,7 +7683,7 @@ grokvardecl (tree type, TREE_PUBLIC (decl) = DECL_EXTERNAL (decl); } - if (declspecs->specs[(int)ds_thread]) + if (decl_spec_seq_has_spec_p (declspecs, ds_thread)) DECL_TLS_MODEL (decl) = decl_default_tls_model (decl); /* If the type of the decl has no linkage, make sure that we'll @@ -8436,16 +8437,16 @@ grokdeclarator (const cp_declarator *declarator, bool parameter_pack_p = declarator? declarator->parameter_pack_p : false; bool template_type_arg = false; bool template_parm_flag = false; - bool constexpr_p = declspecs->specs[(int) ds_constexpr]; + bool constexpr_p = decl_spec_seq_has_spec_p (declspecs, ds_constexpr); const char *errmsg; - signed_p = declspecs->specs[(int)ds_signed]; - unsigned_p = declspecs->specs[(int)ds_unsigned]; - short_p = declspecs->specs[(int)ds_short]; - long_p = declspecs->specs[(int)ds_long]; - longlong = declspecs->specs[(int)ds_long] >= 2; + signed_p = decl_spec_seq_has_spec_p (declspecs, ds_signed); + unsigned_p = decl_spec_seq_has_spec_p (declspecs, ds_unsigned); + short_p = decl_spec_seq_has_spec_p (declspecs, ds_short); + long_p = decl_spec_seq_has_spec_p (declspecs, ds_long); + longlong = decl_spec_seq_has_spec_p (declspecs, ds_long_long); explicit_int128 = declspecs->explicit_int128_p; - thread_p = declspecs->specs[(int)ds_thread]; + thread_p = decl_spec_seq_has_spec_p (declspecs, ds_thread); if (decl_context == FUNCDEF) funcdef_flag = true, decl_context = NORMAL; @@ -8646,7 +8647,7 @@ grokdeclarator (const cp_declarator *declarator, if (dname && IDENTIFIER_OPNAME_P (dname)) { - if (declspecs->specs[(int)ds_typedef]) + if (decl_spec_seq_has_spec_p (declspecs, ds_typedef)) { error ("declaration of %qD as %<typedef%>", dname); return error_mark_node; @@ -8684,7 +8685,7 @@ grokdeclarator (const cp_declarator *declarator, if (name == NULL) name = decl_context == PARM ? "parameter" : "type name"; - if (constexpr_p && declspecs->specs[(int)ds_typedef]) + if (constexpr_p && decl_spec_seq_has_spec_p (declspecs, ds_typedef)) { error ("%<constexpr%> cannot appear in a typedef declaration"); return error_mark_node; @@ -8910,7 +8911,7 @@ grokdeclarator (const cp_declarator *declarator, else if (short_p) type = short_integer_type_node; - if (declspecs->specs[(int)ds_complex]) + if (decl_spec_seq_has_spec_p (declspecs, ds_complex)) { if (TREE_CODE (type) != INTEGER_TYPE && TREE_CODE (type) != REAL_TYPE) error ("complex invalid for %qs", name); @@ -8934,11 +8935,11 @@ grokdeclarator (const cp_declarator *declarator, } type_quals = TYPE_UNQUALIFIED; - if (declspecs->specs[(int)ds_const]) + if (decl_spec_seq_has_spec_p (declspecs, ds_const)) type_quals |= TYPE_QUAL_CONST; - if (declspecs->specs[(int)ds_volatile]) + if (decl_spec_seq_has_spec_p (declspecs, ds_volatile)) type_quals |= TYPE_QUAL_VOLATILE; - if (declspecs->specs[(int)ds_restrict]) + if (decl_spec_seq_has_spec_p (declspecs, ds_restrict)) type_quals |= TYPE_QUAL_RESTRICT; if (sfk == sfk_conversion && type_quals != TYPE_UNQUALIFIED) error ("qualifiers are not allowed on declaration of %<operator %T%>", @@ -8963,9 +8964,9 @@ grokdeclarator (const cp_declarator *declarator, type_quals = cp_type_quals (type); staticp = 0; - inlinep = !! declspecs->specs[(int)ds_inline]; - virtualp = !! declspecs->specs[(int)ds_virtual]; - explicitp = !! declspecs->specs[(int)ds_explicit]; + inlinep = decl_spec_seq_has_spec_p (declspecs, ds_inline); + virtualp = decl_spec_seq_has_spec_p (declspecs, ds_virtual); + explicitp = decl_spec_seq_has_spec_p (declspecs, ds_explicit); storage_class = declspecs->storage_class; if (storage_class == sc_static) @@ -8977,7 +8978,7 @@ grokdeclarator (const cp_declarator *declarator, storage_class = sc_none; staticp = 0; } - friendp = !! declspecs->specs[(int)ds_friend]; + friendp = decl_spec_seq_has_spec_p (declspecs, ds_friend); if (dependent_name && !friendp) { @@ -8988,7 +8989,7 @@ grokdeclarator (const cp_declarator *declarator, /* Issue errors about use of storage classes for parameters. */ if (decl_context == PARM) { - if (declspecs->specs[(int)ds_typedef]) + if (decl_spec_seq_has_spec_p (declspecs, ds_typedef)) { error ("typedef declaration invalid in parameter declaration"); return error_mark_node; @@ -9032,7 +9033,7 @@ grokdeclarator (const cp_declarator *declarator, && ((storage_class && storage_class != sc_extern && storage_class != sc_static) - || declspecs->specs[(int)ds_typedef])) + || decl_spec_seq_has_spec_p (declspecs, ds_typedef))) { error ("multiple storage classes in declaration of %qs", name); thread_p = false; @@ -9046,7 +9047,7 @@ grokdeclarator (const cp_declarator *declarator, && (storage_class == sc_register || storage_class == sc_auto)) ; - else if (declspecs->specs[(int)ds_typedef]) + else if (decl_spec_seq_has_spec_p (declspecs, ds_typedef)) ; else if (decl_context == FIELD /* C++ allows static class elements. */ @@ -9640,7 +9641,7 @@ grokdeclarator (const cp_declarator *declarator, return error_mark_node; } } - else if (declspecs->specs[(int)ds_typedef] + else if (decl_spec_seq_has_spec_p (declspecs, ds_typedef) && current_class_type) { error ("cannot declare member %<%T::%s%> within %qT", @@ -9711,7 +9712,8 @@ grokdeclarator (const cp_declarator *declarator, error ("non-member %qs cannot be declared %<mutable%>", name); storage_class = sc_none; } - else if (decl_context == TYPENAME || declspecs->specs[(int)ds_typedef]) + else if (decl_context == TYPENAME + || decl_spec_seq_has_spec_p (declspecs, ds_typedef)) { error ("non-object member %qs cannot be declared %<mutable%>", name); storage_class = sc_none; @@ -9741,7 +9743,7 @@ grokdeclarator (const cp_declarator *declarator, } /* If this is declaring a typedef name, return a TYPE_DECL. */ - if (declspecs->specs[(int)ds_typedef] && decl_context != TYPENAME) + if (decl_spec_seq_has_spec_p (declspecs, ds_typedef) && decl_context != TYPENAME) { tree decl; @@ -9853,7 +9855,7 @@ grokdeclarator (const cp_declarator *declarator, memfn_quals != TYPE_UNQUALIFIED, inlinep, friendp, raises != NULL_TREE); - if (declspecs->specs[(int)ds_alias]) + if (decl_spec_seq_has_spec_p (declspecs, ds_alias)) /* Acknowledge that this was written: `using analias = atype;'. */ TYPE_DECL_ALIAS_P (decl) = 1; @@ -10352,7 +10354,7 @@ grokdeclarator (const cp_declarator *declarator, and `extern' makes no difference. */ if (! toplevel_bindings_p () && (storage_class == sc_static - || declspecs->specs[(int)ds_inline]) + || decl_spec_seq_has_spec_p (declspecs, ds_inline)) && pedantic) { if (storage_class == sc_static) diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index b0544bbb91d..c40b830a1aa 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -350,8 +350,8 @@ grok_array_decl (location_t loc, tree array_expr, tree index_exp) { if (type_dependent_expression_p (array_expr) || type_dependent_expression_p (index_exp)) - return build_min_nt (ARRAY_REF, array_expr, index_exp, - NULL_TREE, NULL_TREE); + return build_min_nt_loc (loc, ARRAY_REF, array_expr, index_exp, + NULL_TREE, NULL_TREE); array_expr = build_non_dependent_expr (array_expr); index_exp = build_non_dependent_expr (index_exp); } @@ -362,9 +362,8 @@ grok_array_decl (location_t loc, tree array_expr, tree index_exp) /* If they have an `operator[]', use that. */ if (MAYBE_CLASS_TYPE_P (type) || MAYBE_CLASS_TYPE_P (TREE_TYPE (index_exp))) - expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL, - array_expr, index_exp, NULL_TREE, - /*overload=*/NULL, tf_warning_or_error); + expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL, array_expr, index_exp, + NULL_TREE, /*overload=*/NULL, tf_warning_or_error); else { tree p1, p2, i1, i2; @@ -864,7 +863,7 @@ grokfield (const cp_declarator *declarator, cplus_decl_attributes (&value, attrlist, attrflags); } - if (declspecs->specs[(int)ds_typedef] + if (decl_spec_seq_has_spec_p (declspecs, ds_typedef) && TREE_TYPE (value) != error_mark_node && TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value))) != value) set_underlying_type (value); @@ -1370,8 +1369,8 @@ build_anon_union_vars (tree type, tree object) permerror (input_location, "protected member %q+#D in anonymous union", field); if (processing_template_decl) - ref = build_min_nt (COMPONENT_REF, object, - DECL_NAME (field), NULL_TREE); + ref = build_min_nt_loc (UNKNOWN_LOCATION, COMPONENT_REF, object, + DECL_NAME (field), NULL_TREE); else ref = build_class_member_access_expr (object, field, NULL_TREE, false, tf_warning_or_error); diff --git a/gcc/cp/except.c b/gcc/cp/except.c index d39cfa6abd3..f4af7806fe1 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -46,7 +46,7 @@ static void initialize_handler_parm (tree, tree); static tree do_allocate_exception (tree); static tree wrap_cleanups_r (tree *, int *, void *); static int complete_ptr_ref_or_void_ptr_p (tree, tree); -static bool is_admissible_throw_operand (tree); +static bool is_admissible_throw_operand_or_catch_parameter (tree, bool); static int can_convert_eh (tree, tree); /* Sets up all the global eh stuff that needs to be initialized at the @@ -485,12 +485,13 @@ expand_start_catch_block (tree decl) if (! doing_eh ()) return NULL_TREE; - /* Make sure this declaration is reasonable. */ - if (decl && !complete_ptr_ref_or_void_ptr_p (TREE_TYPE (decl), NULL_TREE)) - decl = error_mark_node; - if (decl) - type = prepare_eh_type (TREE_TYPE (decl)); + { + if (!is_admissible_throw_operand_or_catch_parameter (decl, false)) + decl = error_mark_node; + + type = prepare_eh_type (TREE_TYPE (decl)); + } else type = NULL_TREE; @@ -720,7 +721,7 @@ build_throw (tree exp) if (exp != NULL_TREE) { - if (!is_admissible_throw_operand (exp)) + if (!is_admissible_throw_operand_or_catch_parameter (exp, true)) return error_mark_node; } @@ -944,14 +945,21 @@ complete_ptr_ref_or_void_ptr_p (tree type, tree from) return 1; } -/* Return truth-value if EXPRESSION is admissible in throw-expression, - i.e. if it is not of incomplete type or a pointer/reference to such - a type or of an abstract class type. */ +/* If IS_THROW is true return truth-value if T is an expression admissible + in throw-expression, i.e. if it is not of incomplete type or a pointer/ + reference to such a type or of an abstract class type. + If IS_THROW is false, likewise for a catch parameter, same requirements + for its type plus rvalue reference type is also not admissible. */ static bool -is_admissible_throw_operand (tree expr) +is_admissible_throw_operand_or_catch_parameter (tree t, bool is_throw) { - tree type = TREE_TYPE (expr); + tree expr = is_throw ? t : NULL_TREE; + tree type = TREE_TYPE (t); + + /* C++11 [except.handle] The exception-declaration shall not denote + an incomplete type, an abstract class type, or an rvalue reference + type. */ /* 15.1/4 [...] The type of the throw-expression shall not be an incomplete type, or a pointer or a reference to an incomplete @@ -968,8 +976,20 @@ is_admissible_throw_operand (tree expr) conversion. */ else if (CLASS_TYPE_P (type) && CLASSTYPE_PURE_VIRTUALS (type)) { - error ("expression %qE of abstract class type %qT cannot " - "be used in throw-expression", expr, type); + if (is_throw) + error ("expression %qE of abstract class type %qT cannot " + "be used in throw-expression", expr, type); + else + error ("cannot declare catch parameter to be of abstract " + "class type %qT", type); + return false; + } + else if (!is_throw + && TREE_CODE (type) == REFERENCE_TYPE + && TYPE_REF_IS_RVALUE (type)) + { + error ("cannot declare catch parameter to be of rvalue " + "reference type %qT", type); return false; } diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index dc64fa1f62a..e51ab7453f3 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -2223,6 +2223,9 @@ static void cp_parser_set_storage_class (cp_parser *, cp_decl_specifier_seq *, enum rid, location_t); static void cp_parser_set_decl_spec_type (cp_decl_specifier_seq *, tree, location_t, bool); +static void set_and_check_decl_spec_loc + (cp_decl_specifier_seq *decl_specs, + cp_decl_spec ds, source_location location); static bool cp_parser_friend_p (const cp_decl_specifier_seq *); static void cp_parser_required_error @@ -2494,53 +2497,6 @@ cp_parser_simulate_error (cp_parser* parser) return false; } -/* Check for repeated decl-specifiers. */ - -static void -cp_parser_check_decl_spec (cp_decl_specifier_seq *decl_specs, - location_t location) -{ - int ds; - - for (ds = ds_first; ds != ds_last; ++ds) - { - unsigned count = decl_specs->specs[ds]; - if (count < 2) - continue; - /* The "long" specifier is a special case because of "long long". */ - if (ds == ds_long) - { - if (count > 2) - error_at (location, "%<long long long%> is too long for GCC"); - else - pedwarn_cxx98 (location, OPT_Wlong_long, - "ISO C++ 1998 does not support %<long long%>"); - } - else if (count > 1) - { - static const char *const decl_spec_names[] = { - "signed", - "unsigned", - "short", - "long", - "const", - "volatile", - "restrict", - "inline", - "virtual", - "explicit", - "friend", - "typedef", - "using", - "constexpr", - "__complex", - "__thread" - }; - error_at (location, "duplicate %qs", decl_spec_names[ds]); - } - } -} - /* This function is called when a type is defined. If type definitions are forbidden at this point, an error message is issued. */ @@ -6657,7 +6613,7 @@ cp_parser_new_expression (cp_parser* parser) VEC(tree,gc) *placement; tree type; VEC(tree,gc) *initializer; - tree nelts; + tree nelts = NULL_TREE; tree ret; /* Look for the optional `::' operator. */ @@ -6710,7 +6666,6 @@ cp_parser_new_expression (cp_parser* parser) "try removing the parentheses around the type-id"); cp_parser_direct_new_declarator (parser); } - nelts = NULL_TREE; } /* Otherwise, there must be a new-type-id. */ else @@ -6780,7 +6735,6 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts) cp_declarator *declarator; cp_declarator *outer_declarator; const char *saved_message; - tree type; /* The type-specifier sequence must not contain type definitions. (It cannot contain declarations of new types either, but if they @@ -6795,6 +6749,10 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts) &type_specifier_seq); /* Restore the old message. */ parser->type_definition_forbidden_message = saved_message; + + if (type_specifier_seq.type == error_mark_node) + return error_mark_node; + /* Parse the new-declarator. */ new_declarator = cp_parser_new_declarator_opt (parser); @@ -6831,8 +6789,7 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts) new_declarator = NULL; } - type = groktypename (&type_specifier_seq, new_declarator, false); - return type; + return groktypename (&type_specifier_seq, new_declarator, false); } /* Parse an (optional) new-declarator. @@ -7438,6 +7395,7 @@ cp_parser_question_colon_clause (cp_parser* parser, tree logical_or_expr) tree expr; tree assignment_expr; struct cp_token *token; + location_t loc = cp_lexer_peek_token (parser->lexer)->location; /* Consume the `?' token. */ cp_lexer_consume_token (parser->lexer); @@ -7472,7 +7430,7 @@ cp_parser_question_colon_clause (cp_parser* parser, tree logical_or_expr) c_inhibit_evaluation_warnings -= logical_or_expr == truthvalue_true_node; /* Build the conditional-expression. */ - return build_x_conditional_expr (logical_or_expr, + return build_x_conditional_expr (loc, logical_or_expr, expr, assignment_expr, tf_warning_or_error); @@ -7512,11 +7470,11 @@ cp_parser_assignment_expression (cp_parser* parser, bool cast_p, return cp_parser_question_colon_clause (parser, expr); else { - enum tree_code assignment_operator; + location_t loc = cp_lexer_peek_token (parser->lexer)->location; /* If it's an assignment-operator, we're using the second production. */ - assignment_operator + enum tree_code assignment_operator = cp_parser_assignment_operator_opt (parser); if (assignment_operator != ERROR_MARK) { @@ -7534,7 +7492,7 @@ cp_parser_assignment_expression (cp_parser* parser, bool cast_p, NIC_ASSIGNMENT)) return error_mark_node; /* Build the assignment expression. */ - expr = build_x_modify_expr (expr, + expr = build_x_modify_expr (loc, expr, assignment_operator, rhs, tf_warning_or_error); @@ -7643,6 +7601,7 @@ static tree cp_parser_expression (cp_parser* parser, bool cast_p, cp_id_kind * pidk) { tree expression = NULL_TREE; + location_t loc = UNKNOWN_LOCATION; while (true) { @@ -7656,7 +7615,7 @@ cp_parser_expression (cp_parser* parser, bool cast_p, cp_id_kind * pidk) if (!expression) expression = assignment_expression; else - expression = build_x_compound_expr (expression, + expression = build_x_compound_expr (loc, expression, assignment_expression, tf_warning_or_error); /* If the next token is not a comma, then we are done with the @@ -7664,6 +7623,7 @@ cp_parser_expression (cp_parser* parser, bool cast_p, cp_id_kind * pidk) if (cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA)) break; /* Consume the `,'. */ + loc = cp_lexer_peek_token (parser->lexer)->location; cp_lexer_consume_token (parser->lexer); /* A comma operator cannot appear in a constant-expression. */ if (cp_parser_non_integral_constant_expression (parser, NIC_COMMA)) @@ -10555,6 +10515,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser, { bool constructor_possible_p = !parser->in_declarator_p; cp_token *start_token = NULL; + cp_decl_spec ds; /* Clear DECL_SPECS. */ clear_decl_specs (decl_specs); @@ -10568,6 +10529,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser, bool constructor_p; bool found_decl_spec; cp_token *token; + ds = ds_last; /* Peek at the next token. */ token = cp_lexer_peek_token (parser->lexer); @@ -10583,6 +10545,8 @@ cp_parser_decl_specifier_seq (cp_parser* parser, decl_specs->attributes = chainon (decl_specs->attributes, cp_parser_attributes_opt (parser)); + if (decl_specs->locations[ds_attribute] == 0) + decl_specs->locations[ds_attribute] = token->location; continue; } /* Assume we will find a decl-specifier keyword. */ @@ -10602,14 +10566,14 @@ cp_parser_decl_specifier_seq (cp_parser* parser, } else { - ++decl_specs->specs[(int) ds_friend]; + ds = ds_friend; /* Consume the token. */ cp_lexer_consume_token (parser->lexer); } break; case RID_CONSTEXPR: - ++decl_specs->specs[(int) ds_constexpr]; + ds = ds_constexpr; cp_lexer_consume_token (parser->lexer); break; @@ -10626,7 +10590,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser, /* decl-specifier: typedef */ case RID_TYPEDEF: - ++decl_specs->specs[(int) ds_typedef]; + ds = ds_typedef; /* Consume the token. */ cp_lexer_consume_token (parser->lexer); /* A constructor declarator cannot appear in a typedef. */ @@ -10679,8 +10643,8 @@ cp_parser_decl_specifier_seq (cp_parser* parser, break; case RID_THREAD: /* Consume the token. */ + ds = ds_thread; cp_lexer_consume_token (parser->lexer); - ++decl_specs->specs[(int) ds_thread]; break; default: @@ -10694,13 +10658,16 @@ cp_parser_decl_specifier_seq (cp_parser* parser, && token->keyword != RID_CONSTEXPR) error ("decl-specifier invalid in condition"); + if (ds != ds_last) + set_and_check_decl_spec_loc (decl_specs, ds, token->location); + /* Constructors are a special case. The `S' in `S()' is not a decl-specifier; it is the beginning of the declarator. */ constructor_p = (!found_decl_spec && constructor_possible_p && (cp_parser_constructor_declarator_p - (parser, decl_specs->specs[(int) ds_friend] != 0))); + (parser, decl_spec_seq_has_spec_p (decl_specs, ds_friend)))); /* If we don't have a DECL_SPEC yet, then we must be looking at a type-specifier. */ @@ -10777,12 +10744,10 @@ cp_parser_decl_specifier_seq (cp_parser* parser, flags |= CP_PARSER_FLAGS_OPTIONAL; } - cp_parser_check_decl_spec (decl_specs, start_token->location); - /* Don't allow a friend specifier with a class definition. */ - if (decl_specs->specs[(int) ds_friend] != 0 + if (decl_spec_seq_has_spec_p (decl_specs, ds_friend) && (*declares_class_or_enum & 2)) - error_at (start_token->location, + error_at (decl_specs->locations[ds_friend], "class definition may not be declared a friend"); } @@ -10843,8 +10808,7 @@ cp_parser_function_specifier_opt (cp_parser* parser, switch (token->keyword) { case RID_INLINE: - if (decl_specs) - ++decl_specs->specs[(int) ds_inline]; + set_and_check_decl_spec_loc (decl_specs, ds_inline, token->location); break; case RID_VIRTUAL: @@ -10853,13 +10817,11 @@ cp_parser_function_specifier_opt (cp_parser* parser, A member function template shall not be virtual. */ if (PROCESSING_REAL_TEMPLATE_DECL_P ()) error_at (token->location, "templates may not be %<virtual%>"); - else if (decl_specs) - ++decl_specs->specs[(int) ds_virtual]; + set_and_check_decl_spec_loc (decl_specs, ds_virtual, token->location); break; case RID_EXPLICIT: - if (decl_specs) - ++decl_specs->specs[(int) ds_explicit]; + set_and_check_decl_spec_loc (decl_specs, ds_explicit, token->location); break; default: @@ -12499,7 +12461,9 @@ cp_parser_template_id (cp_parser *parser, /* Build a representation of the specialization. */ if (TREE_CODE (templ) == IDENTIFIER_NODE) - template_id = build_min_nt (TEMPLATE_ID_EXPR, templ, arguments); + template_id = build_min_nt_loc (next_token->location, + TEMPLATE_ID_EXPR, + templ, arguments); else if (DECL_TYPE_TEMPLATE_P (templ) || DECL_TEMPLATE_TEMPLATE_PARM_P (templ)) { @@ -13170,14 +13134,16 @@ cp_parser_explicit_instantiation (cp_parser* parser) if (declares_class_or_enum & 2) cp_parser_check_for_definition_in_return_type (declarator, decl_specifiers.type, - decl_specifiers.type_location); + decl_specifiers.locations[ds_type_spec]); if (declarator != cp_error_declarator) { - if (decl_specifiers.specs[(int)ds_inline]) - permerror (input_location, "explicit instantiation shall not use" + if (decl_spec_seq_has_spec_p (&decl_specifiers, ds_inline)) + permerror (decl_specifiers.locations[ds_inline], + "explicit instantiation shall not use" " %<inline%> specifier"); - if (decl_specifiers.specs[(int)ds_constexpr]) - permerror (input_location, "explicit instantiation shall not use" + if (decl_spec_seq_has_spec_p (&decl_specifiers, ds_constexpr)) + permerror (decl_specifiers.locations[ds_constexpr], + "explicit instantiation shall not use" " %<constexpr%> specifier"); decl = grokdeclarator (declarator, &decl_specifiers, @@ -13399,7 +13365,7 @@ cp_parser_type_specifier (cp_parser* parser, type_spec = (cp_parser_elaborated_type_specifier (parser, - decl_specs && decl_specs->specs[(int) ds_friend], + decl_spec_seq_has_spec_p (decl_specs, ds_friend), is_declaration)); if (decl_specs) cp_parser_set_decl_spec_type (decl_specs, @@ -13440,7 +13406,7 @@ cp_parser_type_specifier (cp_parser* parser, { if (decl_specs) { - ++decl_specs->specs[(int)ds]; + set_and_check_decl_spec_loc (decl_specs, ds, token->location); decl_specs->any_specifiers_p = true; } return cp_lexer_consume_token (parser->lexer)->u.value; @@ -13531,8 +13497,7 @@ cp_parser_simple_type_specifier (cp_parser* parser, type = boolean_type_node; break; case RID_SHORT: - if (decl_specs) - ++decl_specs->specs[(int) ds_short]; + set_and_check_decl_spec_loc (decl_specs, ds_short, token->location); type = short_integer_type_node; break; case RID_INT: @@ -13549,17 +13514,15 @@ cp_parser_simple_type_specifier (cp_parser* parser, break; case RID_LONG: if (decl_specs) - ++decl_specs->specs[(int) ds_long]; + set_and_check_decl_spec_loc (decl_specs, ds_long, token->location); type = long_integer_type_node; break; case RID_SIGNED: - if (decl_specs) - ++decl_specs->specs[(int) ds_signed]; + set_and_check_decl_spec_loc (decl_specs, ds_signed, token->location); type = integer_type_node; break; case RID_UNSIGNED: - if (decl_specs) - ++decl_specs->specs[(int) ds_unsigned]; + set_and_check_decl_spec_loc (decl_specs, ds_unsigned, token->location); type = unsigned_type_node; break; case RID_FLOAT: @@ -15070,19 +15033,21 @@ static tree cp_parser_alias_declaration (cp_parser* parser) { tree id, type, decl, pushed_scope = NULL_TREE, attributes; - location_t id_location; + location_t id_location, using_location, attrs_location = 0; cp_declarator *declarator; cp_decl_specifier_seq decl_specs; bool member_p; const char *saved_message = NULL; /* Look for the `using' keyword. */ + using_location = cp_lexer_peek_token (parser->lexer)->location; cp_parser_require_keyword (parser, RID_USING, RT_USING); id_location = cp_lexer_peek_token (parser->lexer)->location; id = cp_parser_identifier (parser); if (id == error_mark_node) return error_mark_node; + attrs_location = cp_lexer_peek_token (parser->lexer)->location; attributes = cp_parser_attributes_opt (parser); if (attributes == error_mark_node) return error_mark_node; @@ -15131,9 +15096,19 @@ cp_parser_alias_declaration (cp_parser* parser) clear_decl_specs (&decl_specs); decl_specs.type = type; - decl_specs.attributes = attributes; - ++decl_specs.specs[(int) ds_typedef]; - ++decl_specs.specs[(int) ds_alias]; + if (attributes != NULL_TREE) + { + decl_specs.attributes = attributes; + set_and_check_decl_spec_loc (&decl_specs, + ds_attribute, + attrs_location); + } + set_and_check_decl_spec_loc (&decl_specs, + ds_typedef, + using_location); + set_and_check_decl_spec_loc (&decl_specs, + ds_alias, + using_location); declarator = make_id_declarator (NULL_TREE, id, sfk_none); declarator->id_loc = id_location; @@ -15515,7 +15490,7 @@ cp_parser_init_declarator (cp_parser* parser, if (declares_class_or_enum & 2) cp_parser_check_for_definition_in_return_type (declarator, decl_specifiers->type, - decl_specifiers->type_location); + decl_specifiers->locations[ds_type_spec]); /* Figure out what scope the entity declared by the DECLARATOR is located in. `grokdeclarator' sometimes changes the scope, so @@ -15761,6 +15736,8 @@ cp_parser_init_declarator (cp_parser* parser, &is_non_constant_init); if (!member_p && processing_template_decl) finish_lambda_scope (); + if (initializer == error_mark_node) + cp_parser_skip_to_end_of_statement (parser); } } @@ -16936,8 +16913,6 @@ cp_parser_type_specifier_seq (cp_parser* parser, if (is_declaration && !is_cv_qualifier) flags |= CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES; } - - cp_parser_check_decl_spec (type_specifier_seq, start_token->location); } /* Parse a parameter-declaration-clause. @@ -19042,7 +19017,7 @@ cp_parser_member_declaration (cp_parser* parser) if (declares_class_or_enum & 2) cp_parser_check_for_definition_in_return_type (declarator, decl_specifiers.type, - decl_specifiers.type_location); + decl_specifiers.locations[ds_type_spec]); /* Look for an asm-specification. */ asm_specification = cp_parser_asm_specification_opt (parser); @@ -21301,7 +21276,7 @@ cp_parser_single_declaration (cp_parser* parser, *friend_p = cp_parser_friend_p (&decl_specifiers); /* There are no template typedefs. */ - if (decl_specifiers.specs[(int) ds_typedef]) + if (decl_spec_seq_has_spec_p (&decl_specifiers, ds_typedef)) { error_at (decl_spec_token_start->location, "template declaration of %<typedef%>"); @@ -21777,6 +21752,9 @@ cp_parser_late_parse_one_default_arg (cp_parser *parser, tree decl, finish_lambda_scope (); + if (parsed_arg == error_mark_node) + cp_parser_skip_to_end_of_statement (parser); + if (!processing_template_decl) { /* In a non-template class, check conversions now. In a template, @@ -22049,10 +22027,11 @@ cp_parser_set_storage_class (cp_parser *parser, } if ((keyword == RID_EXTERN || keyword == RID_STATIC) - && decl_specs->specs[(int) ds_thread]) + && decl_spec_seq_has_spec_p (decl_specs, ds_thread)) { - error_at (location, "%<__thread%> before %qD", ridpointers[keyword]); - decl_specs->specs[(int) ds_thread] = 0; + error_at (decl_specs->locations[ds_thread], + "%<__thread%> before %qD", ridpointers[keyword]); + decl_specs->locations[ds_thread] = 0; } switch (keyword) @@ -22076,12 +22055,13 @@ cp_parser_set_storage_class (cp_parser *parser, gcc_unreachable (); } decl_specs->storage_class = storage_class; + set_and_check_decl_spec_loc (decl_specs, ds_storage_class, location); /* A storage class specifier cannot be applied alongside a typedef specifier. If there is a typedef specifier present then set conflicting_specifiers_p which will trigger an error later on in grokdeclarator. */ - if (decl_specs->specs[(int)ds_typedef]) + if (decl_spec_seq_has_spec_p (decl_specs, ds_typedef)) decl_specs->conflicting_specifiers_p = true; } @@ -22101,24 +22081,27 @@ cp_parser_set_decl_spec_type (cp_decl_specifier_seq *decl_specs, this is what happened. In system headers, we ignore these declarations so that G++ can work with system headers that are not C++-safe. */ - if (decl_specs->specs[(int) ds_typedef] + if (decl_spec_seq_has_spec_p (decl_specs, ds_typedef) && !type_definition_p && (type_spec == boolean_type_node || type_spec == char16_type_node || type_spec == char32_type_node || type_spec == wchar_type_node) && (decl_specs->type - || decl_specs->specs[(int) ds_long] - || decl_specs->specs[(int) ds_short] - || decl_specs->specs[(int) ds_unsigned] - || decl_specs->specs[(int) ds_signed])) + || decl_spec_seq_has_spec_p (decl_specs, ds_long) + || decl_spec_seq_has_spec_p (decl_specs, ds_short) + || decl_spec_seq_has_spec_p (decl_specs, ds_unsigned) + || decl_spec_seq_has_spec_p (decl_specs, ds_signed))) { decl_specs->redefined_builtin_type = type_spec; + set_and_check_decl_spec_loc (decl_specs, + ds_redefined_builtin_type_spec, + location); if (!decl_specs->type) { decl_specs->type = type_spec; decl_specs->type_definition_p = false; - decl_specs->type_location = location; + set_and_check_decl_spec_loc (decl_specs,ds_type_spec, location); } } else if (decl_specs->type) @@ -22128,17 +22111,96 @@ cp_parser_set_decl_spec_type (cp_decl_specifier_seq *decl_specs, decl_specs->type = type_spec; decl_specs->type_definition_p = type_definition_p; decl_specs->redefined_builtin_type = NULL_TREE; - decl_specs->type_location = location; + set_and_check_decl_spec_loc (decl_specs, ds_type_spec, location); } } +/* Set the location for a declarator specifier and check if it is + duplicated. + + DECL_SPECS is the sequence of declarator specifiers onto which to + set the location. + + DS is the single declarator specifier to set which location is to + be set onto the existing sequence of declarators. + + LOCATION is the location for the declarator specifier to + consider. */ + +static void +set_and_check_decl_spec_loc (cp_decl_specifier_seq *decl_specs, + cp_decl_spec ds, source_location location) +{ + gcc_assert (ds < ds_last); + + if (decl_specs == NULL) + return; + + if (decl_specs->locations[ds] == 0) + decl_specs->locations[ds] = location; + else + { + if (ds == ds_long) + { + if (decl_specs->locations[ds_long_long] != 0) + error_at (location, + "%<long long long%> is too long for GCC"); + else + { + decl_specs->locations[ds_long_long] = location; + pedwarn_cxx98 (location, + OPT_Wlong_long, + "ISO C++ 1998 does not support %<long long%>"); + } + } + else + { + static const char *const decl_spec_names[] = { + "signed", + "unsigned", + "short", + "long", + "const", + "volatile", + "restrict", + "inline", + "virtual", + "explicit", + "friend", + "typedef", + "using", + "constexpr", + "__complex", + "__thread" + }; + error_at (location, + "duplicate %qs", decl_spec_names[ds]); + } + } +} + +/* Return true iff the declarator specifier DS is present in the + sequence of declarator specifiers DECL_SPECS. */ + +bool +decl_spec_seq_has_spec_p (const cp_decl_specifier_seq * decl_specs, + cp_decl_spec ds) +{ + gcc_assert (ds < ds_last); + + if (decl_specs == NULL) + return false; + + return decl_specs->locations[ds] != 0; +} + /* DECL_SPECIFIERS is the representation of a decl-specifier-seq. Returns TRUE iff `friend' appears among the DECL_SPECIFIERS. */ static bool cp_parser_friend_p (const cp_decl_specifier_seq *decl_specifiers) { - return decl_specifiers->specs[(int) ds_friend] != 0; + return decl_spec_seq_has_spec_p (decl_specifiers, ds_friend); } /* Issue an error message indicating that TOKEN_DESC was expected. @@ -23951,17 +24013,17 @@ cp_parser_objc_class_ivars (cp_parser* parser) } /* __thread. */ - if (declspecs.specs[(int) ds_thread]) + if (decl_spec_seq_has_spec_p (&declspecs, ds_thread)) { cp_parser_error (parser, "invalid type for instance variable"); - declspecs.specs[(int) ds_thread] = 0; + declspecs.locations[ds_thread] = 0; } /* typedef. */ - if (declspecs.specs[(int) ds_typedef]) + if (decl_spec_seq_has_spec_p (&declspecs, ds_typedef)) { cp_parser_error (parser, "invalid type for instance variable"); - declspecs.specs[(int) ds_typedef] = 0; + declspecs.locations[ds_thread] = 0; } prefix_attributes = declspecs.attributes; @@ -24530,17 +24592,17 @@ cp_parser_objc_struct_declaration (cp_parser *parser) } /* __thread. */ - if (declspecs.specs[(int) ds_thread]) + if (decl_spec_seq_has_spec_p (&declspecs, ds_thread)) { cp_parser_error (parser, "invalid type for property"); - declspecs.specs[(int) ds_thread] = 0; + declspecs.locations[ds_thread] = 0; } /* typedef. */ - if (declspecs.specs[(int) ds_typedef]) + if (decl_spec_seq_has_spec_p (&declspecs, ds_typedef)) { cp_parser_error (parser, "invalid type for property"); - declspecs.specs[(int) ds_typedef] = 0; + declspecs.locations[ds_typedef] = 0; } prefix_attributes = declspecs.attributes; @@ -26350,7 +26412,8 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses) cp_parser_parse_definitely (parser); cp_parser_require (parser, CPP_EQ, RT_EQ); rhs = cp_parser_assignment_expression (parser, false, NULL); - finish_expr_stmt (build_x_modify_expr (decl, NOP_EXPR, + finish_expr_stmt (build_x_modify_expr (EXPR_LOCATION (rhs), + decl, NOP_EXPR, rhs, tf_warning_or_error)); add_private_clause = true; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 051abb8a05c..826759f28fb 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11932,6 +11932,7 @@ tsubst_qualified_id (tree qualified_id, tree args, tree name; bool is_template; tree template_args; + location_t loc = UNKNOWN_LOCATION; gcc_assert (TREE_CODE (qualified_id) == SCOPE_REF); @@ -11940,6 +11941,7 @@ tsubst_qualified_id (tree qualified_id, tree args, if (TREE_CODE (name) == TEMPLATE_ID_EXPR) { is_template = true; + loc = EXPR_LOCATION (name); template_args = TREE_OPERAND (name, 1); if (template_args) template_args = tsubst_template_args (template_args, args, @@ -11968,7 +11970,7 @@ tsubst_qualified_id (tree qualified_id, tree args, if (dependent_scope_p (scope)) { if (is_template) - expr = build_min_nt (TEMPLATE_ID_EXPR, expr, template_args); + expr = build_min_nt_loc (loc, TEMPLATE_ID_EXPR, expr, template_args); return build_qualified_name (NULL_TREE, scope, expr, QUALIFIED_NAME_IS_TEMPLATE (qualified_id)); } @@ -12672,7 +12674,8 @@ tsubst_omp_for_iterator (tree t, int i, tree declv, tree initv, cond = RECUR (TREE_VEC_ELT (OMP_FOR_COND (t), i)); incr = TREE_VEC_ELT (OMP_FOR_INCR (t), i); if (TREE_CODE (incr) == MODIFY_EXPR) - incr = build_x_modify_expr (RECUR (TREE_OPERAND (incr, 0)), NOP_EXPR, + incr = build_x_modify_expr (EXPR_LOCATION (incr), + RECUR (TREE_OPERAND (incr, 0)), NOP_EXPR, RECUR (TREE_OPERAND (incr, 1)), complain); else @@ -13608,7 +13611,11 @@ tsubst_copy_and_build (tree t, case MEMBER_REF: case DOTSTAR_EXPR: { - tree r = build_x_binary_op + tree r; + + ++c_inhibit_evaluation_warnings; + + r = build_x_binary_op (input_location, TREE_CODE (t), RECUR (TREE_OPERAND (t, 0)), (TREE_NO_WARNING (TREE_OPERAND (t, 0)) @@ -13622,6 +13629,9 @@ tsubst_copy_and_build (tree t, complain); if (EXPR_P (r) && TREE_NO_WARNING (t)) TREE_NO_WARNING (r) = TREE_NO_WARNING (t); + + --c_inhibit_evaluation_warnings; + return r; } @@ -13631,7 +13641,8 @@ tsubst_copy_and_build (tree t, case ARRAY_REF: op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0), args, complain, in_decl); - return build_x_array_ref (op1, RECUR (TREE_OPERAND (t, 1)), complain); + return build_x_array_ref (EXPR_LOCATION (t), op1, + RECUR (TREE_OPERAND (t, 1)), complain); case SIZEOF_EXPR: if (PACK_EXPANSION_P (TREE_OPERAND (t, 0))) @@ -13692,7 +13703,8 @@ tsubst_copy_and_build (tree t, case MODOP_EXPR: { tree r = build_x_modify_expr - (RECUR (TREE_OPERAND (t, 0)), + (EXPR_LOCATION (t), + RECUR (TREE_OPERAND (t, 0)), TREE_CODE (TREE_OPERAND (t, 1)), RECUR (TREE_OPERAND (t, 2)), complain); @@ -13776,7 +13788,8 @@ tsubst_copy_and_build (tree t, complain); case COMPOUND_EXPR: - return build_x_compound_expr (RECUR (TREE_OPERAND (t, 0)), + return build_x_compound_expr (EXPR_LOCATION (t), + RECUR (TREE_OPERAND (t, 0)), RECUR (TREE_OPERAND (t, 1)), complain); @@ -14016,7 +14029,8 @@ tsubst_copy_and_build (tree t, exp2 = RECUR (TREE_OPERAND (t, 2)); } - return build_x_conditional_expr (cond, exp1, exp2, complain); + return build_x_conditional_expr (EXPR_LOCATION (t), + cond, exp1, exp2, complain); } case PSEUDO_DTOR_EXPR: diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 9447787f002..840784cc5df 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1498,7 +1498,8 @@ finish_mem_initializers (tree mem_inits) TREE_VALUE (mem) = error_mark_node; } - add_stmt (build_min_nt (CTOR_INITIALIZER, mem_inits)); + add_stmt (build_min_nt_loc (UNKNOWN_LOCATION, + CTOR_INITIALIZER, mem_inits)); } else emit_mem_initializers (mem_inits); @@ -4456,7 +4457,8 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, cond = error_mark_node; else { - tree tem = build_x_binary_op (input_location, TREE_CODE (cond), + tree tem = build_x_binary_op (EXPR_LOCATION (cond), + TREE_CODE (cond), iter, ERROR_MARK, TREE_OPERAND (cond, 1), ERROR_MARK, NULL, tf_warning_or_error); @@ -4473,7 +4475,7 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, error_at (elocus, "invalid controlling predicate"); return true; } - diff = build_x_binary_op (input_location, MINUS_EXPR, TREE_OPERAND (cond, 1), + diff = build_x_binary_op (elocus, MINUS_EXPR, TREE_OPERAND (cond, 1), ERROR_MARK, iter, ERROR_MARK, NULL, tf_warning_or_error); if (error_operand_p (diff)) @@ -4496,7 +4498,8 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, incr = error_mark_node; break; } - iter_incr = build_x_unary_op (input_location, TREE_CODE (incr), iter, + iter_incr = build_x_unary_op (EXPR_LOCATION (incr), + TREE_CODE (incr), iter, tf_warning_or_error); if (error_operand_p (iter_incr)) return true; @@ -4520,7 +4523,8 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, incr = error_mark_node; else { - iter_incr = build_x_modify_expr (iter, TREE_CODE (rhs), + iter_incr = build_x_modify_expr (EXPR_LOCATION (rhs), + iter, TREE_CODE (rhs), TREE_OPERAND (rhs, 1), tf_warning_or_error); if (error_operand_p (iter_incr)) @@ -4546,14 +4550,16 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, incr = error_mark_node; else { - iter_incr = build_x_binary_op (input_location, PLUS_EXPR, + iter_incr = build_x_binary_op (EXPR_LOCATION (rhs), + PLUS_EXPR, TREE_OPERAND (rhs, 0), ERROR_MARK, iter, ERROR_MARK, NULL, tf_warning_or_error); if (error_operand_p (iter_incr)) return true; - iter_incr = build_x_modify_expr (iter, NOP_EXPR, + iter_incr = build_x_modify_expr (EXPR_LOCATION (rhs), + iter, NOP_EXPR, iter_incr, tf_warning_or_error); if (error_operand_p (iter_incr)) @@ -4604,18 +4610,22 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, if (orig_pre_body) add_stmt (orig_pre_body); if (init != NULL) - finish_expr_stmt (build_x_modify_expr (iter, NOP_EXPR, init, + finish_expr_stmt (build_x_modify_expr (elocus, + iter, NOP_EXPR, init, tf_warning_or_error)); init = build_int_cst (TREE_TYPE (diff), 0); if (c && iter_incr == NULL) { - finish_expr_stmt (build_x_modify_expr (incr_var, NOP_EXPR, + finish_expr_stmt (build_x_modify_expr (elocus, + incr_var, NOP_EXPR, incr, tf_warning_or_error)); incr = incr_var; - iter_incr = build_x_modify_expr (iter, PLUS_EXPR, incr, + iter_incr = build_x_modify_expr (elocus, + iter, PLUS_EXPR, incr, tf_warning_or_error); } - finish_expr_stmt (build_x_modify_expr (last, NOP_EXPR, init, + finish_expr_stmt (build_x_modify_expr (elocus, + last, NOP_EXPR, init, tf_warning_or_error)); *pre_body = pop_stmt_list (*pre_body); @@ -4628,11 +4638,13 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, orig_body = *body; *body = push_stmt_list (); iter_init = build2 (MINUS_EXPR, TREE_TYPE (diff), decl, last); - iter_init = build_x_modify_expr (iter, PLUS_EXPR, iter_init, + iter_init = build_x_modify_expr (elocus, + iter, PLUS_EXPR, iter_init, tf_warning_or_error); iter_init = build1 (NOP_EXPR, void_type_node, iter_init); finish_expr_stmt (iter_init); - finish_expr_stmt (build_x_modify_expr (last, NOP_EXPR, decl, + finish_expr_stmt (build_x_modify_expr (elocus, + last, NOP_EXPR, decl, tf_warning_or_error)); add_stmt (orig_body); *body = pop_stmt_list (*body); @@ -4939,7 +4951,8 @@ finish_omp_atomic (enum tree_code code, enum tree_code opcode, tree lhs, { if (code == OMP_ATOMIC_READ) { - stmt = build_min_nt (OMP_ATOMIC_READ, orig_lhs); + stmt = build_min_nt_loc (EXPR_LOCATION (orig_lhs), + OMP_ATOMIC_READ, orig_lhs); stmt = build2 (MODIFY_EXPR, void_type_node, orig_v, stmt); } else @@ -4949,10 +4962,12 @@ finish_omp_atomic (enum tree_code code, enum tree_code opcode, tree lhs, else stmt = build2 (opcode, void_type_node, orig_lhs, orig_rhs); if (orig_rhs1) - stmt = build_min_nt (COMPOUND_EXPR, orig_rhs1, stmt); + stmt = build_min_nt_loc (EXPR_LOCATION (orig_rhs1), + COMPOUND_EXPR, orig_rhs1, stmt); if (code != OMP_ATOMIC) { - stmt = build_min_nt (code, orig_lhs1, stmt); + stmt = build_min_nt_loc (EXPR_LOCATION (orig_lhs1), + code, orig_lhs1, stmt); stmt = build2 (MODIFY_EXPR, void_type_node, orig_v, stmt); } } diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index ad8f82db1d5..7c59105b9ce 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2025,7 +2025,7 @@ break_out_target_exprs (tree t) expressions */ tree -build_min_nt (enum tree_code code, ...) +build_min_nt_loc (location_t loc, enum tree_code code, ...) { tree t; int length; @@ -2037,6 +2037,7 @@ build_min_nt (enum tree_code code, ...) va_start (p, code); t = make_node (code); + SET_EXPR_LOCATION (t, loc); length = TREE_CODE_LENGTH (code); for (i = 0; i < length; i++) diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index c50373884ec..92794ea77a2 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2536,7 +2536,8 @@ finish_class_member_access_expr (tree object, tree name, bool template_p, || (TREE_CODE (name) == SCOPE_REF && TYPE_P (TREE_OPERAND (name, 0)) && dependent_type_p (TREE_OPERAND (name, 0)))) - return build_min_nt (COMPONENT_REF, object, name, NULL_TREE); + return build_min_nt_loc (UNKNOWN_LOCATION, COMPONENT_REF, + object, name, NULL_TREE); object = build_non_dependent_expr (object); } else if (c_dialect_objc () @@ -2743,7 +2744,7 @@ build_x_indirect_ref (location_t loc, tree expr, ref_operator errorstring, if (TREE_TYPE (expr) && POINTER_TYPE_P (TREE_TYPE (expr))) return build_min (INDIRECT_REF, TREE_TYPE (TREE_TYPE (expr)), expr); if (type_dependent_expression_p (expr)) - return build_min_nt (INDIRECT_REF, expr); + return build_min_nt_loc (loc, INDIRECT_REF, expr); expr = build_non_dependent_expr (expr); } @@ -3597,7 +3598,7 @@ build_x_binary_op (location_t loc, enum tree_code code, tree arg1, { if (type_dependent_expression_p (arg1) || type_dependent_expression_p (arg2)) - return build_min_nt (code, arg1, arg2); + return build_min_nt_loc (loc, code, arg1, arg2); arg1 = build_non_dependent_expr (arg1); arg2 = build_non_dependent_expr (arg2); } @@ -3629,7 +3630,8 @@ build_x_binary_op (location_t loc, enum tree_code code, tree arg1, /* Build and return an ARRAY_REF expression. */ tree -build_x_array_ref (tree arg1, tree arg2, tsubst_flags_t complain) +build_x_array_ref (location_t loc, tree arg1, tree arg2, + tsubst_flags_t complain) { tree orig_arg1 = arg1; tree orig_arg2 = arg2; @@ -3639,14 +3641,14 @@ build_x_array_ref (tree arg1, tree arg2, tsubst_flags_t complain) { if (type_dependent_expression_p (arg1) || type_dependent_expression_p (arg2)) - return build_min_nt (ARRAY_REF, arg1, arg2, - NULL_TREE, NULL_TREE); + return build_min_nt_loc (loc, ARRAY_REF, arg1, arg2, + NULL_TREE, NULL_TREE); arg1 = build_non_dependent_expr (arg1); arg2 = build_non_dependent_expr (arg2); } - expr = build_new_op (input_location, ARRAY_REF, LOOKUP_NORMAL, arg1, - arg2, NULL_TREE, /*overload=*/NULL, complain); + expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL, arg1, arg2, + NULL_TREE, /*overload=*/NULL, complain); if (processing_template_decl && expr != error_mark_node) return build_min_non_dep (ARRAY_REF, expr, orig_arg1, orig_arg2, @@ -4671,7 +4673,7 @@ build_x_unary_op (location_t loc, enum tree_code code, tree xarg, if (processing_template_decl) { if (type_dependent_expression_p (xarg)) - return build_min_nt (code, xarg, NULL_TREE); + return build_min_nt_loc (loc, code, xarg, NULL_TREE); xarg = build_non_dependent_expr (xarg); } @@ -5586,7 +5588,7 @@ cxx_mark_addressable (tree exp) /* Build and return a conditional expression IFEXP ? OP1 : OP2. */ tree -build_x_conditional_expr (tree ifexp, tree op1, tree op2, +build_x_conditional_expr (location_t loc, tree ifexp, tree op1, tree op2, tsubst_flags_t complain) { tree orig_ifexp = ifexp; @@ -5603,7 +5605,7 @@ build_x_conditional_expr (tree ifexp, tree op1, tree op2, /* As a GNU extension, the middle operand may be omitted. */ || (op1 && type_dependent_expression_p (op1)) || type_dependent_expression_p (op2)) - return build_min_nt (COND_EXPR, ifexp, op1, op2); + return build_min_nt_loc (loc, COND_EXPR, ifexp, op1, op2); ifexp = build_non_dependent_expr (ifexp); if (op1) op1 = build_non_dependent_expr (op1); @@ -5670,8 +5672,8 @@ build_x_compound_expr_from_list (tree list, expr_list_kind exp, return error_mark_node; for (list = TREE_CHAIN (list); list; list = TREE_CHAIN (list)) - expr = build_x_compound_expr (expr, TREE_VALUE (list), - complain); + expr = build_x_compound_expr (EXPR_LOCATION (TREE_VALUE (list)), + expr, TREE_VALUE (list), complain); } return expr; @@ -5699,7 +5701,8 @@ build_x_compound_expr_from_vec (VEC(tree,gc) *vec, const char *msg) expr = VEC_index (tree, vec, 0); for (ix = 1; VEC_iterate (tree, vec, ix, t); ++ix) - expr = build_x_compound_expr (expr, t, tf_warning_or_error); + expr = build_x_compound_expr (EXPR_LOCATION (t), expr, + t, tf_warning_or_error); return expr; } @@ -5708,7 +5711,8 @@ build_x_compound_expr_from_vec (VEC(tree,gc) *vec, const char *msg) /* Handle overloading of the ',' operator when needed. */ tree -build_x_compound_expr (tree op1, tree op2, tsubst_flags_t complain) +build_x_compound_expr (location_t loc, tree op1, tree op2, + tsubst_flags_t complain) { tree result; tree orig_op1 = op1; @@ -5718,13 +5722,13 @@ build_x_compound_expr (tree op1, tree op2, tsubst_flags_t complain) { if (type_dependent_expression_p (op1) || type_dependent_expression_p (op2)) - return build_min_nt (COMPOUND_EXPR, op1, op2); + return build_min_nt_loc (loc, COMPOUND_EXPR, op1, op2); op1 = build_non_dependent_expr (op1); op2 = build_non_dependent_expr (op2); } - result = build_new_op (input_location, COMPOUND_EXPR, LOOKUP_NORMAL, - op1, op2, NULL_TREE, /*overload=*/NULL, complain); + result = build_new_op (loc, COMPOUND_EXPR, LOOKUP_NORMAL, op1, op2, + NULL_TREE, /*overload=*/NULL, complain); if (!result) result = cp_build_compound_expr (op1, op2, complain); @@ -7105,18 +7109,19 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, } tree -build_x_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, - tsubst_flags_t complain) +build_x_modify_expr (location_t loc, tree lhs, enum tree_code modifycode, + tree rhs, tsubst_flags_t complain) { if (processing_template_decl) - return build_min_nt (MODOP_EXPR, lhs, - build_min_nt (modifycode, NULL_TREE, NULL_TREE), rhs); + return build_min_nt_loc (loc, MODOP_EXPR, lhs, + build_min_nt_loc (loc, modifycode, NULL_TREE, + NULL_TREE), rhs); if (modifycode != NOP_EXPR) { - tree rval = build_new_op (input_location, MODIFY_EXPR, LOOKUP_NORMAL, - lhs, rhs, make_node (modifycode), - /*overload=*/NULL, complain); + tree rval = build_new_op (loc, MODIFY_EXPR, LOOKUP_NORMAL, lhs, rhs, + make_node (modifycode), /*overload=*/NULL, + complain); if (rval) { TREE_NO_WARNING (rval) = 1; diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index c942c0f1cfc..b953287398d 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1484,7 +1484,7 @@ build_x_arrow (location_t loc, tree expr, tsubst_flags_t complain) if (processing_template_decl) { if (type_dependent_expression_p (expr)) - return build_min_nt (ARROW_EXPR, expr); + return build_min_nt_loc (loc, ARROW_EXPR, expr); expr = build_non_dependent_expr (expr); } diff --git a/gcc/cse.c b/gcc/cse.c index 0ad7b2e2a46..9f4e97932ed 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -3786,8 +3786,12 @@ equiv_constant (rtx x) } } - /* Otherwise see if we already have a constant for the inner REG. */ + /* Otherwise see if we already have a constant for the inner REG, + and if that is enough to calculate an equivalent constant for + the subreg. Note that the upper bits of paradoxical subregs + are undefined, so they cannot be said to equal anything. */ if (REG_P (SUBREG_REG (x)) + && GET_MODE_SIZE (mode) <= GET_MODE_SIZE (imode) && (new_rtx = equiv_constant (SUBREG_REG (x))) != 0) return simplify_subreg (mode, new_rtx, imode, SUBREG_BYTE (x)); diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 66551da4112..a5b23f42665 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -14562,7 +14562,7 @@ below, which also classifies the CPUs into families: @multitable @columnfractions 0.20 0.80 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments} -@item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe} +@item @samp{51} @tab @samp{51} @samp{51ac} @samp{51ag} @samp{51cn} @samp{51em} @samp{51je} @samp{51jf} @samp{51jg} @samp{51jm} @samp{51mm} @samp{51qe} @samp{51qm} @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206} @item @samp{5206e} @tab @samp{5206e} @item @samp{5208} @tab @samp{5207} @samp{5208} diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index e3245d0f993..f7b2838efd8 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -1634,9 +1634,9 @@ The string can contain more than one keyword. If so, separate them with spaces, and write first any length keyword, then @code{unsigned} if appropriate, and finally @code{int}. The string must exactly match one of the data type names defined in the function -@code{init_decl_processing} in the file @file{c-decl.c}. You may not -omit @code{int} or change the order---that would cause the compiler to -crash on startup. +@code{c_common_nodes_and_builtins} in the file @file{c-family/c-common.c}. +You may not omit @code{int} or change the order---that would cause the +compiler to crash on startup. If you don't define this macro, the default is @code{"long unsigned int"}. diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 51687ce8546..a54b2298f4b 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -1622,9 +1622,9 @@ The string can contain more than one keyword. If so, separate them with spaces, and write first any length keyword, then @code{unsigned} if appropriate, and finally @code{int}. The string must exactly match one of the data type names defined in the function -@code{init_decl_processing} in the file @file{c-decl.c}. You may not -omit @code{int} or change the order---that would cause the compiler to -crash on startup. +@code{c_common_nodes_and_builtins} in the file @file{c-family/c-common.c}. +You may not omit @code{int} or change the order---that would cause the +compiler to crash on startup. If you don't define this macro, the default is @code{"long unsigned int"}. diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index ee8b4d14d7c..6b4d987e025 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -33,8 +33,9 @@ along with GCC; see the file COPYING3. If not see #include "gimple-fold.h" /* Return true when DECL can be referenced from current unit. - We can get declarations that are not possible to reference for - various reasons: + FROM_DECL (if non-null) specify constructor of variable DECL was taken from. + We can get declarations that are not possible to reference for various + reasons: 1) When analyzing C++ virtual tables. C++ virtual tables do have known constructors even @@ -54,26 +55,35 @@ along with GCC; see the file COPYING3. If not see directly. */ static bool -can_refer_decl_in_current_unit_p (tree decl) +can_refer_decl_in_current_unit_p (tree decl, tree from_decl) { struct varpool_node *vnode; struct cgraph_node *node; - - if (!TREE_STATIC (decl) && !DECL_EXTERNAL (decl)) + symtab_node snode; + + /* We will later output the initializer, so we can reffer to it. + So we are concerned only when DECL comes from initializer of + external var. */ + if (!from_decl + || TREE_CODE (from_decl) != VAR_DECL + || !DECL_EXTERNAL (from_decl) + || (symtab_get_node (from_decl)->symbol.in_other_partition)) return true; - /* External flag is set, so we deal with C++ reference - to static object from other file. */ - if (DECL_EXTERNAL (decl) && TREE_STATIC (decl) - && TREE_CODE (decl) == VAR_DECL) - { - /* Just be sure it is not big in frontend setting - flags incorrectly. Those variables should never - be finalized. */ - gcc_checking_assert (!(vnode = varpool_get_node (decl)) - || vnode->alias - || !vnode->finalized); - return false; - } + /* We are concerned ony about static/external vars and functions. */ + if ((!TREE_STATIC (decl) && !DECL_EXTERNAL (decl)) + || (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL)) + return true; + /* Weakrefs have somewhat confusing DECL_EXTERNAL flag set; they are always safe. */ + if (DECL_EXTERNAL (decl) + && lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))) + return true; + /* We are folding reference from external vtable. The vtable may reffer + to a symbol keyed to other compilation unit. The other compilation + unit may be in separate DSO and the symbol may be hidden. */ + if (DECL_VISIBILITY_SPECIFIED (decl) + && DECL_EXTERNAL (decl) + && (!(snode = symtab_get_node (decl)) || !snode->symbol.in_other_partition)) + return false; /* When function is public, we always can introduce new reference. Exception are the COMDAT functions where introducing a direct reference imply need to include function body in the curren tunit. */ @@ -82,14 +92,19 @@ can_refer_decl_in_current_unit_p (tree decl) /* We are not at ltrans stage; so don't worry about WHOPR. Also when still gimplifying all referred comdat functions will be produced. - ??? as observed in PR20991 for already optimized out comdat virtual functions - we may not neccesarily give up because the copy will be output elsewhere when - corresponding vtable is output. */ + + As observed in PR20991 for already optimized out comdat virtual functions + it may be tempting to not neccesarily give up because the copy will be + output elsewhere when corresponding vtable is output. + This is however not possible - ABI specify that COMDATs are output in + units where they are used and when the other unit was compiled with LTO + it is possible that vtable was kept public while the function itself + was privatized. */ if (!flag_ltrans && (!DECL_COMDAT (decl) || !cgraph_function_flags_ready)) return true; - /* If we already output the function body, we are safe. */ - if (TREE_ASM_WRITTEN (decl)) - return true; + + /* OK we are seeing either COMDAT or static variable. In this case we must + check that the definition is still around so we can refer it. */ if (TREE_CODE (decl) == FUNCTION_DECL) { node = cgraph_get_node (decl); @@ -99,22 +114,29 @@ can_refer_decl_in_current_unit_p (tree decl) compilation stage when making a new reference no longer makes callee to be compiled. */ if (!node || !node->analyzed || node->global.inlined_to) - return false; + { + gcc_checking_assert (!TREE_ASM_WRITTEN (decl)); + return false; + } } else if (TREE_CODE (decl) == VAR_DECL) { vnode = varpool_get_node (decl); - if (!vnode || !vnode->finalized) - return false; + if (!vnode || !vnode->analyzed) + { + gcc_checking_assert (!TREE_ASM_WRITTEN (decl)); + return false; + } } return true; } /* CVAL is value taken from DECL_INITIAL of variable. Try to transform it into - acceptable form for is_gimple_min_invariant. */ + acceptable form for is_gimple_min_invariant. + FROM_DECL (if non-NULL) specify variable whose constructor contains CVAL. */ tree -canonicalize_constructor_val (tree cval) +canonicalize_constructor_val (tree cval, tree from_decl) { STRIP_NOPS (cval); if (TREE_CODE (cval) == POINTER_PLUS_EXPR @@ -137,7 +159,7 @@ canonicalize_constructor_val (tree cval) if ((TREE_CODE (base) == VAR_DECL || TREE_CODE (base) == FUNCTION_DECL) - && !can_refer_decl_in_current_unit_p (base)) + && !can_refer_decl_in_current_unit_p (base, from_decl)) return NULL_TREE; if (TREE_CODE (base) == VAR_DECL) { @@ -170,7 +192,7 @@ get_symbol_constant_value (tree sym) tree val = DECL_INITIAL (sym); if (val) { - val = canonicalize_constructor_val (val); + val = canonicalize_constructor_val (val, sym); if (val && is_gimple_min_invariant (val)) return val; else @@ -670,13 +692,10 @@ get_maxval_strlen (tree arg, tree *length, bitmap visited, int type) if (TREE_CODE (arg) != SSA_NAME) { - if (TREE_CODE (arg) == COND_EXPR) - return get_maxval_strlen (COND_EXPR_THEN (arg), length, visited, type) - && get_maxval_strlen (COND_EXPR_ELSE (arg), length, visited, type); /* We can end up with &(*iftmp_1)[0] here as well, so handle it. */ - else if (TREE_CODE (arg) == ADDR_EXPR - && TREE_CODE (TREE_OPERAND (arg, 0)) == ARRAY_REF - && integer_zerop (TREE_OPERAND (TREE_OPERAND (arg, 0), 1))) + if (TREE_CODE (arg) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (arg, 0)) == ARRAY_REF + && integer_zerop (TREE_OPERAND (TREE_OPERAND (arg, 0), 1))) { tree aop0 = TREE_OPERAND (TREE_OPERAND (arg, 0), 0); if (TREE_CODE (aop0) == INDIRECT_REF @@ -736,6 +755,13 @@ get_maxval_strlen (tree arg, tree *length, bitmap visited, int type) tree rhs = gimple_assign_rhs1 (def_stmt); return get_maxval_strlen (rhs, length, visited, type); } + else if (gimple_assign_rhs_code (def_stmt) == COND_EXPR) + { + tree op2 = gimple_assign_rhs2 (def_stmt); + tree op3 = gimple_assign_rhs3 (def_stmt); + return get_maxval_strlen (op2, length, visited, type) + && get_maxval_strlen (op3, length, visited, type); + } return false; case GIMPLE_PHI: @@ -2630,7 +2656,7 @@ gimple_fold_stmt_to_constant (gimple stmt, tree (*valueize) (tree)) static tree fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset, - unsigned HOST_WIDE_INT size); + unsigned HOST_WIDE_INT size, tree); /* See if we can find constructor defining value of BASE. When we know the consructor with constant offset (such as @@ -2738,7 +2764,8 @@ fold_string_cst_ctor_reference (tree type, tree ctor, static tree fold_array_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset, - unsigned HOST_WIDE_INT size) + unsigned HOST_WIDE_INT size, + tree from_decl) { unsigned HOST_WIDE_INT cnt; tree cfield, cval; @@ -2827,7 +2854,8 @@ fold_array_ctor_reference (tree type, tree ctor, /* Do we have match? */ if (double_int_cmp (access_index, index, 1) >= 0 && double_int_cmp (access_index, max_index, 1) <= 0) - return fold_ctor_reference (type, cval, inner_offset, size); + return fold_ctor_reference (type, cval, inner_offset, size, + from_decl); } /* When memory is not explicitely mentioned in constructor, it is 0 (or out of range). */ @@ -2840,7 +2868,8 @@ fold_array_ctor_reference (tree type, tree ctor, static tree fold_nonarray_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset, - unsigned HOST_WIDE_INT size) + unsigned HOST_WIDE_INT size, + tree from_decl) { unsigned HOST_WIDE_INT cnt; tree cfield, cval; @@ -2895,7 +2924,8 @@ fold_nonarray_ctor_reference (tree type, tree ctor, if (double_int_cmp (uhwi_to_double_int (offset), bitoffset, 0) < 0) return NULL_TREE; return fold_ctor_reference (type, cval, - double_int_to_uhwi (inner_offset), size); + double_int_to_uhwi (inner_offset), size, + from_decl); } } /* When memory is not explicitely mentioned in constructor, it is 0. */ @@ -2907,14 +2937,14 @@ fold_nonarray_ctor_reference (tree type, tree ctor, static tree fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset, - unsigned HOST_WIDE_INT size) + unsigned HOST_WIDE_INT size, tree from_decl) { tree ret; /* We found the field with exact match. */ if (useless_type_conversion_p (type, TREE_TYPE (ctor)) && !offset) - return canonicalize_constructor_val (ctor); + return canonicalize_constructor_val (ctor, from_decl); /* We are at the end of walk, see if we can view convert the result. */ @@ -2923,7 +2953,7 @@ fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset, && operand_equal_p (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (ctor)), 0)) { - ret = canonicalize_constructor_val (ctor); + ret = canonicalize_constructor_val (ctor, from_decl); ret = fold_unary (VIEW_CONVERT_EXPR, type, ret); if (ret) STRIP_NOPS (ret); @@ -2936,9 +2966,11 @@ fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset, if (TREE_CODE (TREE_TYPE (ctor)) == ARRAY_TYPE || TREE_CODE (TREE_TYPE (ctor)) == VECTOR_TYPE) - return fold_array_ctor_reference (type, ctor, offset, size); + return fold_array_ctor_reference (type, ctor, offset, size, + from_decl); else - return fold_nonarray_ctor_reference (type, ctor, offset, size); + return fold_nonarray_ctor_reference (type, ctor, offset, size, + from_decl); } return NULL_TREE; @@ -3011,7 +3043,8 @@ fold_const_aggregate_ref_1 (tree t, tree (*valueize) (tree)) return NULL_TREE; return fold_ctor_reference (TREE_TYPE (t), ctor, offset, TREE_INT_CST_LOW (unit_size) - * BITS_PER_UNIT); + * BITS_PER_UNIT, + base); } } /* Fallthru. */ @@ -3037,7 +3070,8 @@ fold_const_aggregate_ref_1 (tree t, tree (*valueize) (tree)) if (offset < 0) return NULL_TREE; - return fold_ctor_reference (TREE_TYPE (t), ctor, offset, size); + return fold_ctor_reference (TREE_TYPE (t), ctor, offset, size, + base); case REALPART_EXPR: case IMAGPART_EXPR: @@ -3071,9 +3105,9 @@ tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT token, tree known_binfo) { unsigned HOST_WIDE_INT offset, size; - tree v, fn; + tree v, fn, vtable; - v = BINFO_VTABLE (known_binfo); + vtable = v = BINFO_VTABLE (known_binfo); /* If there is no virtual methods table, leave the OBJ_TYPE_REF alone. */ if (!v) return NULL_TREE; @@ -3099,7 +3133,7 @@ gimple_get_virt_method_for_binfo (HOST_WIDE_INT token, tree known_binfo) size = tree_low_cst (TYPE_SIZE (TREE_TYPE (TREE_TYPE (v))), 1); offset += token * size; fn = fold_ctor_reference (TREE_TYPE (TREE_TYPE (v)), DECL_INITIAL (v), - offset, size); + offset, size, vtable); if (!fn || integer_zerop (fn)) return NULL_TREE; gcc_assert (TREE_CODE (fn) == ADDR_EXPR @@ -3111,7 +3145,7 @@ gimple_get_virt_method_for_binfo (HOST_WIDE_INT token, tree known_binfo) devirtualize. This can happen in WHOPR when the actual method ends up in other partition, because we found devirtualization possibility too late. */ - if (!can_refer_decl_in_current_unit_p (fn)) + if (!can_refer_decl_in_current_unit_p (fn, vtable)) return NULL_TREE; /* Make sure we create a cgraph node for functions we'll reference. diff --git a/gcc/gimple.h b/gcc/gimple.h index 2b10f1a9b14..aefccaaeab7 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -5315,7 +5315,7 @@ tree gimple_fold_builtin (gimple); bool fold_stmt (gimple_stmt_iterator *); bool fold_stmt_inplace (gimple_stmt_iterator *); tree get_symbol_constant_value (tree); -tree canonicalize_constructor_val (tree); +tree canonicalize_constructor_val (tree, tree); extern tree maybe_fold_and_comparisons (enum tree_code, tree, tree, enum tree_code, tree, tree); extern tree maybe_fold_or_comparisons (enum tree_code, tree, tree, diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index f6fb65866f0..15851504f69 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -4044,19 +4044,50 @@ Unary_expression::do_get_tree(Translate_context* context) if (this->create_temp_ && !TREE_ADDRESSABLE(TREE_TYPE(expr)) - && !DECL_P(expr) + && (TREE_CODE(expr) == CONST_DECL || !DECL_P(expr)) && TREE_CODE(expr) != INDIRECT_REF && TREE_CODE(expr) != COMPONENT_REF) { - tree tmp = create_tmp_var(TREE_TYPE(expr), get_name(expr)); - DECL_IGNORED_P(tmp) = 1; - DECL_INITIAL(tmp) = expr; - TREE_ADDRESSABLE(tmp) = 1; - return build2_loc(loc.gcc_location(), COMPOUND_EXPR, - build_pointer_type(TREE_TYPE(expr)), - build1_loc(loc.gcc_location(), DECL_EXPR, - void_type_node, tmp), - build_fold_addr_expr_loc(loc.gcc_location(), tmp)); + if (current_function_decl != NULL) + { + tree tmp = create_tmp_var(TREE_TYPE(expr), get_name(expr)); + DECL_IGNORED_P(tmp) = 1; + DECL_INITIAL(tmp) = expr; + TREE_ADDRESSABLE(tmp) = 1; + return build2_loc(loc.gcc_location(), COMPOUND_EXPR, + build_pointer_type(TREE_TYPE(expr)), + build1_loc(loc.gcc_location(), DECL_EXPR, + void_type_node, tmp), + build_fold_addr_expr_loc(loc.gcc_location(), + tmp)); + } + else + { + tree tmp = build_decl(loc.gcc_location(), VAR_DECL, + create_tmp_var_name("A"), TREE_TYPE(expr)); + DECL_EXTERNAL(tmp) = 0; + TREE_PUBLIC(tmp) = 0; + TREE_STATIC(tmp) = 1; + DECL_ARTIFICIAL(tmp) = 1; + TREE_ADDRESSABLE(tmp) = 1; + tree make_tmp; + if (!TREE_CONSTANT(expr)) + make_tmp = fold_build2_loc(loc.gcc_location(), INIT_EXPR, + void_type_node, tmp, expr); + else + { + TREE_READONLY(tmp) = 1; + TREE_CONSTANT(tmp) = 1; + DECL_INITIAL(tmp) = expr; + make_tmp = NULL_TREE; + } + rest_of_decl_compilation(tmp, 1, 0); + tree addr = build_fold_addr_expr_loc(loc.gcc_location(), tmp); + if (make_tmp == NULL_TREE) + return addr; + return build2_loc(loc.gcc_location(), COMPOUND_EXPR, + TREE_TYPE(addr), make_tmp, addr); + } } return build_fold_addr_expr_loc(loc.gcc_location(), expr); @@ -6194,7 +6225,9 @@ Expression::comparison_tree(Translate_context* context, Operator op, make_tmp = NULL_TREE; arg = right_tree; } - else if (TREE_ADDRESSABLE(TREE_TYPE(right_tree)) || DECL_P(right_tree)) + else if (TREE_ADDRESSABLE(TREE_TYPE(right_tree)) + || (TREE_CODE(right_tree) != CONST_DECL + && DECL_P(right_tree))) { make_tmp = NULL_TREE; arg = build_fold_addr_expr_loc(location.gcc_location(), right_tree); @@ -11792,8 +11825,7 @@ Open_array_construction_expression::do_get_tree(Translate_context* context) if (this->indexes() == NULL) max_index = this->vals()->size() - 1; else - max_index = *std::max_element(this->indexes()->begin(), - this->indexes()->end()); + max_index = this->indexes()->back(); tree max_tree = size_int(max_index); tree constructor_type = build_array_type(element_type_tree, build_index_type(max_tree)); @@ -12544,6 +12576,17 @@ Composite_literal_expression::lower_struct(Gogo* gogo, Type* type) return ret; } +// Used to sort an index/value array. + +class Index_value_compare +{ + public: + bool + operator()(const std::pair<unsigned long, Expression*>& a, + const std::pair<unsigned long, Expression*>& b) + { return a.first < b.first; } +}; + // Lower an array composite literal. Expression* @@ -12555,6 +12598,7 @@ Composite_literal_expression::lower_array(Type* type) std::vector<unsigned long>* indexes = new std::vector<unsigned long>; indexes->reserve(this->vals_->size()); + bool indexes_out_of_order = false; Expression_list* vals = new Expression_list(); vals->reserve(this->vals_->size()); unsigned long index = 0; @@ -12625,6 +12669,9 @@ Composite_literal_expression::lower_array(Type* type) return Expression::make_error(location); } + if (!indexes->empty() && index < indexes->back()) + indexes_out_of_order = true; + indexes->push_back(index); } @@ -12639,6 +12686,34 @@ Composite_literal_expression::lower_array(Type* type) indexes = NULL; } + if (indexes_out_of_order) + { + typedef std::vector<std::pair<unsigned long, Expression*> > V; + + V v; + v.reserve(indexes->size()); + std::vector<unsigned long>::const_iterator pi = indexes->begin(); + for (Expression_list::const_iterator pe = vals->begin(); + pe != vals->end(); + ++pe, ++pi) + v.push_back(std::make_pair(*pi, *pe)); + + std::sort(v.begin(), v.end(), Index_value_compare()); + + delete indexes; + delete vals; + indexes = new std::vector<unsigned long>(); + indexes->reserve(v.size()); + vals = new Expression_list(); + vals->reserve(v.size()); + + for (V::const_iterator p = v.begin(); p != v.end(); ++p) + { + indexes->push_back(p->first); + vals->push_back(p->second); + } + } + return this->make_array(type, indexes, vals); } @@ -12659,7 +12734,9 @@ Composite_literal_expression::make_array( size_t size; if (vals == NULL) size = 0; - else if (indexes == NULL) + else if (indexes != NULL) + size = indexes->back() + 1; + else { size = vals->size(); Integer_type* it = Type::lookup_integer_type("int")->integer_type(); @@ -12670,11 +12747,6 @@ Composite_literal_expression::make_array( return Expression::make_error(location); } } - else - { - size = *std::max_element(indexes->begin(), indexes->end()); - ++size; - } mpz_t vlen; mpz_init_set_ui(vlen, size); @@ -12702,8 +12774,7 @@ Composite_literal_expression::make_array( } else { - unsigned long max = *std::max_element(indexes->begin(), - indexes->end()); + unsigned long max = indexes->back(); if (max >= val) { error_at(location, diff --git a/gcc/go/gofrontend/gogo-tree.cc b/gcc/go/gofrontend/gogo-tree.cc index 5f74de5a8b3..bc33769a07a 100644 --- a/gcc/go/gofrontend/gogo-tree.cc +++ b/gcc/go/gofrontend/gogo-tree.cc @@ -401,7 +401,7 @@ Gogo::register_gc_vars(const std::vector<Named_object*>& var_gc, // Build a constructor for the struct. - VEC(constructor_elt,gc*) root_list_init = VEC_alloc(constructor_elt, gc, 2); + VEC(constructor_elt,gc)* root_list_init = VEC_alloc(constructor_elt, gc, 2); elt = VEC_quick_push(constructor_elt, root_list_init, NULL); field = TYPE_FIELDS(root_list_type); @@ -1003,7 +1003,7 @@ Named_object::get_id(Gogo* gogo) { const Named_object* in_function = this->type_value()->in_function(); if (in_function != NULL) - decl_name += '$' + in_function->name(); + decl_name += '$' + Gogo::unpack_hidden_name(in_function->name()); } return get_identifier_from_string(decl_name); } diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 35770c76572..3f6e97a3f28 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -1748,7 +1748,7 @@ Type::specific_type_functions(Gogo* gogo, Named_type* name, base_name = name->name(); const Named_object* in_function = name->in_function(); if (in_function != NULL) - base_name += '$' + in_function->name(); + base_name += '$' + Gogo::unpack_hidden_name(in_function->name()); } std::string hash_name = base_name + "$hash"; std::string equal_name = base_name + "$equal"; diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index 41957345bb0..45fb232ae8b 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -247,10 +247,6 @@ add_static_var (tree var) static inline bool is_proper_for_analysis (tree t) { - /* We handle only variables whose address is never taken. */ - if (TREE_ADDRESSABLE (t)) - return false; - /* If the variable has the "used" attribute, treat it as if it had a been touched by the devil. */ if (DECL_PRESERVE_P (t)) @@ -266,10 +262,6 @@ is_proper_for_analysis (tree t) if (TREE_READONLY (t)) return false; - /* We cannot touch decls where the type needs constructing. */ - if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (t))) - return false; - /* This is a variable we care about. Check if we have seen it before, and if not add it the set of variables we care about. */ if (all_module_statics @@ -438,9 +430,7 @@ analyze_function (struct cgraph_node *fn) if (!symtab_variable_p (ref->referred)) continue; var = ipa_ref_varpool_node (ref)->symbol.decl; - if (ipa_ref_varpool_node (ref)->symbol.externally_visible - || !ipa_ref_varpool_node (ref)->analyzed - || !is_proper_for_analysis (var)) + if (!is_proper_for_analysis (var)) continue; switch (ref->use) { @@ -453,7 +443,6 @@ analyze_function (struct cgraph_node *fn) bitmap_set_bit (local->statics_written, DECL_UID (var)); break; case IPA_REF_ADDR: - gcc_unreachable (); break; } } @@ -613,6 +602,7 @@ static unsigned int propagate (void) { struct cgraph_node *node; + struct varpool_node *vnode; struct cgraph_node *w; struct cgraph_node **order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes); @@ -625,6 +615,28 @@ propagate (void) ipa_discover_readonly_nonaddressable_vars (); generate_summary (); + /* Now we know what vars are realy statics; prune out those that aren't. */ + FOR_EACH_VARIABLE (vnode) + if (vnode->symbol.externally_visible + || TREE_ADDRESSABLE (vnode->symbol.decl) + || TREE_READONLY (vnode->symbol.decl) + || !is_proper_for_analysis (vnode->symbol.decl) + || !vnode->analyzed) + bitmap_clear_bit (all_module_statics, DECL_UID (vnode->symbol.decl)); + + /* Forget info we collected "just for fun" on variables that turned out to be + non-local. */ + FOR_EACH_DEFINED_FUNCTION (node) + { + ipa_reference_local_vars_info_t node_l; + + node_l = &get_reference_vars_info (node)->local; + if (node_l->statics_read != all_module_statics) + bitmap_and_into (node_l->statics_read, all_module_statics); + if (node_l->statics_written != all_module_statics) + bitmap_and_into (node_l->statics_written, all_module_statics); + } + /* Propagate the local information thru the call graph to produce the global information. All the nodes within a cycle will have the same info so we collapse cycles first. Then we can do the @@ -1034,9 +1046,7 @@ ipa_reference_write_optimization_summary (cgraph_node_set set, for (i = 0; i < lto_varpool_encoder_size (varpool_encoder); i++) { struct varpool_node *vnode = lto_varpool_encoder_deref (varpool_encoder, i); - if (!vnode->symbol.externally_visible - && vnode->analyzed - && bitmap_bit_p (all_module_statics, DECL_UID (vnode->symbol.decl)) + if (bitmap_bit_p (all_module_statics, DECL_UID (vnode->symbol.decl)) && referenced_from_this_partition_p (&vnode->symbol.ref_list, set, vset)) { tree decl = vnode->symbol.decl; diff --git a/gcc/ipa.c b/gcc/ipa.c index a107c6f0ec5..43c2f60fa2a 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -100,7 +100,10 @@ process_references (struct ipa_ref_list *list, { struct varpool_node *node = ipa_ref_varpool_node (ref); - if (node->analyzed) + if (node->analyzed + && (!DECL_EXTERNAL (node->symbol.decl) + || node->alias + || before_inlining_p)) pointer_set_insert (reachable, node); enqueue_node ((symtab_node) node, first, reachable); } @@ -187,6 +190,12 @@ has_addr_references_p (struct cgraph_node *node, reshape callgraph and preserve body when offline copy of function or inline clone is being removed. + - C++ virtual tables keyed to other unit are represented as DECL_EXTERNAL + variables with DECL_INITIAL set. We finalize these and keep reachable + ones around for constant folding purposes. After inlining we however + stop walking their references to let everything static referneced by them + to be removed when it is otherwise unreachable. + We maintain queue of both reachable symbols (i.e. defined symbols that needs to stay) and symbols that are in boundary (i.e. external symbols referenced by reachable symbols or origins of clones). The queue is represented @@ -323,6 +332,19 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file) } } } + /* When we see constructor of external variable, keep referred nodes in the + boundary. This will also hold initializers of the external vars NODE + reffers to. */ + if (symtab_variable_p (node) + && DECL_EXTERNAL (node->symbol.decl) + && !varpool (node)->alias + && in_boundary_p) + { + int i; + struct ipa_ref *ref; + for (i = 0; ipa_ref_list_reference_iterate (&node->symbol.ref_list, i, ref); i++) + enqueue_node (ref->referred, &first, reachable); + } } /* Remove unreachable functions. */ @@ -347,7 +369,7 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file) changed = true; } if (!pointer_set_contains (body_needed_for_clonning, node->symbol.decl) - && !DECL_ARTIFICIAL (node->symbol.decl)) + && (node->local.finalized || !DECL_ARTIFICIAL (node->symbol.decl))) cgraph_release_function_body (node); node->analyzed = false; } @@ -627,6 +649,9 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased) if (vnode->alias && DECL_EXTERNAL (vnode->symbol.decl)) return true; + if (DECL_EXTERNAL (vnode->symbol.decl)) + return true; + if (!DECL_COMDAT (vnode->symbol.decl) && !TREE_PUBLIC (vnode->symbol.decl)) return false; @@ -890,7 +915,6 @@ function_and_variable_visibility (bool whole_program) symtab_dissolve_same_comdat_group_list ((symtab_node) vnode); vnode->symbol.resolution = LDPR_PREVAILING_DEF_IRONLY; } - gcc_assert (TREE_STATIC (vnode->symbol.decl)); } pointer_set_destroy (aliased_nodes); pointer_set_destroy (aliased_vnodes); diff --git a/gcc/ira.c b/gcc/ira.c index c4e2aaac675..1809e0da83a 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -3621,9 +3621,6 @@ int first_moveable_pseudo, last_moveable_pseudo; first_moveable_pseudo. */ /* The original home register. */ static VEC (rtx, heap) *pseudo_replaced_reg; -/* The move instruction we added to move the value to its original home - register. */ -static VEC (rtx, heap) *pseudo_move_insn; /* Look for instances where we have an instruction that is known to increase register pressure, and whose result is not used immediately. If it is @@ -3667,9 +3664,7 @@ find_moveable_pseudos (void) bitmap_initialize (&interesting, 0); first_moveable_pseudo = max_regs; - VEC_free (rtx, heap, pseudo_move_insn); VEC_free (rtx, heap, pseudo_replaced_reg); - VEC_safe_grow (rtx, heap, pseudo_move_insn, max_regs); VEC_safe_grow (rtx, heap, pseudo_replaced_reg, max_regs); df_analyze (); @@ -3965,10 +3960,8 @@ find_moveable_pseudos (void) if (validate_change (def_insn, DF_REF_LOC (def), newreg, 0)) { unsigned nregno = REGNO (newreg); - rtx move = emit_insn_before (gen_move_insn (def_reg, newreg), - use_insn); + emit_insn_before (gen_move_insn (def_reg, newreg), use_insn); nregno -= max_regs; - VEC_replace (rtx, pseudo_move_insn, nregno, move); VEC_replace (rtx, pseudo_replaced_reg, nregno, def_reg); } } @@ -4011,27 +4004,32 @@ move_unallocated_pseudos (void) for (i = first_moveable_pseudo; i < last_moveable_pseudo; i++) if (reg_renumber[i] < 0) { - df_ref def = DF_REG_DEF_CHAIN (i); int idx = i - first_moveable_pseudo; rtx other_reg = VEC_index (rtx, pseudo_replaced_reg, idx); - rtx def_insn = DF_REF_INSN (def); - rtx move_insn = VEC_index (rtx, pseudo_move_insn, idx); - rtx set; + rtx def_insn = DF_REF_INSN (DF_REG_DEF_CHAIN (i)); + /* The use must follow all definitions of OTHER_REG, so we can + insert the new definition immediately after any of them. */ + df_ref other_def = DF_REG_DEF_CHAIN (REGNO (other_reg)); + rtx move_insn = DF_REF_INSN (other_def); rtx newinsn = emit_insn_after (PATTERN (def_insn), move_insn); + rtx set; int success; if (dump_file) fprintf (dump_file, "moving def of %d (insn %d now) ", REGNO (other_reg), INSN_UID (def_insn)); + delete_insn (move_insn); + while ((other_def = DF_REG_DEF_CHAIN (REGNO (other_reg)))) + delete_insn (DF_REF_INSN (other_def)); + delete_insn (def_insn); + set = single_set (newinsn); success = validate_change (newinsn, &SET_DEST (set), other_reg, 0); gcc_assert (success); if (dump_file) fprintf (dump_file, " %d) rather than keep unallocated replacement %d\n", INSN_UID (newinsn), i); - delete_insn (move_insn); - delete_insn (def_insn); SET_REG_N_REFS (i, 0); } } diff --git a/gcc/jump.c b/gcc/jump.c index 246fab02ff3..f5f644999d6 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1252,6 +1252,26 @@ delete_related_insns (rtx insn) if (next != 0 && BARRIER_P (next)) delete_insn (next); + /* If this is a call, then we have to remove the var tracking note + for the call arguments. */ + + if (CALL_P (insn) + || (NONJUMP_INSN_P (insn) + && GET_CODE (PATTERN (insn)) == SEQUENCE + && CALL_P (XVECEXP (PATTERN (insn), 0, 0)))) + { + rtx p = insn; + + for (p = NEXT_INSN (p); + p && NOTE_P (p); + p = NEXT_INSN (p)) + if (NOTE_KIND (p) == NOTE_INSN_CALL_ARG_LOCATION) + { + remove_insn (p); + break; + } + } + /* If deleting a jump, decrement the count of the label, and delete the label if it is now unused. */ diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 25634899047..447948f75a9 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -440,7 +440,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, Cherry-picked nodes: These are nodes we pulled from other translation units into SET during IPA-inlining. We make them as local static nodes to prevent clashes with other local statics. */ - if (boundary_p && node->analyzed) + if (boundary_p && node->analyzed && !DECL_EXTERNAL (node->symbol.decl)) { /* Inline clones can not be part of boundary. gcc_assert (!node->global.inlined_to); @@ -575,6 +575,7 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node FIXME: Alternatively at -Os we may want to avoid generating for them the local labels and share them across LTRANS partitions. */ if (DECL_IN_CONSTANT_POOL (node->symbol.decl) + && !DECL_EXTERNAL (node->symbol.decl) && !DECL_COMDAT (node->symbol.decl)) { bp_pack_value (&bp, 0, 1); /* used_from_other_parition. */ @@ -585,7 +586,8 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node bp_pack_value (&bp, node->analyzed && referenced_from_other_partition_p (&node->symbol.ref_list, set, vset), 1); - bp_pack_value (&bp, boundary_p, 1); /* in_other_partition. */ + bp_pack_value (&bp, boundary_p && !DECL_EXTERNAL (node->symbol.decl), 1); + /* in_other_partition. */ } streamer_write_bitpack (&bp); if (node->alias_of) diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index 5d617755ac4..63497f6d456 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -931,39 +931,6 @@ input_function (tree fn_decl, struct data_in *data_in, } -/* Read initializer expressions for public statics. DATA_IN is the - file being read. IB is the input block used for reading. */ - -static void -input_alias_pairs (struct lto_input_block *ib, struct data_in *data_in) -{ - tree var; - - clear_line_info (data_in); - - var = stream_read_tree (ib, data_in); - while (var) - { - const char *orig_name, *new_name; - alias_pair *p; - - p = VEC_safe_push (alias_pair, gc, alias_pairs, NULL); - p->decl = var; - p->target = stream_read_tree (ib, data_in); - - /* If the target is a static object, we may have registered a - new name for it to avoid clashes between statics coming from - different files. In that case, use the new name. */ - orig_name = IDENTIFIER_POINTER (p->target); - new_name = lto_get_decl_name_mapping (data_in->file_data, orig_name); - if (strcmp (orig_name, new_name) != 0) - p->target = get_identifier (new_name); - - var = stream_read_tree (ib, data_in); - } -} - - /* Read the body from DATA for function FN_DECL and fill it in. FILE_DATA are the global decls and types. SECTION_TYPE is either LTO_section_function_body or LTO_section_static_initializer. If @@ -1059,10 +1026,6 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl, pop_cfun (); } - else - { - input_alias_pairs (&ib_main, data_in); - } clear_line_info (data_in); lto_data_in_delete (data_in); @@ -1081,17 +1044,6 @@ lto_input_function_body (struct lto_file_decl_data *file_data, } -/* Read in VAR_DECL using DATA. FILE_DATA holds the global decls and - types. */ - -void -lto_input_constructors_and_inits (struct lto_file_decl_data *file_data, - const char *data) -{ - lto_read_body (file_data, NULL, data, LTO_section_static_initializer); -} - - /* Read the physical representation of a tree node with tag TAG from input block IB using the per-file context in DATA_IN. */ diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 9a54f1900ff..7f12e1c56b1 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -353,11 +353,10 @@ lto_write_tree (struct output_block *ob, tree expr, bool ref_p) varpool_encoder = ob->decl_state->varpool_node_encoder; vnode = varpool_get_node (expr); - if (!vnode) + if (!vnode + || !lto_varpool_encoder_encode_initializer_p (varpool_encoder, + vnode)) initial = error_mark_node; - else if (!lto_varpool_encoder_encode_initializer_p (varpool_encoder, - vnode)) - initial = NULL; } stream_write_tree (ob, initial, ref_p); @@ -853,115 +852,6 @@ output_function (struct cgraph_node *node) } -/* Used to pass data to trivally_defined_alias callback. */ -struct sets { - cgraph_node_set set; - varpool_node_set vset; -}; - - -/* Return true if alias pair P belongs to the set of cgraph nodes in - SET. If P is a an alias for a VAR_DECL, it can always be emitted. - However, for FUNCTION_DECL aliases, we should only output the pair - if it belongs to a function whose cgraph node is in SET. - Otherwise, the LTRANS phase will get into trouble when finalizing - aliases because the alias will refer to a function not defined in - the file processed by LTRANS. */ - -static bool -trivally_defined_alias (tree decl ATTRIBUTE_UNUSED, - tree target, void *data) -{ - struct sets *set = (struct sets *) data; - struct cgraph_node *fnode = NULL; - struct varpool_node *vnode = NULL; - - fnode = cgraph_node_for_asm (target); - if (fnode) - return cgraph_node_in_set_p (fnode, set->set); - vnode = varpool_node_for_asm (target); - return vnode && varpool_node_in_set_p (vnode, set->vset); -} - -/* Return true if alias pair P should be output in the current - partition contains cgrpah nodes SET and varpool nodes VSET. - DEFINED is set of all aliases whose targets are defined in - the partition. - - Normal aliases are output when they are defined, while WEAKREF - aliases are output when they are used. */ - -static bool -output_alias_pair_p (alias_pair *p, symbol_alias_set_t *defined, - cgraph_node_set set, varpool_node_set vset) -{ - struct cgraph_node *node; - struct varpool_node *vnode; - - if (lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl))) - { - if (TREE_CODE (p->decl) == VAR_DECL) - { - vnode = varpool_get_node (p->decl); - return (vnode - && referenced_from_this_partition_p (&vnode->symbol.ref_list, - set, vset)); - } - node = cgraph_get_node (p->decl); - return (node - && (referenced_from_this_partition_p (&node->symbol.ref_list, - set, vset) - || reachable_from_this_partition_p (node, set))); - } - else - return symbol_alias_set_contains (defined, p->decl); -} - -/* Output any unreferenced global symbol defined in SET, alias pairs - and labels. */ - -static void -output_unreferenced_globals (cgraph_node_set set, varpool_node_set vset) -{ - struct output_block *ob; - alias_pair *p; - unsigned i; - symbol_alias_set_t *defined; - struct sets setdata; - - setdata.set = set; - setdata.vset = vset; - - ob = create_output_block (LTO_section_static_initializer); - ob->cgraph_node = NULL; - - clear_line_info (ob); - - /* Make string 0 be a NULL string. */ - streamer_write_char_stream (ob->string_stream, 0); - - /* We really need to propagate in both directoins: - for normal aliases we propagate from first defined alias to - all aliases defined based on it. For weakrefs we propagate in - the oposite direction. */ - defined = propagate_aliases_backward (trivally_defined_alias, &setdata); - - /* Emit the alias pairs for the nodes in SET. */ - FOR_EACH_VEC_ELT (alias_pair, alias_pairs, i, p) - if (output_alias_pair_p (p, defined, set, vset)) - { - stream_write_tree (ob, p->decl, true); - stream_write_tree (ob, p->target, true); - } - symbol_alias_set_destroy (defined); - - streamer_write_record_start (ob, LTO_null); - - produce_asm (ob, NULL); - destroy_output_block (ob); -} - - /* Emit toplevel asms. */ void @@ -1388,8 +1278,7 @@ write_symbol (struct streamer_tree_cache_d *cache, SET and VSET are cgraph/varpool node sets we are outputting. */ static void -produce_symtab (struct output_block *ob, - cgraph_node_set set, varpool_node_set vset) +produce_symtab (struct output_block *ob) { struct streamer_tree_cache_d *cache = ob->writer_cache; char *section_name = lto_get_section_name (LTO_section_symtab, NULL, NULL); @@ -1400,12 +1289,6 @@ produce_symtab (struct output_block *ob, lto_varpool_encoder_t varpool_encoder = ob->decl_state->varpool_node_encoder; lto_cgraph_encoder_t encoder = ob->decl_state->cgraph_node_encoder; int i; - alias_pair *p; - struct sets setdata; - symbol_alias_set_t *defined; - - setdata.set = set; - setdata.vset = vset; lto_begin_section (section_name, false); free (section_name); @@ -1479,13 +1362,6 @@ produce_symtab (struct output_block *ob, write_symbol (cache, &stream, vnode->symbol.decl, seen, false); } - /* Write all aliases. */ - defined = propagate_aliases_backward (trivally_defined_alias, &setdata); - FOR_EACH_VEC_ELT (alias_pair, alias_pairs, i, p) - if (output_alias_pair_p (p, defined, set, vset)) - write_symbol (cache, &stream, p->decl, seen, true); - symbol_alias_set_destroy (defined); - lto_write_stream (&stream); pointer_set_destroy (seen); @@ -1500,7 +1376,8 @@ produce_symtab (struct output_block *ob, recover these on other side. */ static void -produce_asm_for_decls (cgraph_node_set set, varpool_node_set vset) +produce_asm_for_decls (cgraph_node_set set ATTRIBUTE_UNUSED, + varpool_node_set vset ATTRIBUTE_UNUSED) { struct lto_out_decl_state *out_state; struct lto_out_decl_state *fn_out_state; @@ -1515,11 +1392,6 @@ produce_asm_for_decls (cgraph_node_set set, varpool_node_set vset) ob = create_output_block (LTO_section_decls); ob->global = true; - /* Write out unreferenced globals, alias pairs and labels. We defer - doing this until now so that we can write out only what is - needed. */ - output_unreferenced_globals (set, vset); - memset (&header, 0, sizeof (struct lto_decl_header)); section_name = lto_get_section_name (LTO_section_decls, NULL, NULL); @@ -1529,6 +1401,8 @@ produce_asm_for_decls (cgraph_node_set set, varpool_node_set vset) /* Make string 0 be a NULL string. */ streamer_write_char_stream (ob->string_stream, 0); + gcc_assert (!alias_pairs); + /* Write the global symbols. */ out_state = lto_get_out_decl_state (); num_fns = VEC_length (lto_out_decl_state_ptr, lto_function_decl_states); @@ -1592,7 +1466,7 @@ produce_asm_for_decls (cgraph_node_set set, varpool_node_set vset) /* Write the symbol table. It is used by linker to determine dependencies and thus we can skip it for WPA. */ if (!flag_wpa) - produce_symtab (ob, set, vset); + produce_symtab (ob); /* Write command line opts. */ lto_write_options (); diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index a371c0a7f11..c5efb7f0156 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -489,7 +489,21 @@ lto_symtab_resolve_symbols (void **slot) /* From variables that can prevail choose the largest one. */ if (!prevailing || tree_int_cst_lt (DECL_SIZE (prevailing->decl), - DECL_SIZE (e->decl))) + DECL_SIZE (e->decl)) + /* When variables are equivalent try to chose one that has useful + DECL_INITIAL. This makes sense for keyed vtables that are + DECL_EXTERNAL but initialized. In units that do not need them + we replace the initializer by error_mark_node to conserve + memory. + + We know that the vtable is keyed outside the LTO unit - otherwise + the keyed instance would prevail. We still can preserve useful + info in the initializer. */ + || (DECL_SIZE (prevailing->decl) == DECL_SIZE (e->decl) + && (DECL_INITIAL (e->decl) + && DECL_INITIAL (e->decl) != error_mark_node) + && (!DECL_INITIAL (prevailing->decl) + || DECL_INITIAL (prevailing->decl) == error_mark_node))) prevailing = e; } diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 6edc2afbc82..06774d833b0 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,14 @@ +2012-05-18 Jan Hubicka <jh@suse.cz> + + * lto.c (lto_materialize_constructors_and_inits): Remove. + (read_cgraph_and_symbols): Remove handling of alias pairs. + +2012-05-17 Jan Hubicka <jh@suse.cz> + + * lto-partition.c (add_references_to_partition): Handle external vars. + (partition_varpool_node_p): Likewise. + (lto_promote_cross_file_statics): Do not promote externals. + 2012-05-14 Bernd Schmidt <bernds@codesourcery.com> * lto-lang.c (handle_fnspec_attribute): New static function. diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c index 5c931e682af..602173dd949 100644 --- a/gcc/lto/lto-partition.c +++ b/gcc/lto/lto-partition.c @@ -83,6 +83,7 @@ add_references_to_partition (ltrans_partition part, struct ipa_ref_list *refs) else if (symtab_variable_p (ref->referred) && (DECL_COMDAT (ipa_ref_varpool_node (ref)->symbol.decl) + || DECL_EXTERNAL (ipa_ref_varpool_node (ref)->symbol.decl) || (ref->use == IPA_REF_ALIAS && lookup_attribute ("weakref", @@ -287,6 +288,7 @@ partition_varpool_node_p (struct varpool_node *vnode) return false; /* Constant pool and comdat are always only in partitions they are needed. */ if (DECL_IN_CONSTANT_POOL (vnode->symbol.decl) + || DECL_EXTERNAL (vnode->symbol.decl) || (DECL_COMDAT (vnode->symbol.decl) && !vnode->symbol.force_output && !symtab_used_from_object_file_p ((symtab_node) vnode))) @@ -843,6 +845,7 @@ lto_promote_cross_file_statics (void) be made global. It is sensible to keep those ltrans local to allow better optimization. */ if (!DECL_IN_CONSTANT_POOL (vnode->symbol.decl) + && !DECL_EXTERNAL (vnode->symbol.decl) && !DECL_COMDAT (vnode->symbol.decl) && !vnode->symbol.externally_visible && vnode->analyzed && referenced_from_other_partition_p (&vnode->symbol.ref_list, @@ -893,8 +896,11 @@ lto_promote_cross_file_statics (void) /* Constant pool references use internal labels and thus cannot be made global. It is sensible to keep those - ltrans local to allow better optimization. */ - if (DECL_IN_CONSTANT_POOL (v->symbol.decl)) + ltrans local to allow better optimization. + Similarly we ship external vars initializers into + every ltrans unit possibly referring to it. */ + if (DECL_IN_CONSTANT_POOL (v->symbol.decl) + || DECL_EXTERNAL (v->symbol.decl)) { if (!pointer_set_insert (inserted, vnode)) VEC_safe_push (varpool_node_ptr, heap, diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 00f623f6a0d..b94c8a7f869 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -156,20 +156,6 @@ lto_splay_tree_new (void) NULL); } -/* Read the constructors and inits. */ - -static void -lto_materialize_constructors_and_inits (struct lto_file_decl_data * file_data) -{ - size_t len; - const char *data = lto_get_section_data (file_data, - LTO_section_static_initializer, - NULL, &len); - lto_input_constructors_and_inits (file_data, data); - lto_free_section_data (file_data, LTO_section_static_initializer, NULL, - data, len); -} - /* Return true when NODE has a clone that is analyzed (i.e. we need to load its body even if the node itself is not needed). */ @@ -1883,15 +1869,6 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) timevar_push (TV_IPA_LTO_DECL_INIT_IO); - /* FIXME lto. This loop needs to be changed to use the pass manager to - call the ipa passes directly. */ - if (!seen_error ()) - for (i = 0; i < last_file_ix; i++) - { - struct lto_file_decl_data *file_data = all_file_decl_data [i]; - lto_materialize_constructors_and_inits (file_data); - } - /* Indicate that the cgraph is built and ready. */ cgraph_function_flags_ready = true; diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 6fed845690e..ce8dd9ed62a 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,6 +1,12 @@ +2012-05-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR objc++/53388 + * objc-act.c (objc_get_class_reference, objc_build_message_expr): + Use build_min_nt_loc. + 2012-04-20 Jan Hubicka <jh@suse.cz> - * objc-acct.c (mark_referenced_methods); Use + * objc-act.c (mark_referenced_methods); Use cgraph_mark_force_output_node. 2012-03-21 Steven Bosscher <steven@gcc.gnu.org> diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index ec07971f02d..b93948e9ee0 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -3293,7 +3293,7 @@ objc_get_class_reference (tree ident) #ifdef OBJCPLUS if (processing_template_decl) /* Must wait until template instantiation time. */ - return build_min_nt (CLASS_REFERENCE_EXPR, ident); + return build_min_nt_loc (UNKNOWN_LOCATION, CLASS_REFERENCE_EXPR, ident); #endif if (TREE_CODE (ident) == TYPE_DECL) @@ -5272,8 +5272,8 @@ objc_build_message_expr (tree receiver, tree message_args) #ifdef OBJCPLUS if (processing_template_decl) /* Must wait until template instantiation time. */ - return build_min_nt (MESSAGE_SEND_EXPR, receiver, sel_name, - method_params); + return build_min_nt_loc (UNKNOWN_LOCATION, MESSAGE_SEND_EXPR, receiver, + sel_name, method_params); #endif return objc_finish_message_expr (receiver, sel_name, method_params, NULL); diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 1d46a5dc3c9..0abe6bcf2a8 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -391,10 +391,14 @@ for (i = 0; i < n_enabledby; i++) { n_enables = split(enables[enabledby_name], thisenable, ","); for (j = 1; j < n_enables; j++) { opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]); - print " if (!opts_set->x_" opt_var_name ")" - print " handle_generated_option (opts, opts_set," - print " " opt_enum(thisenable[j]) ", NULL, value," - print " lang_mask, kind, loc, handlers, dc);" + if (opt_var_name != "") { + print " if (!opts_set->x_" opt_var_name ")" + print " handle_generated_option (opts, opts_set," + print " " opt_enum(thisenable[j]) ", NULL, value," + print " lang_mask, kind, loc, handlers, dc);" + } else { + print "#error " thisenable[j] " does not have a Var() flag" + } } print " break;\n" } @@ -430,10 +434,14 @@ for (i = 0; i < n_langs; i++) { n_enables = split(enables[lang_name,enabledby_name], thisenable, ","); for (j = 1; j < n_enables; j++) { opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]); - print " if (!opts_set->x_" opt_var_name ")" - print " handle_generated_option (opts, opts_set," - print " " opt_enum(thisenable[j]) ", arg, value," - print " lang_mask, kind, loc, handlers, dc);" + if (opt_var_name != "") { + print " if (!opts_set->x_" opt_var_name ")" + print " handle_generated_option (opts, opts_set," + print " " opt_enum(thisenable[j]) ", arg, value," + print " lang_mask, kind, loc, handlers, dc);" + } else { + print "#error " thisenable[j] " does not have a Var() flag" + } } print " break;\n" } diff --git a/gcc/opts.c b/gcc/opts.c index ac43d4a2da7..58199c3bc3e 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1712,8 +1712,11 @@ common_handle_option (struct gcc_options *opts, break; case OPT_pedantic_errors: - opts->x_pedantic = 1; dc->pedantic_errors = 1; + control_warning_option (OPT_Wpedantic, DK_ERROR, value, + loc, lang_mask, + handlers, opts, opts_set, + dc); break; case OPT_flto: @@ -2012,9 +2015,6 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask, control_warning_option (option_index, (int) kind, value, loc, lang_mask, handlers, opts, opts_set, dc); - if (option_index == OPT_Wuninitialized) - enable_warning_as_error ("maybe-uninitialized", value, lang_mask, - handlers, opts, opts_set, loc, dc); } free (new_option); } diff --git a/gcc/regstat.c b/gcc/regstat.c index bfd743bffd4..66a856beee2 100644 --- a/gcc/regstat.c +++ b/gcc/regstat.c @@ -118,8 +118,9 @@ size_t reg_info_p_size; static void regstat_bb_compute_ri (unsigned int bb_index, - bitmap live, bitmap do_not_gen, bitmap artificial_uses, - bitmap local_live, bitmap local_processed) + bitmap live, bitmap artificial_uses, + bitmap local_live, bitmap local_processed, + int *local_live_last_luid) { basic_block bb = BASIC_BLOCK (bb_index); rtx insn; @@ -160,7 +161,6 @@ regstat_bb_compute_ri (unsigned int bb_index, FOR_BB_INSNS_REVERSE (bb, insn) { unsigned int uid = INSN_UID (insn); - unsigned int regno; bitmap_iterator bi; struct df_mw_hardreg **mws_rec; rtx link; @@ -168,17 +168,8 @@ regstat_bb_compute_ri (unsigned int bb_index, if (!NONDEBUG_INSN_P (insn)) continue; - /* Increment the live_length for all of the registers that - are are referenced in this block and live at this - particular point. */ - EXECUTE_IF_SET_IN_BITMAP (local_live, 0, regno, bi) - { - REG_LIVE_LENGTH (regno)++; - } luid++; - bitmap_clear (do_not_gen); - link = REG_NOTES (insn); while (link) { @@ -196,6 +187,8 @@ regstat_bb_compute_ri (unsigned int bb_index, { REG_N_CALLS_CROSSED (regno)++; REG_FREQ_CALLS_CROSSED (regno) += REG_FREQ_FROM_BB (bb); + REG_FREQ_CALLS_CROSSED (regno) = + MIN (REG_FREQ_CALLS_CROSSED (regno), REG_FREQ_MAX); if (can_throw) REG_N_THROWING_CALLS_CROSSED (regno)++; @@ -215,8 +208,9 @@ regstat_bb_compute_ri (unsigned int bb_index, } } - /* We only care about real sets for calls. Clobbers only - may clobbers cannot be depended on. */ + /* We only care about real sets for calls. Clobbers cannot + be depended on. + Only do this if the value is totally dead. */ for (mws_rec = DF_INSN_UID_MWS (uid); *mws_rec; mws_rec++) { struct df_mw_hardreg *mws = *mws_rec; @@ -225,9 +219,9 @@ regstat_bb_compute_ri (unsigned int bb_index, bool all_dead = true; unsigned int r; - for (r=mws->start_regno; r <= mws->end_regno; r++) - if ((bitmap_bit_p (live, r)) - || bitmap_bit_p (artificial_uses, r)) + for (r = mws->start_regno; r <= mws->end_regno; r++) + if (bitmap_bit_p (artificial_uses, r) + || bitmap_bit_p (live, r)) { all_dead = false; break; @@ -235,9 +229,7 @@ regstat_bb_compute_ri (unsigned int bb_index, if (all_dead) { - unsigned int regno = mws->start_regno; - bitmap_set_bit (do_not_gen, regno); - /* Only do this if the value is totally dead. */ + regno = mws->start_regno; REG_LIVE_LENGTH (regno)++; } } @@ -255,20 +247,41 @@ regstat_bb_compute_ri (unsigned int bb_index, if (bitmap_bit_p (live, dregno)) { - /* If we have seen this regno, then it has already been - processed correctly with the per insn increment. If we - have not seen it we need to add the length from here to - the end of the block to the live length. */ - if (bitmap_bit_p (local_processed, dregno)) + /* If we have seen a use of DREGNO somewhere before (i.e. + later in this basic block), and DEF is not a subreg + store or conditional store, then kill the register + here and add the proper length to its REG_LIVE_LENGTH. + + If we have not seen a use of DREGNO later in this basic + block, then we need to add the length from here to the + end of the block to the live length. */ + if (bitmap_bit_p (local_live, dregno)) { + /* Note that LOCAL_LIVE implies LOCAL_PROCESSED, so + we don't have to set LOCAL_PROCESSED in this clause. */ if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL))) - bitmap_clear_bit (local_live, dregno); + { + REG_LIVE_LENGTH (dregno) += + (luid - local_live_last_luid[dregno]); + local_live_last_luid[dregno] = luid; + bitmap_clear_bit (local_live, dregno); + } } else { bitmap_set_bit (local_processed, dregno); REG_LIVE_LENGTH (dregno) += luid; + local_live_last_luid[dregno] = luid; } + + /* Kill this register if it is not a subreg store or + conditional store. + ??? This means that any partial store is live from + the last use in a basic block to the start of this + basic block. This results in poor calculations of + REG_LIVE_LENGTH in large basic blocks. */ + if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL))) + bitmap_clear_bit (live, dregno); } else if ((!(DF_REF_FLAGS (def) & DF_REF_MW_HARDREG)) && (!bitmap_bit_p (artificial_uses, dregno))) @@ -279,18 +292,14 @@ regstat_bb_compute_ri (unsigned int bb_index, if (dregno >= FIRST_PSEUDO_REGISTER) { REG_FREQ (dregno) += REG_FREQ_FROM_BB (bb); + REG_FREQ (dregno) = + MIN (REG_FREQ (dregno), REG_FREQ_MAX); + if (REG_BASIC_BLOCK (dregno) == REG_BLOCK_UNKNOWN) REG_BASIC_BLOCK (dregno) = bb->index; else if (REG_BASIC_BLOCK (dregno) != bb->index) REG_BASIC_BLOCK (dregno) = REG_BLOCK_GLOBAL; } - - if (!(DF_REF_FLAGS (def) & (DF_REF_MUST_CLOBBER + DF_REF_MAY_CLOBBER))) - bitmap_set_bit (do_not_gen, dregno); - - /* Kill this register if it is not a subreg store or conditional store. */ - if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL))) - bitmap_clear_bit (live, dregno); } } @@ -302,6 +311,9 @@ regstat_bb_compute_ri (unsigned int bb_index, if (uregno >= FIRST_PSEUDO_REGISTER) { REG_FREQ (uregno) += REG_FREQ_FROM_BB (bb); + REG_FREQ (uregno) = + MIN (REG_FREQ (uregno), REG_FREQ_MAX); + if (REG_BASIC_BLOCK (uregno) == REG_BLOCK_UNKNOWN) REG_BASIC_BLOCK (uregno) = bb->index; else if (REG_BASIC_BLOCK (uregno) != bb->index) @@ -310,22 +322,26 @@ regstat_bb_compute_ri (unsigned int bb_index, if (bitmap_set_bit (live, uregno)) { - /* This register is now live. */ - - /* If we have seen this regno, then it has already been - processed correctly with the per insn increment. If - we have not seen it we set the bit so that begins to - get processed locally. Note that we don't even get - here if the variable was live at the end of the block - since just a ref inside the block does not effect the - calculations. */ + /* This register is now live. Begin to process it locally. + + Note that we don't even get here if the variable was live + at the end of the block since just a ref inside the block + does not effect the calculations. */ REG_LIVE_LENGTH (uregno) ++; + local_live_last_luid[uregno] = luid; bitmap_set_bit (local_live, uregno); bitmap_set_bit (local_processed, uregno); } } } + /* Add the liveness length to all registers that were used somewhere + in this bock, but not between that use and the head of this block. */ + EXECUTE_IF_SET_IN_BITMAP (local_live, 0, regno, bi) + { + REG_LIVE_LENGTH (regno) += (luid - local_live_last_luid[regno]); + } + /* Add the length of the block to all of the registers that were not referenced, but still live in this block. */ bitmap_and_compl_into (live, local_processed); @@ -343,12 +359,12 @@ regstat_compute_ri (void) { basic_block bb; bitmap live = BITMAP_ALLOC (&df_bitmap_obstack); - bitmap do_not_gen = BITMAP_ALLOC (&df_bitmap_obstack); bitmap artificial_uses = BITMAP_ALLOC (&df_bitmap_obstack); bitmap local_live = BITMAP_ALLOC (&df_bitmap_obstack); bitmap local_processed = BITMAP_ALLOC (&df_bitmap_obstack); unsigned int regno; bitmap_iterator bi; + int *local_live_last_luid; /* Initialize everything. */ @@ -359,16 +375,20 @@ regstat_compute_ri (void) max_regno = max_reg_num (); reg_info_p_size = max_regno; reg_info_p = XCNEWVEC (struct reg_info_t, max_regno); + local_live_last_luid = XNEWVEC (int, max_regno); FOR_EACH_BB (bb) { - regstat_bb_compute_ri (bb->index, live, do_not_gen, artificial_uses, - local_live, local_processed); + regstat_bb_compute_ri (bb->index, live, artificial_uses, + local_live, local_processed, + local_live_last_luid); } BITMAP_FREE (live); - BITMAP_FREE (do_not_gen); BITMAP_FREE (artificial_uses); + BITMAP_FREE (local_live); + BITMAP_FREE (local_processed); + free (local_live_last_luid); /* See the setjmp comment in regstat_ri_bb_compute. */ EXECUTE_IF_SET_IN_BITMAP (setjmp_crosses, FIRST_PSEUDO_REGISTER, regno, bi) @@ -377,8 +397,6 @@ regstat_compute_ri (void) REG_LIVE_LENGTH (regno) = -1; } - BITMAP_FREE (local_live); - BITMAP_FREE (local_processed); timevar_pop (TV_REG_STATS); } @@ -463,6 +481,8 @@ regstat_bb_compute_calls_crossed (unsigned int bb_index, bitmap live) { REG_N_CALLS_CROSSED (regno)++; REG_FREQ_CALLS_CROSSED (regno) += REG_FREQ_FROM_BB (bb); + REG_FREQ_CALLS_CROSSED (regno) = + MIN (REG_FREQ_CALLS_CROSSED (regno), REG_FREQ_MAX); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9980ad7e294..0e4edf5ca2e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,129 @@ +2012-05-20 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/lto13.adb: New test. + * gnat.dg/lto13_pkg.ad[sb]: New helper. + +2012-05-18 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/specs/lto12.ads: New test. + * gnat.dg/specs/lto12_pkg.ads: New helper. + +2012-05-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/53346 + * gcc.dg/tree-ssa/ldist-18.c: New testcase. + * gcc.target/i386/incoming-10.c: Adjust. + * gcc.target/i386/incoming-11.c: Likewise. + * gcc.target/i386/pr46295.c: Likewise. + +2012-05-18 Richard Guenther <rguenther@suse.de> + + * gcc.dg/pr53352.c: Return zero. + +2012-05-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/53390 + * gcc.dg/torture/pr53390.c: New testcase. + +2012-05-18 Meador Inge <meadori@codesourcery.com> + + PR rtl-optimization/53352 + * gcc.dg/pr53352.c: New test. + +2012-05-17 David S. Miller <davem@davemloft.net> + + * gfortran.dg/bessel_7.f90: Bump allowed precision to avoid + failure on sparc-*-linux-gnu. + +2012-05-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/39681 + * g++.dg/parse/error49.C: New. + * g++.dg/cpp0x/error8.C: Likewise. + * g++.dg/ext/utf-cxx98.C: Adjust dg-error directive. + * g++.dg/ext/utf-dflt2.C: Likewise. + * g++.dg/ext/utf-gnuxx98.C: Likewise. + * g++.dg/ext/utf-dflt.C: Likewise. + * c-c++-common/raw-string-3.c: Likewise. + * c-c++-common/raw-string-4.c: Likewise. + +2012-05-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/53371 + * g++.dg/cpp0x/catch1.C: New. + +2012-05-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/44516 + * g++.dg/parse/error48.C: New. + * g++.dg/template/crash89.C: Adjust dg-error line numbers. + * g++.old-deja/g++.robertl/eb109.C: Add column info to dg-error string. + +2012-05-16 Patrick Marlier <patrick.marlier@gmail.com> + + * gcc.dg/tm/indirect-2.c: New test. + +2012-05-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR tree-optimization/53217 + * gfortran.dg/pr53217.f90: New test. + +2012-05-16 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/53364 + * g++.dg/torture/pr53364.C: New testcase. + +2012-05-16 Georg-Johann Lay <avr@gjlay.de> + + PR testsuite/52641 + * gcc.dg/pr52549.c: Fix test for long != void* + * gcc.c-torture/execute/pr52979-1.x: New file. + * gcc.c-torture/execute/pr52979-2.x: New file. + +2012-05-16 Dodji Seketeli <dodji@redhat.com> + + PR preprocessor/7263 + * gcc.dg/binary-constants-2.c: Run without tracking locations + accross macro expansion. + * gcc.dg/binary-constants-3.c: Likewise. + * gcc.dg/cpp/sysmac2.c: Likewise. + * testsuite/gcc.dg/nofixed-point-2.c: Adjust for more precise + location. + * gcc.dg/cpp/syshdr3.c: New test. + * gcc.dg/cpp/syshdr3.h: New header for the new test above. + * gcc.dg/system-binary-constants-1.c: New test. + * gcc.dg/system-binary-constants-1.h: New header for the new test + above. + * g++.dg/cpp/syshdr3.C: New test. + * g++.dg/cpp/syshdr3.h: New header the new test above. + * g++.dg/system-binary-constants-1.C: New test. + * g++.dg/system-binary-constants-1.h: New header the new test + above. + +2012-05-15 Paolo Carlini <paolo.carlini@oracle.com> + + * g++.old-deja/g++.pt/crash10.C: Adjust post PR11586. + +2012-05-15 Jakub Jelinek <jakub@redhat.com> + + PR target/53358 + * gcc.dg/pr53358.c: New test. + +2012-05-15 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/11856 + * g++.dg/warn/Wtype-limits.C: Don't warn in templates. + * g++.dg/warn/Wtype-limits-Wextra.C: Likewise. + +2012-05-15 Olivier Hainque <hainque@adacore.com> + + * g++.dg/eh/sighandle.C: New testcase. + +2012-05-15 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/53355 + * gcc.dg/tree-ssa/vrp67.c: New testcase. + 2012-05-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org> * gfortran.dg/*.f90: Remove now redundant manual diff --git a/gcc/testsuite/c-c++-common/raw-string-3.c b/gcc/testsuite/c-c++-common/raw-string-3.c index df9e2755518..70d4145da0c 100644 --- a/gcc/testsuite/c-c++-common/raw-string-3.c +++ b/gcc/testsuite/c-c++-common/raw-string-3.c @@ -5,26 +5,26 @@ // { dg-options "-std=c++98" { target c++ } } const void *s0 = R"(a)"; // { dg-error "was not declared|undeclared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 7 } + // { dg-error "expected ',' or ';'" "" { target c } 7 } const void *s1 = uR"(a)"; // { dg-error "was not declared|undeclared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 9 } + // { dg-error "expected ',' or ';'" "" { target c } 9 } const void *s2 = UR"(a)"; // { dg-error "was not declared|undeclared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 11 } + // { dg-error "expected ',' or ';'" "" { target c } 11 } const void *s3 = u8R"(a)"; // { dg-error "was not declared|undeclared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 13 } + // { dg-error "expected ',' or ';'" "" { target c } 13 } const void *s4 = LR"(a)"; // { dg-error "was not declared|undeclared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 15 } - -const int i0 = R'a'; // { dg-error "expected ',' or ';'" } - // { dg-error "was not declared" "" { target c++ } 18 } -const int i1 = uR'a'; // { dg-error "expected ',' or ';'" } - // { dg-error "was not declared" "" { target c++ } 20 } -const int i2 = UR'a'; // { dg-error "expected ',' or ';'" } - // { dg-error "was not declared" "" { target c++ } 22 } -const int i3 = u8R'a'; // { dg-error "expected ',' or ';'" } - // { dg-error "was not declared" "" { target c++ } 24 } -const int i4 = LR'a'; // { dg-error "expected ',' or ';'" } - // { dg-error "was not declared" "" { target c++ } 26 } + // { dg-error "expected ',' or ';'" "" { target c } 15 } + +const int i0 = R'a'; // { dg-error "was not declared" "" { target c++ } } + // { dg-error "expected ',' or ';'" "" { target c } 18 } +const int i1 = uR'a'; // { dg-error "was not declared" "" { target c++ } } + // { dg-error "expected ',' or ';'" "" { target c } 20 } +const int i2 = UR'a'; // { dg-error "was not declared" "" { target c++ } } + // { dg-error "expected ',' or ';'" "" { target c } 22 } +const int i3 = u8R'a'; // { dg-error "was not declared" "" { target c++ } } + // { dg-error "expected ',' or ';'" "" { target c } 24 } +const int i4 = LR'a'; // { dg-error "was not declared" "" { target c++ } } + // { dg-error "expected ',' or ';'" "" { target c } 26 } #define R "a" #define uR "b" diff --git a/gcc/testsuite/c-c++-common/raw-string-4.c b/gcc/testsuite/c-c++-common/raw-string-4.c index 626e7f257ae..95825d7c9cf 100644 --- a/gcc/testsuite/c-c++-common/raw-string-4.c +++ b/gcc/testsuite/c-c++-common/raw-string-4.c @@ -4,15 +4,15 @@ // { dg-options "-std=c++0x" { target c++ } } const int i0 = R'a'; // { dg-error "was not declared|undeclared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } + // { dg-error "expected ',' or ';'" "" { target c } 6 } const int i1 = uR'a'; // { dg-error "was not declared|undeclared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } + // { dg-error "expected ',' or ';'" "" { target c } 8 } const int i2 = UR'a'; // { dg-error "was not declared|undeclared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } + // { dg-error "expected ',' or ';'" "" { target c } 10 } const int i3 = u8R'a'; // { dg-error "was not declared|undeclared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } + // { dg-error "expected ',' or ';'" "" { target c } 12 } const int i4 = LR'a'; // { dg-error "was not declared|undeclared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 14 } + // { dg-error "expected ',' or ';'" "" { target c } 14 } #define R 1 + #define uR 2 + diff --git a/gcc/testsuite/g++.dg/cpp/syshdr3.C b/gcc/testsuite/g++.dg/cpp/syshdr3.C new file mode 100644 index 00000000000..39168239a39 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp/syshdr3.C @@ -0,0 +1,16 @@ +/* Contributed by Dodji Seketeli <dodji@redhat.com> */ +/* Origin: PR preprocessor/7263 */ +/* { dg-options "-pedantic -std=c++98 -ftrack-macro-expansion=1" } */ +/* { dg-do compile } */ + +/* This tests the proprer suppression of warning coming from macro + defined in system headers and expanded in a non-system header + location. */ +#include "syshdr3.h" + +static _Complex float c = _Complex_I + _Complex_I; /* These macros are defined in + system header so we should + have no warning here. */ +U_LL u = ONE_ULL; /* Likewise here. */ + +unsigned long long v = 1ULL; /* { dg-warning "long long" } */ diff --git a/gcc/testsuite/g++.dg/cpp/syshdr3.h b/gcc/testsuite/g++.dg/cpp/syshdr3.h new file mode 100644 index 00000000000..e5d502a24f5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp/syshdr3.h @@ -0,0 +1,7 @@ +#pragma GCC system_header + +#define _Complex __complex__ +#define _Complex_I 1.0iF + +#define U_LL unsigned long long +#define ONE_ULL 1ULL diff --git a/gcc/testsuite/g++.dg/cpp0x/catch1.C b/gcc/testsuite/g++.dg/cpp0x/catch1.C new file mode 100644 index 00000000000..81778ea7807 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/catch1.C @@ -0,0 +1,16 @@ +// PR c++/53371 +// { dg-do compile { target c++11 } } + +struct Abs +{ + virtual void a() = 0; +}; + +void foo() +{ + try { + } catch (Abs) { } // { dg-error "abstract class type" } + + try { + } catch (int&&) { } // { dg-error "rvalue reference type" } +} diff --git a/gcc/testsuite/g++.dg/cpp0x/error8.C b/gcc/testsuite/g++.dg/cpp0x/error8.C new file mode 100644 index 00000000000..cc4f87791a9 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/error8.C @@ -0,0 +1,7 @@ +// PR c++/39681 +// { dg-do compile { target c++11 } } + +struct A +{ + int* p = new foo; // { dg-error "16:expected type-specifier" } +}; diff --git a/gcc/testsuite/g++.dg/eh/sighandle.C b/gcc/testsuite/g++.dg/eh/sighandle.C new file mode 100644 index 00000000000..e516ad0a483 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/sighandle.C @@ -0,0 +1,38 @@ +// { dg-do run { target { *-*-aix5* i?86-*-linux* x86_64-*-linux* } } } +// { dg-options "-fexceptions -fnon-call-exceptions" } + +#include <signal.h> +#include <stdlib.h> + +void sighandler (int signo, siginfo_t * si, void * uc) +{ + throw (5); +} + +char * dosegv () +{ + * ((volatile int *)0) = 12; +} + +int main () +{ + struct sigaction sa; + int status; + + sa.sa_sigaction = sighandler; + sa.sa_flags = SA_SIGINFO; + + status = sigaction (SIGSEGV, & sa, NULL); + status = sigaction (SIGBUS, & sa, NULL); + + try { + dosegv (); + } + catch (int x) { + return (x != 5); + } + + return 1; +} + + diff --git a/gcc/testsuite/g++.dg/ext/utf-cxx98.C b/gcc/testsuite/g++.dg/ext/utf-cxx98.C index a8dd13a4e34..365118e3964 100644 --- a/gcc/testsuite/g++.dg/ext/utf-cxx98.C +++ b/gcc/testsuite/g++.dg/ext/utf-cxx98.C @@ -8,9 +8,7 @@ const static char16_t c0 = 'a'; /* { dg-error "not name a type" } */ const static char32_t c1 = 'a'; /* { dg-error "not name a type" } */ const unsigned short c2 = u'a'; /* { dg-error "not declared" } */ - /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */ const unsigned long c3 = U'a'; /* { dg-error "not declared" } */ - /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */ #define u 1 + #define U 2 + diff --git a/gcc/testsuite/g++.dg/ext/utf-dflt.C b/gcc/testsuite/g++.dg/ext/utf-dflt.C index 04849bfbf06..c2b127d5dda 100644 --- a/gcc/testsuite/g++.dg/ext/utf-dflt.C +++ b/gcc/testsuite/g++.dg/ext/utf-dflt.C @@ -8,9 +8,7 @@ const static char16_t c0 = 'a'; /* { dg-error "not name a type" } */ const static char32_t c1 = 'a'; /* { dg-error "not name a type" } */ const unsigned short c2 = u'a'; /* { dg-error "not declared" } */ - /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */ const unsigned long c3 = U'a'; /* { dg-error "not declared" } */ - /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */ #define u 1 + #define U 2 + diff --git a/gcc/testsuite/g++.dg/ext/utf-dflt2.C b/gcc/testsuite/g++.dg/ext/utf-dflt2.C index fd2222f672e..ab18ef52fdf 100644 --- a/gcc/testsuite/g++.dg/ext/utf-dflt2.C +++ b/gcc/testsuite/g++.dg/ext/utf-dflt2.C @@ -3,7 +3,6 @@ // { dg-options "-std=c++98" } const void *s0 = u8"a"; // { dg-error "was not declared" } - // { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } #define u8 "a" diff --git a/gcc/testsuite/g++.dg/ext/utf-gnuxx98.C b/gcc/testsuite/g++.dg/ext/utf-gnuxx98.C index fc8068b7e99..b3be121e2dc 100644 --- a/gcc/testsuite/g++.dg/ext/utf-gnuxx98.C +++ b/gcc/testsuite/g++.dg/ext/utf-gnuxx98.C @@ -8,9 +8,7 @@ const static char16_t c0 = 'a'; /* { dg-error "not name a type" } */ const static char32_t c1 = 'a'; /* { dg-error "not name a type" } */ const unsigned short c2 = u'a'; /* { dg-error "not declared" } */ - /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */ const unsigned long c3 = U'a'; /* { dg-error "not declared" } */ - /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */ #define u 1 + #define U 2 + diff --git a/gcc/testsuite/g++.dg/parse/error48.C b/gcc/testsuite/g++.dg/parse/error48.C new file mode 100644 index 00000000000..8f26bed9c20 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/error48.C @@ -0,0 +1,10 @@ +// PR c++/44516 + +struct WebService { }; +struct Server { }; + +void addHTTPService(Server const &server, + WebService const *http) +{ + server += http; // { dg-error "10:no match for 'operator\\+='" } +} diff --git a/gcc/testsuite/g++.dg/parse/error49.C b/gcc/testsuite/g++.dg/parse/error49.C new file mode 100644 index 00000000000..d5ec0c87ef6 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/error49.C @@ -0,0 +1,6 @@ +// PR c++/39681 + +int main() +{ + int* p = new foo; // { dg-error "16:expected type-specifier" } +} diff --git a/gcc/testsuite/g++.dg/system-binary-constants-1.C b/gcc/testsuite/g++.dg/system-binary-constants-1.C new file mode 100644 index 00000000000..7ef26f7f011 --- /dev/null +++ b/gcc/testsuite/g++.dg/system-binary-constants-1.C @@ -0,0 +1,18 @@ +/* + Origin: Dodji Seketeli <dodji@redhat.com> + { dg-options "-std=c++98 -pedantic" } + { dg-do compile } + */ + +#include "system-binary-constants-1.h" + +int +foo (void) +{ +#if BINARY_INT_CONSTANT_IN_SYSTEM_HEADER /* A binary constant defined + in system header. No + warning. */ + return 23; +#endif + return 0b1101; /* { dg-warning "binary constants are a GCC extension" } */ +} diff --git a/gcc/testsuite/g++.dg/system-binary-constants-1.h b/gcc/testsuite/g++.dg/system-binary-constants-1.h new file mode 100644 index 00000000000..85f291742ff --- /dev/null +++ b/gcc/testsuite/g++.dg/system-binary-constants-1.h @@ -0,0 +1,3 @@ +#pragma GCC system_header + +#define BINARY_INT_CONSTANT_IN_SYSTEM_HEADER 0b1101 diff --git a/gcc/testsuite/g++.dg/template/crash89.C b/gcc/testsuite/g++.dg/template/crash89.C index e62b57a3928..f860018621e 100644 --- a/gcc/testsuite/g++.dg/template/crash89.C +++ b/gcc/testsuite/g++.dg/template/crash89.C @@ -1,8 +1,8 @@ // PR c++/34397 -template<typename T, int = T()[0]> struct A +template<typename T, int = T()[0]> struct A // { dg-error "subscripted|template" } { typedef A<T> B; }; -A<int> a; // { dg-error "subscripted|template|declaration" } +A<int> a; // { dg-error "declaration" } diff --git a/gcc/testsuite/g++.dg/torture/pr53364.C b/gcc/testsuite/g++.dg/torture/pr53364.C new file mode 100644 index 00000000000..36bb083e828 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr53364.C @@ -0,0 +1,37 @@ +// { dg-do run } + +extern "C" void abort (void); + +template<typename _Tp> +inline const _Tp& +min(const _Tp& __a, const _Tp& __b) +{ + if (__b < __a) + return __b; + return __a; +} + +struct A +{ + int m_x; + + explicit A(int x) : m_x(x) {} + operator int() const { return m_x; } +}; + +struct B : public A +{ +public: + explicit B(int x) : A(x) {} +}; + +int data = 1; + +int main() +{ + B b = B(10); + b = min(b, B(data)); + if (b != 1) + abort (); + return 0; +} diff --git a/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C b/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C index 9cbdbe54783..f840f306b7d 100644 --- a/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C +++ b/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C @@ -66,7 +66,7 @@ int test (int x) template <typename Int, Int D> void f(Int x) { - assert(0 <= x and x <= D); // { dg-warning "comparison is always true due to limited range of data type" } + assert(0 <= x and x <= D); } int ff(void) { diff --git a/gcc/testsuite/g++.dg/warn/Wtype-limits.C b/gcc/testsuite/g++.dg/warn/Wtype-limits.C index 814c2a8826e..a352e7ba9bb 100644 --- a/gcc/testsuite/g++.dg/warn/Wtype-limits.C +++ b/gcc/testsuite/g++.dg/warn/Wtype-limits.C @@ -66,7 +66,7 @@ int test (int x) template <typename Int, Int D> void f(Int x) { - assert(0 <= x and x <= D); // { dg-warning "comparison is always true due to limited range of data type" } + assert(0 <= x and x <= D); } int ff(void) { diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash10.C b/gcc/testsuite/g++.old-deja/g++.pt/crash10.C index 2f785b4b9e6..5e87876147c 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash10.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash10.C @@ -3,7 +3,7 @@ template<int M, int N> class GCD { public: - enum { val = (N == 0) ? M : GCD<N, M % N>::val }; // { dg-warning "division" "division" } + enum { val = (N == 0) ? M : GCD<N, M % N>::val }; // { dg-error "constant expression" "valid" { target *-*-* } 6 } // { dg-message "template argument" "valid" { target *-*-* } 6 } }; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C index f3490762621..b44c33d273c 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C @@ -44,16 +44,16 @@ ostream& operator<<(ostream& os, Graph<VertexType,EdgeType>& G) // display of vertices with successors for(int i = 0; i < G.size(); ++i) // { dg-error "no member" } no size function { - os << G[i].first << " <"; // { dg-error "no match" } no index operator + os << G[i].first << " <"; // { dg-error "14:no match" } no index operator // The compiler does not like this line!!!!!! typename Graph<VertexType, EdgeType>::Successor::iterator - startN = G[i].second.begin(), // { dg-error "no match" } no index operator - endN = G[i].second.end(); // { dg-error "no match" } no index operator + startN = G[i].second.begin(), // { dg-error "14:no match" } no index operator + endN = G[i].second.end(); // { dg-error "14:no match" } no index operator while(startN != endN) { - os << G[(*startN).first].first << ' ' // { dg-error "no match" } no index operator + os << G[(*startN).first].first << ' ' // { dg-error "20:no match" } no index operator << (*startN).second << ' '; ++startN; } diff --git a/gcc/testsuite/gcc.c-torture/execute/pr52979-1.x b/gcc/testsuite/gcc.c-torture/execute/pr52979-1.x new file mode 100644 index 00000000000..4efed4c325f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr52979-1.x @@ -0,0 +1,7 @@ +load_lib target-supports.exp + +if { [check_effective_target_int32plus] } { + return 0 +} + +return 1; diff --git a/gcc/testsuite/gcc.c-torture/execute/pr52979-2.x b/gcc/testsuite/gcc.c-torture/execute/pr52979-2.x new file mode 100644 index 00000000000..4efed4c325f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr52979-2.x @@ -0,0 +1,7 @@ +load_lib target-supports.exp + +if { [check_effective_target_int32plus] } { + return 0 +} + +return 1; diff --git a/gcc/testsuite/gcc.dg/binary-constants-2.c b/gcc/testsuite/gcc.dg/binary-constants-2.c index 40d76364656..6c3928aa2a0 100644 --- a/gcc/testsuite/gcc.dg/binary-constants-2.c +++ b/gcc/testsuite/gcc.dg/binary-constants-2.c @@ -2,7 +2,7 @@ /* Origin: Joerg Wunsch <j.gnu@uriah.heep.sax.de>. */ /* { dg-do compile } */ -/* { dg-options "-std=iso9899:1999 -pedantic" } */ +/* { dg-options "-std=iso9899:1999 -pedantic -ftrack-macro-expansion=0" } */ #define FOO 0b1101 diff --git a/gcc/testsuite/gcc.dg/binary-constants-3.c b/gcc/testsuite/gcc.dg/binary-constants-3.c index 984477dca18..410fc4cd725 100644 --- a/gcc/testsuite/gcc.dg/binary-constants-3.c +++ b/gcc/testsuite/gcc.dg/binary-constants-3.c @@ -2,7 +2,7 @@ /* Origin: Joerg Wunsch <j.gnu@uriah.heep.sax.de>. */ /* { dg-do compile } */ -/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors -ftrack-macro-expansion=0" } */ #define FOO 0b1101 diff --git a/gcc/testsuite/gcc.dg/cpp/pr7263-3.c b/gcc/testsuite/gcc.dg/cpp/pr7263-3.c index efa619ad3cd..225b659754c 100644 --- a/gcc/testsuite/gcc.dg/cpp/pr7263-3.c +++ b/gcc/testsuite/gcc.dg/cpp/pr7263-3.c @@ -1,6 +1,6 @@ /* PR 7263: __extension__ keyword doesn't suppress warning on LL or ULL constants. */ /* { dg-do compile } */ -/* { dg-options "-std=c99 -pedantic-errors" } */ +/* { dg-options "-std=c99 -pedantic-errors -ftrack-macro-expansion=0" } */ #include "pr7263-3.h" __complex__ bar () /* { dg-error "ISO C does not support plain .complex. meaning .double complex." } */ { diff --git a/gcc/testsuite/gcc.dg/cpp/syshdr3.c b/gcc/testsuite/gcc.dg/cpp/syshdr3.c new file mode 100644 index 00000000000..15749ff9961 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/syshdr3.c @@ -0,0 +1,16 @@ +/* Contributed by Dodji Seketeli <dodji@redhat.com> */ +/* Origin: PR preprocessor/7263 */ +/* { dg-options "-pedantic -std=c89 -ftrack-macro-expansion=1" } */ +/* { dg-do compile } */ + +/* This tests the proprer suppression of warning coming from macro + defined in system headers and expanded in a non-system header + location. */ +#include "syshdr3.h" + +static _Complex float c = _Complex_I + _Complex_I; /* These macros are defined in + system header so we should + have no warning here. */ +U_LL u = ONE_ULL; /* Likewise here. */ + +unsigned long long v = 1ULL; /* { dg-warning "long long" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/syshdr3.h b/gcc/testsuite/gcc.dg/cpp/syshdr3.h new file mode 100644 index 00000000000..e5d502a24f5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/syshdr3.h @@ -0,0 +1,7 @@ +#pragma GCC system_header + +#define _Complex __complex__ +#define _Complex_I 1.0iF + +#define U_LL unsigned long long +#define ONE_ULL 1ULL diff --git a/gcc/testsuite/gcc.dg/cpp/sysmac1.c b/gcc/testsuite/gcc.dg/cpp/sysmac1.c index fa741a4262d..cc8469e18c7 100644 --- a/gcc/testsuite/gcc.dg/cpp/sysmac1.c +++ b/gcc/testsuite/gcc.dg/cpp/sysmac1.c @@ -1,7 +1,7 @@ /* Copyright (C) 2001 Free Software Foundation, Inc. */ /* { dg-do preprocess } */ -/* { dg-options "-std=gnu99 -pedantic -Wtraditional" } */ +/* { dg-options "-std=gnu99 -pedantic -Wtraditional -ftrack-macro-expansion=0" } */ /* Tests diagnostics are suppressed for some macros defined in system headers. */ diff --git a/gcc/testsuite/gcc.dg/cpp/sysmac2.c b/gcc/testsuite/gcc.dg/cpp/sysmac2.c index 6d493a9ed1b..cdba668a03f 100644 --- a/gcc/testsuite/gcc.dg/cpp/sysmac2.c +++ b/gcc/testsuite/gcc.dg/cpp/sysmac2.c @@ -1,7 +1,7 @@ /* Copyright (C) 2001 Free Software Foundation, Inc. */ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -pedantic -Wtraditional" } */ +/* { dg-options "-std=gnu99 -pedantic -Wtraditional -ftrack-macro-expansion=0" } */ /* Tests diagnostics are suppressed for some macros defined in system headers. */ diff --git a/gcc/testsuite/gcc.dg/nofixed-point-2.c b/gcc/testsuite/gcc.dg/nofixed-point-2.c index 5b2f2095018..8442a1984cf 100644 --- a/gcc/testsuite/gcc.dg/nofixed-point-2.c +++ b/gcc/testsuite/gcc.dg/nofixed-point-2.c @@ -20,10 +20,10 @@ f3 (void) return 0k; /* { dg-error "not supported" "reject fixed-point" } */ } -_Sat -f4 (void) /* { dg-error "not supported" "reject fixed-point" } */ +_Sat /* { dg-error "not supported" "reject fixed-point" } */ +f4 (void) { return 0k; /* { dg-error "not supported" "reject fixed-point" } */ } -/* { dg-error "is used without" "" { target *-*-* } 24 } */ +/* { dg-error "is used without" "" { target *-*-* } 23 } */ diff --git a/gcc/testsuite/gcc.dg/pr52549.c b/gcc/testsuite/gcc.dg/pr52549.c index 89ec2aaf6cc..382f77d0594 100644 --- a/gcc/testsuite/gcc.dg/pr52549.c +++ b/gcc/testsuite/gcc.dg/pr52549.c @@ -1,6 +1,13 @@ /* { dg-do compile } */ +#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ _mark (long obj, int i, char *a) { (char *)&(((long *)(obj)) [i]) - a; } +#elif __SIZEOF_POINTER__ == __SIZEOF_INT__ +_mark (int obj, int i, char *a) +{ + (char *)&(((int *)(obj)) [i]) - a; +} +#endif diff --git a/gcc/testsuite/gcc.dg/pr53352.c b/gcc/testsuite/gcc.dg/pr53352.c new file mode 100644 index 00000000000..171bcd71ec1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr53352.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O1" } */ + +#include <stdlib.h> + +typedef union +{ + struct + { + unsigned char a; + unsigned char b; + unsigned char c; + unsigned char d; + } parts; + unsigned long whole; +} T; + +T *g_t; + +void bar (unsigned long x) +{ + if (x != 0) + abort (); +} + +int main () +{ + T one; + T two; + T tmp1, tmp2; + + one.whole = 0xFFE0E0E0UL; + two.whole = 0xFF000000UL; + tmp1.parts = two.parts; + tmp2.parts = one.parts; + tmp2.parts.c = tmp1.parts.c; + one.parts = tmp2.parts; + + g_t = &one; + bar (0); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/pr53358.c b/gcc/testsuite/gcc.dg/pr53358.c new file mode 100644 index 00000000000..494090a42df --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr53358.c @@ -0,0 +1,22 @@ +/* PR target/53358 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-additional-options "-fpic" { target fpic } } */ +/* { dg-additional-options "-mtune=pentium4" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ + +struct S { unsigned char s, t[17]; }; +int bar (void); + +void +foo (struct S *x) +{ + unsigned char i, z; + if (bar ()) + { + z = bar (); + bar (); + x->s += z; + for (i = 0; i < x->s; i++) + x->t[i] = bar (); + } +} diff --git a/gcc/testsuite/gcc.dg/system-binary-constants-1.c b/gcc/testsuite/gcc.dg/system-binary-constants-1.c new file mode 100644 index 00000000000..921ee208635 --- /dev/null +++ b/gcc/testsuite/gcc.dg/system-binary-constants-1.c @@ -0,0 +1,18 @@ +/* + Origin: Dodji Seketeli <dodji@redhat.com> + { dg-options "-std=iso9899:1999 -pedantic" } + { dg-do compile } + */ + +#include "system-binary-constants-1.h" + +int +foo (void) +{ +#if BINARY_INT_CONSTANT_IN_SYSTEM_HEADER /* A binary constant defined + in system header. No + warning. */ + return 23; +#endif + return 0b1101; /* { dg-warning "binary constants are a GCC extension" } */ +} diff --git a/gcc/testsuite/gcc.dg/system-binary-constants-1.h b/gcc/testsuite/gcc.dg/system-binary-constants-1.h new file mode 100644 index 00000000000..85f291742ff --- /dev/null +++ b/gcc/testsuite/gcc.dg/system-binary-constants-1.h @@ -0,0 +1,3 @@ +#pragma GCC system_header + +#define BINARY_INT_CONSTANT_IN_SYSTEM_HEADER 0b1101 diff --git a/gcc/testsuite/gcc.dg/tm/indirect-2.c b/gcc/testsuite/gcc.dg/tm/indirect-2.c new file mode 100644 index 00000000000..dd7168f0519 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tm/indirect-2.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm" } */ + +void __attribute__((transaction_safe)) +foo(void); + +void __attribute__((transaction_safe)) +set_fn(void) +{ + void __attribute__((transaction_safe)) (*fn)(void); + fn = foo; + fn(); +} + +/* { dg-final { scan-assembler "_ITM_getTMCloneSafe" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr53390.c b/gcc/testsuite/gcc.dg/torture/pr53390.c new file mode 100644 index 00000000000..72a25c52eac --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr53390.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ + +extern unsigned short var1; +extern int var2; + +extern struct { + int f1; + unsigned short *f2; +} *my_table; + +void foo(void) +{ + unsigned short *local_vec + = __builtin_malloc(var1 * var2 * sizeof(unsigned short)); + unsigned short i; + + my_table[0].f2 = __builtin_malloc(var1 * sizeof(unsigned short)); + + for (i = 0; i < var1; ++i) + my_table[0].f2[i] = local_vec[i * var2]; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-18.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-18.c new file mode 100644 index 00000000000..893ab8b703b --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-18.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ + +void foo (int *p, int n) +{ + int i; + for (i = 0; i < n; ++i) + p[i] = 0; +} + +/* { dg-final { scan-tree-dump "generated memset zero" "ldist" } } */ +/* { dg-final { cleanup-tree-dump "ldist" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c new file mode 100644 index 00000000000..f02d83780a6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-vrp1" } */ + +unsigned foo (unsigned i) +{ + if (i == 2) + { + i = i << 2; + if (i != 8) + link_error (); + } + return i; +} +unsigned bar (unsigned i) +{ + if (i == 1 << (sizeof (unsigned) * 8 - 1)) + { + i = i << 1; + if (i != 0) + link_error (); + } + return i; +} +unsigned baz (unsigned i) +{ + i = i & 15; + if (i == 0) + return 0; + i = 1000 - i; + i >>= 1; + i <<= 1; + if (i == 0) + link_error (); + return i; +} + +/* { dg-final { scan-tree-dump-times "Folding predicate" 3 "vrp1" } } */ +/* { dg-final { cleanup-tree-dump "vrp1" } } */ diff --git a/gcc/testsuite/gcc.target/i386/incoming-10.c b/gcc/testsuite/gcc.target/i386/incoming-10.c index 1fb9ef4f0f9..612fa720888 100644 --- a/gcc/testsuite/gcc.target/i386/incoming-10.c +++ b/gcc/testsuite/gcc.target/i386/incoming-10.c @@ -12,7 +12,7 @@ void f() { int i; struct s s; - for (i = 0; i < sizeof(s.x) / sizeof(*s.x); i++) s.x[i] = 0; + for (i = 0; i < sizeof(s.x) / sizeof(*s.x); i++) s.x[i] = 1; g(&s); } diff --git a/gcc/testsuite/gcc.target/i386/incoming-11.c b/gcc/testsuite/gcc.target/i386/incoming-11.c index a7b7db53aa8..a830c96f7d1 100644 --- a/gcc/testsuite/gcc.target/i386/incoming-11.c +++ b/gcc/testsuite/gcc.target/i386/incoming-11.c @@ -10,9 +10,9 @@ int q[100]; void f() { int i; - for (i = 0; i < 100; i++) p[i] = 0; + for (i = 0; i < 100; i++) p[i] = 1; g(); - for (i = 0; i < 100; i++) q[i] = 0; + for (i = 0; i < 100; i++) q[i] = 1; } /* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr46295.c b/gcc/testsuite/gcc.target/i386/pr46295.c index b7fccb7fb34..4ac7c101abb 100644 --- a/gcc/testsuite/gcc.target/i386/pr46295.c +++ b/gcc/testsuite/gcc.target/i386/pr46295.c @@ -9,7 +9,7 @@ void Parse_Vector () EXPRESS Express; int Terms; for (Terms = 0; Terms < 5; Terms++) - Express[Terms] = 0.0; + Express[Terms] = 1.0; Parse_Rel_Factor(Express,&Terms); } diff --git a/gcc/testsuite/gfortran.dg/bessel_7.f90 b/gcc/testsuite/gfortran.dg/bessel_7.f90 index 78f1ff25128..7e63ed1e859 100644 --- a/gcc/testsuite/gfortran.dg/bessel_7.f90 +++ b/gcc/testsuite/gfortran.dg/bessel_7.f90 @@ -16,7 +16,7 @@ implicit none real,parameter :: values(*) = [0.0, 0.5, 1.0, 0.9, 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78] real,parameter :: myeps(size(values)) = epsilon(0.0) & - * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 31, 168 ] + * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 36, 168 ] ! The following is sufficient for me - the values above are a bit ! more tolerant ! * [0, 0, 0, 3, 3, 0, 9, 0, 2, 1, 22, 130 ] diff --git a/gcc/testsuite/gfortran.dg/pr53217.f90 b/gcc/testsuite/gfortran.dg/pr53217.f90 new file mode 100644 index 00000000000..82f34f0646b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr53217.f90 @@ -0,0 +1,28 @@ +! { dg-do compile } +! { dg-options "-O3 -ffast-math" } + +! This tests only for compile-time failure, which formerly occurred +! when statements were emitted out of order, failing verify_ssa. + +MODULE xc_cs1 + INTEGER, PARAMETER :: dp=KIND(0.0D0) + REAL(KIND=dp), PARAMETER :: a = 0.04918_dp, & + c = 0.2533_dp, & + d = 0.349_dp +CONTAINS + SUBROUTINE cs1_u_2 ( rho, grho, r13, e_rho_rho, e_rho_ndrho, e_ndrho_ndrho,& + npoints, error) + REAL(KIND=dp), DIMENSION(*), & + INTENT(INOUT) :: e_rho_rho, e_rho_ndrho, & + e_ndrho_ndrho + DO ip = 1, npoints + IF ( rho(ip) > eps_rho ) THEN + oc = 1.0_dp/(r*r*r3*r3 + c*g*g) + d2rF4 = c4p*f13*f23*g**4*r3/r * (193*d*r**5*r3*r3+90*d*d*r**5*r3 & + -88*g*g*c*r**3*r3-100*d*d*c*g*g*r*r*r3*r3 & + +104*r**6)*od**3*oc**4 + e_rho_rho(ip) = e_rho_rho(ip) + d2F1 + d2rF2 + d2F3 + d2rF4 + END IF + END DO + END SUBROUTINE cs1_u_2 +END MODULE xc_cs1 diff --git a/gcc/testsuite/gnat.dg/lto13.adb b/gcc/testsuite/gnat.dg/lto13.adb new file mode 100644 index 00000000000..7c7fe16043f --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto13.adb @@ -0,0 +1,9 @@ +-- { dg-do link } +-- { dg-options "-g -flto" { target lto } } + +with Lto13_Pkg; use Lto13_Pkg; + +procedure Lto13 is +begin + Proc; +end; diff --git a/gcc/testsuite/gnat.dg/lto13_pkg.adb b/gcc/testsuite/gnat.dg/lto13_pkg.adb new file mode 100644 index 00000000000..f8b5057a15e --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto13_pkg.adb @@ -0,0 +1,10 @@ +package body Lto13_Pkg is + + procedure Proc is + begin + raise Constraint_Error; + end; + + type T is null record; + +end Lto13_Pkg; diff --git a/gcc/testsuite/gnat.dg/lto13_pkg.ads b/gcc/testsuite/gnat.dg/lto13_pkg.ads new file mode 100644 index 00000000000..ce91d1c018c --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto13_pkg.ads @@ -0,0 +1,9 @@ +package Lto13_Pkg is + + procedure Proc; + +private + + type T; + +end Lto13_Pkg; diff --git a/gcc/testsuite/gnat.dg/specs/lto12.ads b/gcc/testsuite/gnat.dg/specs/lto12.ads new file mode 100644 index 00000000000..3914e0f90b3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/lto12.ads @@ -0,0 +1,10 @@ +-- { dg-do compile } +-- { dg-options "-flto" { target lto } } + +with Lto12_Pkg; use Lto12_Pkg; + +package Lto12 is + + C : constant R := F; + +end Lto12; diff --git a/gcc/testsuite/gnat.dg/specs/lto12_pkg.ads b/gcc/testsuite/gnat.dg/specs/lto12_pkg.ads new file mode 100644 index 00000000000..02ee491b5db --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/lto12_pkg.ads @@ -0,0 +1,14 @@ +-- { dg-excess-errors "cannot generate code" } + +package Lto12_Pkg is + + type R (Kind : Boolean := False) is record + case Kind is + when True => I : Integer; + when others => null; + end case; + end record; + + function F return R; + +end Lto12_Pkg; diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index 0a021b421e3..51dd7fe13ed 100644 --- a/gcc/trans-mem.c +++ b/gcc/trans-mem.c @@ -4732,7 +4732,7 @@ ipa_tm_transform_clone (struct cgraph_node *node) /* If this function makes no calls and has no irrevocable blocks, then there's nothing to do. */ /* ??? Remove non-aborting top-level transactions. */ - if (!node->callees && !d->irrevocable_blocks_clone) + if (!node->callees && !node->indirect_calls && !d->irrevocable_blocks_clone) return; current_function_decl = d->clone->symbol.decl; diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 6944fc76e8d..007b8192c66 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -624,46 +624,6 @@ remove_referenced_var (tree var) } -/* Return the virtual variable associated to the non-scalar variable VAR. */ - -tree -get_virtual_var (tree var) -{ - STRIP_NOPS (var); - - if (TREE_CODE (var) == SSA_NAME) - var = SSA_NAME_VAR (var); - - while (TREE_CODE (var) == REALPART_EXPR || TREE_CODE (var) == IMAGPART_EXPR - || handled_component_p (var)) - var = TREE_OPERAND (var, 0); - - /* Treating GIMPLE registers as virtual variables makes no sense. - Also complain if we couldn't extract a _DECL out of the original - expression. */ - gcc_assert (SSA_VAR_P (var)); - gcc_assert (!is_gimple_reg (var)); - - return var; -} - -/* Mark all the naked symbols in STMT for SSA renaming. */ - -void -mark_symbols_for_renaming (gimple stmt) -{ - tree op; - ssa_op_iter iter; - - update_stmt (stmt); - - /* Mark all the operands for renaming. */ - FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_ALL_OPERANDS) - if (DECL_P (op)) - mark_sym_for_renaming (op); -} - - /* If EXP is a handled component reference for a structure, return the base variable. The access range is delimited by bit positions *POFFSET and *POFFSET + *PMAX_SIZE. The access size is *PSIZE bits. If either diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 2846b67a015..faa06ae130d 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -491,10 +491,8 @@ extern void debug_referenced_vars (void); extern void dump_referenced_vars (FILE *); extern void dump_variable (FILE *, tree); extern void debug_variable (tree); -extern tree get_virtual_var (tree); extern bool add_referenced_var (tree); extern void remove_referenced_var (tree); -extern void mark_symbols_for_renaming (gimple); extern tree make_rename_temp (tree, const char *); extern void set_default_def (tree, tree); extern tree gimple_default_def (struct function *, tree); @@ -576,7 +574,6 @@ tree create_new_def_for (tree, gimple, def_operand_p); bool need_ssa_update_p (struct function *); bool name_mappings_registered_p (void); bool name_registered_for_update_p (tree); -bitmap ssa_names_to_replace (void); void release_ssa_name_after_update_ssa (tree); void compute_global_livein (bitmap, bitmap); void mark_sym_for_renaming (tree); diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index c9aaeeeda3a..060b6e5442f 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1921,11 +1921,7 @@ copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb) copy_stmt = gsi_stmt (si); if (!is_gimple_debug (copy_stmt)) - { - update_stmt (copy_stmt); - if (gimple_in_ssa_p (cfun)) - mark_symbols_for_renaming (copy_stmt); - } + update_stmt (copy_stmt); /* Do this before the possible split_block. */ gsi_next (&si); @@ -2397,8 +2393,6 @@ copy_debug_stmt (gimple stmt, copy_body_data *id) processing_debug_stmt = 0; update_stmt (stmt); - if (gimple_in_ssa_p (cfun)) - mark_symbols_for_renaming (stmt); } /* Process deferred debug stmts. In order to give values better odds @@ -2542,7 +2536,6 @@ insert_init_stmt (copy_body_data *id, basic_block bb, gimple init_stmt) } gsi_insert_after (&si, init_stmt, GSI_NEW_STMT); gimple_regimplify_operands (init_stmt, &si); - mark_symbols_for_renaming (init_stmt); if (!is_gimple_debug (init_stmt) && MAY_HAVE_DEBUG_STMTS) { @@ -2707,14 +2700,17 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn, STRIP_USELESS_TYPE_CONVERSION (rhs); - /* We want to use MODIFY_EXPR, not INIT_EXPR here so that we - keep our trees in gimple form. */ - if (def && gimple_in_ssa_p (cfun) && is_gimple_reg (p)) + /* If we are in SSA form properly remap the default definition + or omit the initialization if the parameter is unused. */ + if (gimple_in_ssa_p (cfun) && is_gimple_reg (p)) { - def = remap_ssa_name (def, id); - init_stmt = gimple_build_assign (def, rhs); - SSA_NAME_IS_DEFAULT_DEF (def) = 0; - set_default_def (var, NULL); + if (def) + { + def = remap_ssa_name (def, id); + init_stmt = gimple_build_assign (def, rhs); + SSA_NAME_IS_DEFAULT_DEF (def) = 0; + set_default_def (var, NULL); + } } else init_stmt = gimple_build_assign (var, rhs); @@ -2959,6 +2955,11 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest, TREE_ADDRESSABLE (var) = 1; var = build_fold_addr_expr (var); } + else if (gimple_in_ssa_p (cfun) + && is_gimple_reg (var)) + /* ??? Re-org id->retval and its special handling so that we can + record an SSA name directly and not need to invoke the SSA renamer. */ + mark_sym_for_renaming (var); done: /* Register the VAR_DECL as the equivalent for the RESULT_DECL; that @@ -2974,10 +2975,15 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest, if (gimple_in_ssa_p (id->src_cfun)) add_referenced_var (temp); insert_decl_map (id, result, temp); - /* When RESULT_DECL is in SSA form, we need to use it's default_def - SSA_NAME. */ - if (gimple_in_ssa_p (id->src_cfun) && gimple_default_def (id->src_cfun, result)) - temp = remap_ssa_name (gimple_default_def (id->src_cfun, result), id); + /* When RESULT_DECL is in SSA form, we need to remap and initialize + it's default_def SSA_NAME. */ + if (gimple_in_ssa_p (id->src_cfun) + && is_gimple_reg (result)) + { + temp = make_ssa_name (temp, NULL); + insert_decl_map (id, gimple_default_def (id->src_cfun, result), + temp); + } insert_init_stmt (id, entry_bb, gimple_build_assign (temp, var)); } else @@ -4025,8 +4031,6 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) gimple old_stmt = stmt; stmt = gimple_build_assign (gimple_call_lhs (stmt), use_retvar); gsi_replace (&stmt_gsi, stmt, false); - if (gimple_in_ssa_p (cfun)) - mark_symbols_for_renaming (stmt); maybe_clean_or_replace_eh_stmt (old_stmt, stmt); } else diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c index 6ca52c1f32f..170d8d02311 100644 --- a/gcc/tree-into-ssa.c +++ b/gcc/tree-into-ssa.c @@ -3053,26 +3053,6 @@ name_registered_for_update_p (tree n ATTRIBUTE_UNUSED) } -/* Return the set of all the SSA names marked to be replaced. */ - -bitmap -ssa_names_to_replace (void) -{ - unsigned i = 0; - bitmap ret; - sbitmap_iterator sbi; - - gcc_assert (update_ssa_initialized_fn == NULL - || update_ssa_initialized_fn == cfun); - - ret = BITMAP_ALLOC (NULL); - EXECUTE_IF_SET_IN_SBITMAP (old_ssa_names, 0, i, sbi) - bitmap_set_bit (ret, i); - - return ret; -} - - /* Mark NAME to be released after update_ssa has finished. */ void diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 0d21763c72e..d7506e69b04 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -1131,8 +1131,11 @@ ldist_gen (struct loop *loop, struct graph *rdg, BITMAP_FREE (processed); nbp = VEC_length (bitmap, partitions); - if (nbp <= 1 - || partition_contains_all_rw (rdg, partitions)) + if (nbp == 0 + || (nbp == 1 + && !can_generate_builtin (rdg, VEC_index (bitmap, partitions, 0))) + || (nbp > 1 + && partition_contains_all_rw (rdg, partitions))) goto ldist_done; if (dump_file && (dump_flags & TDF_DETAILS)) diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 18bf645366e..e95bf4cd8b8 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1,8 +1,8 @@ /* Loop autoparallelization. Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. - Contributed by Sebastian Pop <pop@cri.ensmp.fr> and - Zdenek Dvorak <dvorakz@suse.cz>. + Contributed by Sebastian Pop <pop@cri.ensmp.fr> + Zdenek Dvorak <dvorakz@suse.cz> and Razya Ladelsky <razya@il.ibm.com>. This file is part of GCC. @@ -54,9 +54,9 @@ along with GCC; see the file COPYING3. If not see -- if there are several parallelizable loops in a function, it may be possible to generate the threads just once (using synchronization to ensure that cross-loop dependences are obeyed). - -- handling of common scalar dependence patterns (accumulation, ...) - -- handling of non-innermost loops */ - + -- handling of common reduction patterns for outer loops. + + More info can also be found at http://gcc.gnu.org/wiki/AutoParInGCC */ /* Reduction handling: currently we use vect_force_simple_reduction() to detect reduction patterns. @@ -1732,6 +1732,7 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list, unsigned prob; location_t loc; gimple cond_stmt; + unsigned int m_p_thread=2; /* From @@ -1786,15 +1787,31 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list, loop that will be split to loop_fn, the new one will be used for the remaining iterations. */ + /* We should compute a better number-of-iterations value for outer loops. + That is, if we have + + for (i = 0; i < n; ++i) + for (j = 0; j < m; ++j) + ... + + we should compute nit = n * m, not nit = n. + Also may_be_zero handling would need to be adjusted. */ + type = TREE_TYPE (niter->niter); nit = force_gimple_operand (unshare_expr (niter->niter), &stmts, true, NULL_TREE); if (stmts) gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts); - many_iterations_cond = - fold_build2 (GE_EXPR, boolean_type_node, - nit, build_int_cst (type, MIN_PER_THREAD * n_threads)); + if (loop->inner) + m_p_thread=2; + else + m_p_thread=MIN_PER_THREAD; + + many_iterations_cond = + fold_build2 (GE_EXPR, boolean_type_node, + nit, build_int_cst (type, m_p_thread * n_threads)); + many_iterations_cond = fold_build2 (TRUTH_AND_EXPR, boolean_type_node, invert_truthvalue (unshare_expr (niter->may_be_zero)), diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index ec1bbbe0bff..540850fc5cb 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -850,8 +850,7 @@ indirect_ref_may_alias_decl_p (tree ref1 ATTRIBUTE_UNUSED, tree base1, /* If either reference is view-converted, give up now. */ if (same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) != 1 - || same_type_for_tbaa (TREE_TYPE (dbase2), - TREE_TYPE (reference_alias_ptr_type (dbase2))) != 1) + || same_type_for_tbaa (TREE_TYPE (dbase2), TREE_TYPE (base2)) != 1) return true; /* If both references are through the same type, they do not alias diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index f440d174258..9c363931b76 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -2180,32 +2180,6 @@ is_phi_for_stmt (gimple stmt, tree operand) return false; } -/* Remove STMT, unlink its virtual defs, and release its SSA defs. */ - -static inline void -completely_remove_stmt (gimple stmt) -{ - gimple_stmt_iterator gsi = gsi_for_stmt (stmt); - gsi_remove (&gsi, true); - unlink_stmt_vdef (stmt); - release_defs (stmt); -} - -/* If OP is defined by a builtin call that has been absorbed by - reassociation, remove its defining statement completely. */ - -static inline void -remove_def_if_absorbed_call (tree op) -{ - gimple stmt; - - if (TREE_CODE (op) == SSA_NAME - && has_zero_uses (op) - && is_gimple_call ((stmt = SSA_NAME_DEF_STMT (op))) - && gimple_visited_p (stmt)) - completely_remove_stmt (stmt); -} - /* Remove def stmt of VAR if VAR has zero uses and recurse on rhs1 operand if so. */ @@ -2214,7 +2188,6 @@ remove_visited_stmt_chain (tree var) { gimple stmt; gimple_stmt_iterator gsi; - tree var2; while (1) { @@ -2224,65 +2197,15 @@ remove_visited_stmt_chain (tree var) if (is_gimple_assign (stmt) && gimple_visited_p (stmt)) { var = gimple_assign_rhs1 (stmt); - var2 = gimple_assign_rhs2 (stmt); gsi = gsi_for_stmt (stmt); gsi_remove (&gsi, true); release_defs (stmt); - /* A multiply whose operands are both fed by builtin pow/powi - calls must check whether to remove rhs2 as well. */ - remove_def_if_absorbed_call (var2); - } - else if (is_gimple_call (stmt) && gimple_visited_p (stmt)) - { - completely_remove_stmt (stmt); - return; } else return; } } -/* If OP is an SSA name, find its definition and determine whether it - is a call to __builtin_powi. If so, move the definition prior to - STMT. Only do this during early reassociation. */ - -static void -possibly_move_powi (gimple stmt, tree op) -{ - gimple stmt2; - tree fndecl; - gimple_stmt_iterator gsi1, gsi2; - - if (!first_pass_instance - || !flag_unsafe_math_optimizations - || TREE_CODE (op) != SSA_NAME) - return; - - stmt2 = SSA_NAME_DEF_STMT (op); - - if (!is_gimple_call (stmt2) - || !has_single_use (gimple_call_lhs (stmt2))) - return; - - fndecl = gimple_call_fndecl (stmt2); - - if (!fndecl - || DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL) - return; - - switch (DECL_FUNCTION_CODE (fndecl)) - { - CASE_FLT_FN (BUILT_IN_POWI): - break; - default: - return; - } - - gsi1 = gsi_for_stmt (stmt); - gsi2 = gsi_for_stmt (stmt2); - gsi_move_before (&gsi2, &gsi1); -} - /* This function checks three consequtive operands in passed operands vector OPS starting from OPINDEX and swaps two operands if it is profitable for binary operation @@ -2387,9 +2310,6 @@ rewrite_expr_tree (gimple stmt, unsigned int opindex, fprintf (dump_file, " into "); print_gimple_stmt (dump_file, stmt, 0, 0); } - - possibly_move_powi (stmt, oe1->op); - possibly_move_powi (stmt, oe2->op); } return; } @@ -2435,8 +2355,6 @@ rewrite_expr_tree (gimple stmt, unsigned int opindex, fprintf (dump_file, " into "); print_gimple_stmt (dump_file, stmt, 0, 0); } - - possibly_move_powi (stmt, oe->op); } /* Recurse on the LHS of the binary operator, which is guaranteed to be the non-leaf side. */ @@ -2610,9 +2528,6 @@ rewrite_expr_tree_parallel (gimple stmt, int width, fprintf (dump_file, " into "); print_gimple_stmt (dump_file, stmts[i], 0, 0); } - - possibly_move_powi (stmts[i], op1); - possibly_move_powi (stmts[i], op2); } remove_visited_stmt_chain (last_rhs1); @@ -3188,11 +3103,10 @@ get_reassoc_pow_ssa_name (tree *target, tree type) /* Look for repeated operands in OPS in the multiply tree rooted at STMT. Replace them with an optimal sequence of multiplies and powi - builtin calls, and remove the used operands from OPS. Push new - SSA names onto OPS that represent the introduced multiplies and - builtin calls. */ + builtin calls, and remove the used operands from OPS. Return an + SSA name representing the value of the replacement sequence. */ -static void +static tree attempt_builtin_powi (gimple stmt, VEC(operand_entry_t, heap) **ops, tree *target) { @@ -3201,6 +3115,7 @@ attempt_builtin_powi (gimple stmt, VEC(operand_entry_t, heap) **ops, operand_entry_t oe; repeat_factor_t rf1, rf2; repeat_factor rfnew; + tree result = NULL_TREE; tree target_ssa, iter_result; tree type = TREE_TYPE (gimple_get_lhs (stmt)); tree powi_fndecl = mathfn_built_in (type, BUILT_IN_POWI); @@ -3210,7 +3125,7 @@ attempt_builtin_powi (gimple stmt, VEC(operand_entry_t, heap) **ops, /* Nothing to do if BUILT_IN_POWI doesn't exist for this type and target. */ if (!powi_fndecl) - return; + return NULL_TREE; /* Allocate the repeated factor vector. */ repeat_factor_vec = VEC_alloc (repeat_factor, heap, 10); @@ -3324,8 +3239,6 @@ attempt_builtin_powi (gimple stmt, VEC(operand_entry_t, heap) **ops, power)); gimple_call_set_lhs (pow_stmt, iter_result); gimple_set_location (pow_stmt, gimple_location (stmt)); - /* Temporarily place the call; we will move it to the - correct place during rewrite_expr. */ gsi_insert_before (&gsi, pow_stmt, GSI_SAME_STMT); if (dump_file && (dump_flags & TDF_DETAILS)) @@ -3430,8 +3343,20 @@ attempt_builtin_powi (gimple stmt, VEC(operand_entry_t, heap) **ops, gsi_insert_before (&gsi, pow_stmt, GSI_SAME_STMT); } - /* Append the result of this iteration to the ops vector. */ - add_to_ops_vec (ops, iter_result); + /* If we previously formed at least one other builtin_powi call, + form the product of this one and those others. */ + if (result) + { + tree new_result = get_reassoc_pow_ssa_name (target, type); + mul_stmt = gimple_build_assign_with_ops (MULT_EXPR, new_result, + result, iter_result); + gimple_set_location (mul_stmt, gimple_location (stmt)); + gsi_insert_before (&gsi, mul_stmt, GSI_SAME_STMT); + gimple_set_visited (mul_stmt, true); + result = new_result; + } + else + result = iter_result; /* Decrement the occurrence count of each element in the product by the count found above, and remove this many copies of each @@ -3472,6 +3397,59 @@ attempt_builtin_powi (gimple stmt, VEC(operand_entry_t, heap) **ops, clean up. */ VEC_qsort (operand_entry_t, *ops, sort_by_operand_rank); VEC_free (repeat_factor, heap, repeat_factor_vec); + + /* Return the final product computed herein. Note that there may + still be some elements with single occurrence count left in OPS; + those will be handled by the normal reassociation logic. */ + return result; +} + +/* Transform STMT at *GSI into a copy by replacing its rhs with NEW_RHS. */ + +static void +transform_stmt_to_copy (gimple_stmt_iterator *gsi, gimple stmt, tree new_rhs) +{ + tree rhs1; + + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "Transforming "); + print_gimple_stmt (dump_file, stmt, 0, 0); + } + + rhs1 = gimple_assign_rhs1 (stmt); + gimple_assign_set_rhs_from_tree (gsi, new_rhs); + update_stmt (stmt); + remove_visited_stmt_chain (rhs1); + + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, " into "); + print_gimple_stmt (dump_file, stmt, 0, 0); + } +} + +/* Transform STMT at *GSI into a multiply of RHS1 and RHS2. */ + +static void +transform_stmt_to_multiply (gimple_stmt_iterator *gsi, gimple stmt, + tree rhs1, tree rhs2) +{ + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "Transforming "); + print_gimple_stmt (dump_file, stmt, 0, 0); + } + + gimple_assign_set_rhs_with_ops_1 (gsi, MULT_EXPR, rhs1, rhs2, NULL_TREE); + update_stmt (gsi_stmt (*gsi)); + remove_visited_stmt_chain (rhs1); + + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, " into "); + print_gimple_stmt (dump_file, stmt, 0, 0); + } } /* Reassociate expressions in basic block BB and its post-dominator as @@ -3544,6 +3522,7 @@ reassociate_bb (basic_block bb) if (associative_tree_code (rhs_code)) { VEC(operand_entry_t, heap) *ops = NULL; + tree powi_result = NULL_TREE; /* There may be no immediate uses left by the time we get here because we may have eliminated them all. */ @@ -3567,28 +3546,21 @@ reassociate_bb (basic_block bb) if (first_pass_instance && rhs_code == MULT_EXPR && flag_unsafe_math_optimizations) - attempt_builtin_powi (stmt, &ops, &target); + powi_result = attempt_builtin_powi (stmt, &ops, &target); - if (VEC_length (operand_entry_t, ops) == 1) + /* If the operand vector is now empty, all operands were + consumed by the __builtin_powi optimization. */ + if (VEC_length (operand_entry_t, ops) == 0) + transform_stmt_to_copy (&gsi, stmt, powi_result); + else if (VEC_length (operand_entry_t, ops) == 1) { - if (dump_file && (dump_flags & TDF_DETAILS)) - { - fprintf (dump_file, "Transforming "); - print_gimple_stmt (dump_file, stmt, 0, 0); - } - - rhs1 = gimple_assign_rhs1 (stmt); - gimple_assign_set_rhs_from_tree (&gsi, - VEC_last (operand_entry_t, - ops)->op); - update_stmt (stmt); - remove_visited_stmt_chain (rhs1); - - if (dump_file && (dump_flags & TDF_DETAILS)) - { - fprintf (dump_file, " into "); - print_gimple_stmt (dump_file, stmt, 0, 0); - } + tree last_op = VEC_last (operand_entry_t, ops)->op; + + if (powi_result) + transform_stmt_to_multiply (&gsi, stmt, last_op, + powi_result); + else + transform_stmt_to_copy (&gsi, stmt, last_op); } else { @@ -3605,6 +3577,24 @@ reassociate_bb (basic_block bb) rewrite_expr_tree_parallel (stmt, width, ops); else rewrite_expr_tree (stmt, 0, ops, false); + + /* If we combined some repeated factors into a + __builtin_powi call, multiply that result by the + reassociated operands. */ + if (powi_result) + { + gimple mul_stmt; + tree type = TREE_TYPE (gimple_get_lhs (stmt)); + tree target_ssa = get_reassoc_pow_ssa_name (&target, + type); + gimple_set_lhs (stmt, target_ssa); + update_stmt (stmt); + mul_stmt = gimple_build_assign_with_ops (MULT_EXPR, lhs, + powi_result, + target_ssa); + gimple_set_location (mul_stmt, gimple_location (stmt)); + gsi_insert_after (&gsi, mul_stmt, GSI_NEW_STMT); + } } VEC_free (operand_entry_t, heap, ops); diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index c8882ae39d4..a5ed0533db6 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -824,6 +824,11 @@ vect_compute_data_ref_alignment (struct data_reference *dr) /* Initialize misalignment to unknown. */ SET_DR_MISALIGNMENT (dr, -1); + /* Strided loads perform only component accesses, misalignment information + is irrelevant for them. */ + if (STMT_VINFO_STRIDE_LOAD_P (stmt_info)) + return true; + misalign = DR_INIT (dr); aligned_to = DR_ALIGNED_TO (dr); base_addr = DR_BASE_ADDRESS (dr); diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index ac2eb767cf9..f0bb2416cbf 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -489,8 +489,7 @@ LOOP-> loop1 static void slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop, - bool is_new_loop, basic_block *new_exit_bb, - bitmap *defs) + bool is_new_loop, basic_block *new_exit_bb) { gimple orig_phi, new_phi; gimple update_phi, update_phi2; @@ -586,7 +585,6 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop, gcc_assert (get_current_def (current_new_name) == NULL_TREE); set_current_def (current_new_name, PHI_RESULT (new_phi)); - bitmap_set_bit (*defs, SSA_NAME_VERSION (current_new_name)); } } @@ -1159,7 +1157,6 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loop *new_loop = NULL, *first_loop, *second_loop; edge skip_e; tree pre_condition = NULL_TREE; - bitmap definitions; basic_block bb_before_second_loop, bb_after_second_loop; basic_block bb_before_first_loop; basic_block bb_between_loops; @@ -1172,12 +1169,6 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, if (!slpeel_can_duplicate_loop_p (loop, e)) return NULL; - /* We have to initialize cfg_hooks. Then, when calling - cfg_hooks->split_edge, the function tree_split_edge - is actually called and, when calling cfg_hooks->duplicate_block, - the function tree_duplicate_bb is called. */ - gimple_register_cfg_hooks (); - /* If the loop has a virtual PHI, but exit bb doesn't, create a virtual PHI in the exit bb and rename all the uses after the loop. This simplifies the *guard[12] routines, which assume loop closed SSA form for all PHIs @@ -1259,7 +1250,6 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, second_loop = loop; } - definitions = ssa_names_to_replace (); slpeel_update_phis_for_duplicate_loop (loop, new_loop, e == exit_e); rename_variables_in_loop (new_loop); @@ -1397,7 +1387,7 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, bb_before_second_loop, bb_before_first_loop); slpeel_update_phi_nodes_for_guard1 (skip_e, first_loop, first_loop == new_loop, - &new_exit_bb, &definitions); + &new_exit_bb); /* 3. Add the guard that controls whether the second loop is executed. @@ -1441,7 +1431,6 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, if (update_first_loop_count) slpeel_make_loop_iterate_ntimes (first_loop, *first_niters); - BITMAP_FREE (definitions); delete_update_ssa (); adjust_vec_debug_stmts (); diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 72c647fca4a..4dc942cc388 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -2403,6 +2403,7 @@ extract_range_from_binary_expr_1 (value_range_t *vr, && code != ROUND_DIV_EXPR && code != TRUNC_MOD_EXPR && code != RSHIFT_EXPR + && code != LSHIFT_EXPR && code != MIN_EXPR && code != MAX_EXPR && code != BIT_AND_EXPR @@ -2596,6 +2597,40 @@ extract_range_from_binary_expr_1 (value_range_t *vr, extract_range_from_multiplicative_op_1 (vr, code, &vr0, &vr1); return; } + else if (code == LSHIFT_EXPR) + { + /* If we have a LSHIFT_EXPR with any shift values outside [0..prec-1], + then drop to VR_VARYING. Outside of this range we get undefined + behavior from the shift operation. We cannot even trust + SHIFT_COUNT_TRUNCATED at this stage, because that applies to rtl + shifts, and the operation at the tree level may be widened. */ + if (vr1.type != VR_RANGE + || !value_range_nonnegative_p (&vr1) + || TREE_CODE (vr1.max) != INTEGER_CST + || compare_tree_int (vr1.max, TYPE_PRECISION (expr_type) - 1) == 1) + { + set_value_range_to_varying (vr); + return; + } + + /* We can map shifts by constants to MULT_EXPR handling. */ + if (range_int_cst_singleton_p (&vr1)) + { + value_range_t vr1p = { VR_RANGE, NULL_TREE, NULL_TREE, NULL }; + vr1p.min + = double_int_to_tree (expr_type, + double_int_lshift (double_int_one, + TREE_INT_CST_LOW (vr1.min), + TYPE_PRECISION (expr_type), + false)); + vr1p.max = vr1p.min; + extract_range_from_multiplicative_op_1 (vr, MULT_EXPR, &vr0, &vr1p); + return; + } + + set_value_range_to_varying (vr); + return; + } else if (code == TRUNC_DIV_EXPR || code == FLOOR_DIV_EXPR || code == CEIL_DIV_EXPR diff --git a/gcc/tree.h b/gcc/tree.h index 419d8f4e638..cc9d4fbe5d9 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1684,7 +1684,7 @@ struct GTY(()) tree_constructor { decls and constants can be shared among multiple locations, so return nothing. */ #define EXPR_LOCATION(NODE) \ - (EXPR_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION) + (CAN_HAVE_LOCATION_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION) #define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS) #define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION) #define EXPR_LOC_OR_HERE(NODE) (EXPR_HAS_LOCATION (NODE) ? (NODE)->exp.locus : input_location) diff --git a/gcc/varpool.c b/gcc/varpool.c index ef025670125..ceb16f9bbca 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -59,6 +59,14 @@ void varpool_remove_node (struct varpool_node *node) { symtab_unregister_node ((symtab_node)node); + if (DECL_INITIAL (node->symbol.decl) + && !DECL_IN_CONSTANT_POOL (node->symbol.decl) + /* Keep vtables for BINFO folding. */ + && !DECL_VIRTUAL_P (node->symbol.decl) + /* dbxout output constant initializers for readonly vars. */ + && (!host_integerp (DECL_INITIAL (node->symbol.decl), 0) + || !TREE_READONLY (node->symbol.decl))) + DECL_INITIAL (node->symbol.decl) = error_mark_node; ggc_free (node); } @@ -118,17 +126,17 @@ varpool_node_for_asm (tree asmname) bool decide_is_variable_needed (struct varpool_node *node, tree decl) { + if (DECL_EXTERNAL (decl)) + return false; + /* If the user told us it is used, then it must be so. */ if (node->symbol.force_output) return true; - gcc_assert (!DECL_EXTERNAL (decl)); - /* Externally visible variables must be output. The exception is COMDAT variables that must be output only when they are needed. */ if (TREE_PUBLIC (decl) - && !DECL_COMDAT (decl) - && !DECL_EXTERNAL (decl)) + && !DECL_COMDAT (decl)) return true; return false; @@ -348,7 +356,8 @@ varpool_remove_unreferenced_decls (void) && (!varpool_can_remove_if_no_refs (node) /* We just expanded all function bodies. See if any of them needed the variable. */ - || DECL_RTL_SET_P (node->symbol.decl))) + || (!DECL_EXTERNAL (node->symbol.decl) + && DECL_RTL_SET_P (node->symbol.decl)))) { enqueue_node (node, &first); if (cgraph_dump_file) @@ -372,6 +381,8 @@ varpool_remove_unreferenced_decls (void) } for (i = 0; ipa_ref_list_reference_iterate (&node->symbol.ref_list, i, ref); i++) if (symtab_variable_p (ref->referred) + && (!DECL_EXTERNAL (ref->referred->symbol.decl) + || varpool (ref->referred)->alias) && varpool (ref->referred)->analyzed) enqueue_node (varpool (ref->referred), &first); } diff --git a/include/ChangeLog b/include/ChangeLog index 48981996dd4..c3f823857f1 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2012-05-19 Gary Funck <gary@intrepid.com> + + * dwarf2.def: Update comment re: UPC extensions to reference + DWARF4 specification. + 2012-05-02 Cary Coutant <ccoutant@google.com> * dwarf2.def: Remove DW_FORM_GNU_ref_index, diff --git a/include/dwarf2.def b/include/dwarf2.def index e36ae919b2a..870aecdaa54 100644 --- a/include/dwarf2.def +++ b/include/dwarf2.def @@ -167,7 +167,7 @@ DW_TAG (DW_TAG_GNU_formal_parameter_pack, 0x4108) are properly part of DWARF 5. */ DW_TAG (DW_TAG_GNU_call_site, 0x4109) DW_TAG (DW_TAG_GNU_call_site_parameter, 0x410a) -/* Extensions for UPC. See: http://upc.gwu.edu/~upc. */ +/* Extensions for UPC. See: http://dwarfstd.org/doc/DWARF4.pdf. */ DW_TAG (DW_TAG_upc_shared_type, 0x8765) DW_TAG (DW_TAG_upc_strict_type, 0x8766) DW_TAG (DW_TAG_upc_relaxed_type, 0x8767) diff --git a/libatomic/ChangeLog b/libatomic/ChangeLog index 21e17ccfe65..4f170244a2e 100644 --- a/libatomic/ChangeLog +++ b/libatomic/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-05-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> PR other/53284 diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in index 1a134f6cd40..de6934859f3 100644 --- a/libatomic/Makefile.in +++ b/libatomic/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +16,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -89,6 +106,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(toolexeclibdir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) am_libatomic_la_OBJECTS = gload.lo gstore.lo gcas.lo gexch.lo \ @@ -124,6 +147,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -136,9 +164,11 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -167,6 +197,8 @@ am__relativize = \ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -353,7 +385,7 @@ all: auto-config.h .SUFFIXES: .SUFFIXES: .c .lo .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -389,10 +421,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): auto-config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/auto-config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -406,7 +436,6 @@ distclean-hdr: -rm -f auto-config.h stamp-h1 install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -414,6 +443,8 @@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \ } @@ -435,7 +466,7 @@ clean-toolexeclibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libatomic.la: $(libatomic_la_OBJECTS) $(libatomic_la_DEPENDENCIES) +libatomic.la: $(libatomic_la_OBJECTS) $(libatomic_la_DEPENDENCIES) $(EXTRA_libatomic_la_DEPENDENCIES) $(libatomic_la_LINK) -rpath $(toolexeclibdir) $(libatomic_la_OBJECTS) $(libatomic_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -668,13 +699,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -706,7 +734,11 @@ dist-gzip: distdir $(am__remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir @@ -714,7 +746,7 @@ dist-lzma: distdir $(am__remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir @@ -745,6 +777,8 @@ distcheck: dist bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ @@ -764,6 +798,7 @@ distcheck: dist && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -792,8 +827,16 @@ distcheck: dist list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -827,10 +870,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -925,22 +973,22 @@ uninstall-am: uninstall-toolexeclibLTLIBRARIES all all-am all-multi am--refresh check check-am clean \ clean-generic clean-libtool clean-multi \ clean-toolexeclibLTLIBRARIES ctags ctags-recursive dist \ - dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-multi distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-multi install-pdf install-pdf-am install-ps \ - install-ps-am install-strip install-toolexeclibLTLIBRARIES \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-multi mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-multi pdf \ - pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-toolexeclibLTLIBRARIES + dist-all dist-bzip2 dist-gzip dist-lzip dist-lzma dist-shar \ + dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-multi distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-multi install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + install-toolexeclibLTLIBRARIES installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-multi mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + mostlyclean-multi pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-toolexeclibLTLIBRARIES vpath % $(strip $(search_path)) diff --git a/libatomic/aclocal.m4 b/libatomic/aclocal.m4 index 48f5ef54fa4..c0f8ca1bd84 100644 --- a/libatomic/aclocal.m4 +++ b/libatomic/aclocal.m4 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,12 +20,15 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,7 +54,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -79,12 +83,14 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -166,14 +172,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -213,6 +219,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -277,7 +284,7 @@ AC_CACHE_CHECK([dependency style of $depcc], break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -342,10 +349,13 @@ AC_DEFUN([AM_DEP_TRACK], if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -567,12 +577,15 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -591,8 +604,8 @@ AC_SUBST(install_sh)]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -612,7 +625,7 @@ AC_DEFUN([AM_MAINTAINER_MODE], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful @@ -723,12 +736,15 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -751,13 +767,14 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -765,13 +782,13 @@ AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -847,12 +864,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -875,13 +894,13 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -890,13 +909,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -918,10 +937,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) diff --git a/libatomic/configure b/libatomic/configure index a3b819d0032..9a7e5a53c04 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -6524,7 +6524,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -11008,7 +11015,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11011 "configure" +#line 11018 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11114,7 +11121,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11117 "configure" +#line 11124 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefile.in index 30d2a0fb019..f9467c6a873 100644 --- a/libatomic/testsuite/Makefile.in +++ b/libatomic/testsuite/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -55,6 +72,11 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac DEJATOOL = $(PACKAGE) RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 07ef2437834..842f834aff1 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,18 @@ +2012-05-16 Dodji Seketeli <dodji@redhat.com> + + PR preprocessor/7263 + * include/cpplib.h (cpp_classify_number): Take a location + parameter. + * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic + macros that take a location parameter. + (cpp_classify_number): Take a (virtual) location parameter. Use + it for diagnostics. Adjust comments. + (eval_token): Take a location parameter. Pass it to + cpp_classify_number and to diagnostic routines. + (_cpp_parse_expr): Use virtual locations of tokens when parsing + expressions. Pass a virtual location to eval_token and to + diagnostic routines. + 2012-05-10 Tristan Gingold <gingold@adacore.com> * expr.c (interpret_float_suffix): Add a guard. diff --git a/libcpp/expr.c b/libcpp/expr.c index ca1c3d1928a..cd6e7d4eca6 100644 --- a/libcpp/expr.c +++ b/libcpp/expr.c @@ -59,7 +59,7 @@ static cpp_num num_rshift (cpp_num, size_t, size_t); static cpp_num append_digit (cpp_num, int, int, size_t); static cpp_num parse_defined (cpp_reader *); -static cpp_num eval_token (cpp_reader *, const cpp_token *); +static cpp_num eval_token (cpp_reader *, const cpp_token *, source_location); static struct op *reduce (cpp_reader *, struct op *, enum cpp_ttype); static unsigned int interpret_float_suffix (const uchar *, size_t); static unsigned int interpret_int_suffix (const uchar *, size_t); @@ -76,6 +76,12 @@ static void check_promotion (cpp_reader *, const struct op *); #define SYNTAX_ERROR2(msgid, arg) \ do { cpp_error (pfile, CPP_DL_ERROR, msgid, arg); goto syntax_error; } \ while(0) +#define SYNTAX_ERROR_AT(loc, msgid) \ + do { cpp_error_with_line (pfile, CPP_DL_ERROR, (loc), 0, msgid); goto syntax_error; } \ + while(0) +#define SYNTAX_ERROR2_AT(loc, msgid, arg) \ + do { cpp_error_with_line (pfile, CPP_DL_ERROR, (loc), 0, msgid, arg); goto syntax_error; } \ + while(0) /* Subroutine of cpp_classify_number. S points to a float suffix of length LEN, possibly zero. Returns 0 for an invalid suffix, or a @@ -359,11 +365,18 @@ cpp_get_userdef_suffix (const cpp_token *tok) /* Categorize numeric constants according to their field (integer, floating point, or invalid), radix (decimal, octal, hexadecimal), - and type suffixes. In C++0X if UD_SUFFIX is non null it will be - assigned any unrecognized suffix for a user-defined literal. */ + and type suffixes. + + TOKEN is the token that represents the numeric constant to + classify. + + In C++0X if UD_SUFFIX is non null it will be assigned + any unrecognized suffix for a user-defined literal. + + VIRTUAL_LOCATION is the virtual location for TOKEN. */ unsigned int cpp_classify_number (cpp_reader *pfile, const cpp_token *token, - const char **ud_suffix) + const char **ud_suffix, source_location virtual_location) { const uchar *str = token->val.str.text; const uchar *limit; @@ -422,7 +435,8 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, if (float_flag == NOT_FLOAT) float_flag = AFTER_POINT; else - SYNTAX_ERROR ("too many decimal points in number"); + SYNTAX_ERROR_AT (virtual_location, + "too many decimal points in number"); } else if ((radix <= 10 && (c == 'e' || c == 'E')) || (radix == 16 && (c == 'p' || c == 'P'))) @@ -450,8 +464,8 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, radix = 10; if (CPP_PEDANTIC (pfile)) - cpp_error (pfile, CPP_DL_PEDWARN, - "fixed-point constants are a GCC extension"); + cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0, + "fixed-point constants are a GCC extension"); goto syntax_ok; } else @@ -464,26 +478,29 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, if (max_digit >= radix) { if (radix == 2) - SYNTAX_ERROR2 ("invalid digit \"%c\" in binary constant", '0' + max_digit); + SYNTAX_ERROR2_AT (virtual_location, + "invalid digit \"%c\" in binary constant", '0' + max_digit); else - SYNTAX_ERROR2 ("invalid digit \"%c\" in octal constant", '0' + max_digit); + SYNTAX_ERROR2_AT (virtual_location, + "invalid digit \"%c\" in octal constant", '0' + max_digit); } if (float_flag != NOT_FLOAT) { if (radix == 2) { - cpp_error (pfile, CPP_DL_ERROR, - "invalid prefix \"0b\" for floating constant"); + cpp_error_with_line (pfile, CPP_DL_ERROR, virtual_location, 0, + "invalid prefix \"0b\" for floating constant"); return CPP_N_INVALID; } if (radix == 16 && !seen_digit) - SYNTAX_ERROR ("no digits in hexadecimal floating constant"); + SYNTAX_ERROR_AT (virtual_location, + "no digits in hexadecimal floating constant"); if (radix == 16 && CPP_PEDANTIC (pfile) && !CPP_OPTION (pfile, c99)) - cpp_error (pfile, CPP_DL_PEDWARN, - "use of C99 hexadecimal floating constant"); + cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0, + "use of C99 hexadecimal floating constant"); if (float_flag == AFTER_EXPON) { @@ -492,14 +509,15 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, /* Exponent is decimal, even if string is a hex float. */ if (!ISDIGIT (*str)) - SYNTAX_ERROR ("exponent has no digits"); + SYNTAX_ERROR_AT (virtual_location, "exponent has no digits"); do str++; while (ISDIGIT (*str)); } else if (radix == 16) - SYNTAX_ERROR ("hexadecimal floating constants require an exponent"); + SYNTAX_ERROR_AT (virtual_location, + "hexadecimal floating constants require an exponent"); result = interpret_float_suffix (str, limit - str); if (result == 0) @@ -512,9 +530,9 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, } else { - cpp_error (pfile, CPP_DL_ERROR, - "invalid suffix \"%.*s\" on floating constant", - (int) (limit - str), str); + cpp_error_with_line (pfile, CPP_DL_ERROR, virtual_location, 0, + "invalid suffix \"%.*s\" on floating constant", + (int) (limit - str), str); return CPP_N_INVALID; } } @@ -523,33 +541,33 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, if (limit != str && CPP_WTRADITIONAL (pfile) && ! cpp_sys_macro_p (pfile)) - cpp_warning (pfile, CPP_W_TRADITIONAL, - "traditional C rejects the \"%.*s\" suffix", - (int) (limit - str), str); + cpp_warning_with_line (pfile, CPP_W_TRADITIONAL, virtual_location, 0, + "traditional C rejects the \"%.*s\" suffix", + (int) (limit - str), str); /* A suffix for double is a GCC extension via decimal float support. If the suffix also specifies an imaginary value we'll catch that later. */ if ((result == CPP_N_MEDIUM) && CPP_PEDANTIC (pfile)) - cpp_error (pfile, CPP_DL_PEDWARN, - "suffix for double constant is a GCC extension"); + cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0, + "suffix for double constant is a GCC extension"); /* Radix must be 10 for decimal floats. */ if ((result & CPP_N_DFLOAT) && radix != 10) { - cpp_error (pfile, CPP_DL_ERROR, - "invalid suffix \"%.*s\" with hexadecimal floating constant", - (int) (limit - str), str); + cpp_error_with_line (pfile, CPP_DL_ERROR, virtual_location, 0, + "invalid suffix \"%.*s\" with hexadecimal floating constant", + (int) (limit - str), str); return CPP_N_INVALID; } if ((result & (CPP_N_FRACT | CPP_N_ACCUM)) && CPP_PEDANTIC (pfile)) - cpp_error (pfile, CPP_DL_PEDWARN, - "fixed-point constants are a GCC extension"); + cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0, + "fixed-point constants are a GCC extension"); if ((result & CPP_N_DFLOAT) && CPP_PEDANTIC (pfile)) - cpp_error (pfile, CPP_DL_PEDWARN, - "decimal float constants are a GCC extension"); + cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0, + "decimal float constants are a GCC extension"); result |= CPP_N_FLOATING; } @@ -566,9 +584,9 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, } else { - cpp_error (pfile, CPP_DL_ERROR, - "invalid suffix \"%.*s\" on integer constant", - (int) (limit - str), str); + cpp_error_with_line (pfile, CPP_DL_ERROR, virtual_location, 0, + "invalid suffix \"%.*s\" on integer constant", + (int) (limit - str), str); return CPP_N_INVALID; } } @@ -582,9 +600,10 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, && CPP_OPTION (pfile, cpp_warn_long_long); if (u_or_i || large) - cpp_warning (pfile, large ? CPP_W_LONG_LONG : CPP_W_TRADITIONAL, - "traditional C rejects the \"%.*s\" suffix", - (int) (limit - str), str); + cpp_warning_with_line (pfile, large ? CPP_W_LONG_LONG : CPP_W_TRADITIONAL, + virtual_location, 0, + "traditional C rejects the \"%.*s\" suffix", + (int) (limit - str), str); } if ((result & CPP_N_WIDTH) == CPP_N_LARGE @@ -595,9 +614,11 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, : N_("use of C99 long long integer constant"); if (CPP_OPTION (pfile, c99)) - cpp_warning (pfile, CPP_W_LONG_LONG, message); + cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location, + 0, message); else - cpp_pedwarning (pfile, CPP_W_LONG_LONG, message); + cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG, + virtual_location, 0, message); } result |= CPP_N_INTEGER; @@ -605,11 +626,11 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token, syntax_ok: if ((result & CPP_N_IMAGINARY) && CPP_PEDANTIC (pfile)) - cpp_error (pfile, CPP_DL_PEDWARN, - "imaginary constants are a GCC extension"); + cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0, + "imaginary constants are a GCC extension"); if (radix == 2 && CPP_PEDANTIC (pfile)) - cpp_error (pfile, CPP_DL_PEDWARN, - "binary constants are a GCC extension"); + cpp_error_with_line (pfile, CPP_DL_PEDWARN, virtual_location, 0, + "binary constants are a GCC extension"); if (radix == 10) result |= CPP_N_DECIMAL; @@ -897,7 +918,8 @@ parse_defined (cpp_reader *pfile) number or character constant, or the result of the "defined" or "#" operators). */ static cpp_num -eval_token (cpp_reader *pfile, const cpp_token *token) +eval_token (cpp_reader *pfile, const cpp_token *token, + source_location virtual_location) { cpp_num result; unsigned int temp; @@ -909,21 +931,21 @@ eval_token (cpp_reader *pfile, const cpp_token *token) switch (token->type) { case CPP_NUMBER: - temp = cpp_classify_number (pfile, token, NULL); + temp = cpp_classify_number (pfile, token, NULL, virtual_location); if (temp & CPP_N_USERDEF) cpp_error (pfile, CPP_DL_ERROR, "user-defined literal in preprocessor expression"); switch (temp & CPP_N_CATEGORY) { case CPP_N_FLOATING: - cpp_error (pfile, CPP_DL_ERROR, - "floating constant in preprocessor expression"); + cpp_error_with_line (pfile, CPP_DL_ERROR, virtual_location, 0, + "floating constant in preprocessor expression"); break; case CPP_N_INTEGER: if (!(temp & CPP_N_IMAGINARY)) return cpp_interpret_integer (pfile, token, temp); - cpp_error (pfile, CPP_DL_ERROR, - "imaginary number in preprocessor expression"); + cpp_error_with_line (pfile, CPP_DL_ERROR, virtual_location, 0, + "imaginary number in preprocessor expression"); break; case CPP_N_INVALID: @@ -970,8 +992,9 @@ eval_token (cpp_reader *pfile, const cpp_token *token) result.high = 0; result.low = 0; if (CPP_OPTION (pfile, warn_undef) && !pfile->state.skip_eval) - cpp_warning (pfile, CPP_W_UNDEF, "\"%s\" is not defined", - NODE_NAME (token->val.node.node)); + cpp_warning_with_line (pfile, CPP_W_UNDEF, virtual_location, 0, + "\"%s\" is not defined", + NODE_NAME (token->val.node.node)); } break; @@ -981,11 +1004,12 @@ eval_token (cpp_reader *pfile, const cpp_token *token) /* A pedantic warning takes precedence over a deprecated warning here. */ if (CPP_PEDANTIC (pfile)) - cpp_error (pfile, CPP_DL_PEDWARN, - "assertions are a GCC extension"); + cpp_error_with_line (pfile, CPP_DL_PEDWARN, + virtual_location, 0, + "assertions are a GCC extension"); else if (CPP_OPTION (pfile, cpp_warn_deprecated)) - cpp_warning (pfile, CPP_W_DEPRECATED, - "assertions are a deprecated extension"); + cpp_warning_with_line (pfile, CPP_W_DEPRECATED, virtual_location, 0, + "assertions are a deprecated extension"); } _cpp_test_assertion (pfile, &temp); result.high = 0; @@ -1087,6 +1111,7 @@ _cpp_parse_expr (cpp_reader *pfile, bool is_if) struct op *top = pfile->op_stack; unsigned int lex_count; bool saw_leading_not, want_value = true; + source_location virtual_location = 0; pfile->state.skip_eval = 0; @@ -1103,9 +1128,9 @@ _cpp_parse_expr (cpp_reader *pfile, bool is_if) struct op op; lex_count++; - op.token = cpp_get_token (pfile); + op.token = cpp_get_token_with_location (pfile, &virtual_location); op.op = op.token->type; - op.loc = op.token->src_loc; + op.loc = virtual_location; switch (op.op) { @@ -1118,10 +1143,11 @@ _cpp_parse_expr (cpp_reader *pfile, bool is_if) case CPP_NAME: case CPP_HASH: if (!want_value) - SYNTAX_ERROR2 ("missing binary operator before token \"%s\"", - cpp_token_as_text (pfile, op.token)); + SYNTAX_ERROR2_AT (op.loc, + "missing binary operator before token \"%s\"", + cpp_token_as_text (pfile, op.token)); want_value = false; - top->value = eval_token (pfile, op.token); + top->value = eval_token (pfile, op.token, op.loc); continue; case CPP_NOT: @@ -1138,8 +1164,9 @@ _cpp_parse_expr (cpp_reader *pfile, bool is_if) default: if ((int) op.op <= (int) CPP_EQ || (int) op.op >= (int) CPP_PLUS_EQ) - SYNTAX_ERROR2 ("token \"%s\" is not valid in preprocessor expressions", - cpp_token_as_text (pfile, op.token)); + SYNTAX_ERROR2_AT (op.loc, + "token \"%s\" is not valid in preprocessor expressions", + cpp_token_as_text (pfile, op.token)); break; } @@ -1147,27 +1174,32 @@ _cpp_parse_expr (cpp_reader *pfile, bool is_if) if (optab[op.op].flags & NO_L_OPERAND) { if (!want_value) - SYNTAX_ERROR2 ("missing binary operator before token \"%s\"", - cpp_token_as_text (pfile, op.token)); + SYNTAX_ERROR2_AT (op.loc, + "missing binary operator before token \"%s\"", + cpp_token_as_text (pfile, op.token)); } else if (want_value) { /* We want a number (or expression) and haven't got one. Try to emit a specific diagnostic. */ if (op.op == CPP_CLOSE_PAREN && top->op == CPP_OPEN_PAREN) - SYNTAX_ERROR ("missing expression between '(' and ')'"); + SYNTAX_ERROR_AT (op.loc, + "missing expression between '(' and ')'"); if (op.op == CPP_EOF && top->op == CPP_EOF) - SYNTAX_ERROR2 ("%s with no expression", is_if ? "#if" : "#elif"); + SYNTAX_ERROR2_AT (op.loc, + "%s with no expression", is_if ? "#if" : "#elif"); if (top->op != CPP_EOF && top->op != CPP_OPEN_PAREN) - SYNTAX_ERROR2 ("operator '%s' has no right operand", - cpp_token_as_text (pfile, top->token)); + SYNTAX_ERROR2_AT (op.loc, + "operator '%s' has no right operand", + cpp_token_as_text (pfile, top->token)); else if (op.op == CPP_CLOSE_PAREN || op.op == CPP_EOF) /* Complain about missing paren during reduction. */; else - SYNTAX_ERROR2 ("operator '%s' has no left operand", - cpp_token_as_text (pfile, op.token)); + SYNTAX_ERROR2_AT (op.loc, + "operator '%s' has no left operand", + cpp_token_as_text (pfile, op.token)); } top = reduce (pfile, top, op.op); @@ -1192,7 +1224,8 @@ _cpp_parse_expr (cpp_reader *pfile, bool is_if) break; case CPP_COLON: if (top->op != CPP_QUERY) - SYNTAX_ERROR (" ':' without preceding '?'"); + SYNTAX_ERROR_AT (op.loc, + " ':' without preceding '?'"); if (!num_zerop (top[-1].value)) /* Was '?' condition true? */ pfile->state.skip_eval++; else @@ -1209,7 +1242,7 @@ _cpp_parse_expr (cpp_reader *pfile, bool is_if) top->op = op.op; top->token = op.token; - top->loc = op.token->src_loc; + top->loc = op.loc; } /* The controlling macro expression is only valid if we called lex 3 @@ -1220,8 +1253,9 @@ _cpp_parse_expr (cpp_reader *pfile, bool is_if) if (top != pfile->op_stack) { - cpp_error (pfile, CPP_DL_ICE, "unbalanced stack in %s", - is_if ? "#if" : "#elif"); + cpp_error_with_line (pfile, CPP_DL_ICE, top->loc, 0, + "unbalanced stack in %s", + is_if ? "#if" : "#elif"); syntax_error: return false; /* Return false on syntax error. */ } diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 9dbc477b61e..2ec7eaaae2f 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -851,7 +851,7 @@ struct cpp_num /* Classify a CPP_NUMBER token. The return value is a combination of the flags from the above sets. */ extern unsigned cpp_classify_number (cpp_reader *, const cpp_token *, - const char **); + const char **, source_location); /* Return the classification flags for a float suffix. */ extern unsigned int cpp_interpret_float_suffix (const char *, size_t); diff --git a/libffi/ChangeLog.libgcj b/libffi/ChangeLog.libgcj index ea5d02f19ba..21d7ccf070a 100644 --- a/libffi/ChangeLog.libgcj +++ b/libffi/ChangeLog.libgcj @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2004-01-14 Kelley Cook <kcook@gcc.gnu.org> * configure.in: Add in AC_PREREQ(2.13) diff --git a/libffi/configure b/libffi/configure index 15914953909..28ed5131ca5 100755 --- a/libffi/configure +++ b/libffi/configure @@ -6282,7 +6282,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -10766,7 +10773,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10769 "configure" +#line 10776 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10872,7 +10879,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10875 "configure" +#line 10882 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 05478d68560..7c5b851e9de 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,21 @@ +2012-05-16 Olivier Hainque <hainque@adacore.com> + + * Makefile.in (install-unwind_h): Rename into ... + (install-unwind_h-forbuild): New target. + (all): Use it instead of the former install-unwind_h. + (install-unwind_h): Reinstate, copy to user install destination + for include files, not to the internal gcc object directory one. + (install-leaf): Depend on it. + +2012-05-15 Olivier Hainque <hainque@adacore.com> + + * config/rs6000/aix-unwind.h (*_REGNO): New, set of useful + register numbers. LR_REGNO replaces R_LR. + (ucontext_for): New, helper for ... + (ppc_aix_fallback_frame_state): New, implementation for aix 5.2 + and 5.3 of ... + (MD_FALLBACK_FRAME_STATE_FOR): Define for 32bit configurations. + 2012-05-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * config.host (i[34567]86-*-linux*, x86_64-*-linux*) diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index f529fa22195..a6ef57e17eb 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -1002,13 +1002,25 @@ $(libgcc-objects) $(libgcc-s-objects) $(libgcc-eh-objects) \ $(libunwind-objects) $(libunwind-s-objects) \ $(EXTRA_PARTS): libgcc_tm.h -install-unwind_h: +# Copy unwind.h to the place where gcc will look for it at build-time +install-unwind_h-forbuild: dest=$(gcc_objdir)/include/tmp$$$$-unwind.h; \ cp unwind.h $$dest; \ chmod a+r $$dest; \ sh $(srcdir)/../move-if-change $$dest $(gcc_objdir)/include/unwind.h -all: install-unwind_h +# Copy unwind.h to the place where gcc will look at run-time, once installed +# +# This is redundant with the internal copy above when using a regular toplevel +# "install" target, because gcc's install will copy to the destination as well. +# +# This is however useful for "install-no-fixincludes" case, when only the gcc +# internal headers are copied by gcc's install. +install-unwind_h: + $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include + $(INSTALL_DATA) unwind.h $(DESTDIR)$(libsubdir)/include + +all: install-unwind_h-forbuild # Documentation targets (empty). .PHONY: info html dvi pdf install-info install-html install-pdf @@ -1047,7 +1059,7 @@ install-shared: @shlib_base_name@,libgcc_s,$(subst \ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) -install-leaf: $(install-shared) $(install-libunwind) +install-leaf: $(install-shared) $(install-libunwind) install-unwind_h $(mkinstalldirs) $(DESTDIR)$(inst_libdir) $(INSTALL_DATA) libgcc.a $(DESTDIR)$(inst_libdir)/ @@ -1073,6 +1085,7 @@ install: install-leaf install-strip: install .PHONY: install install-shared install-libunwind install-strip +.PHONY: install-unwind_h install-unwind_h-forbuild # Don't export variables to the environment, in order to not confuse # configure. diff --git a/libgcc/config/rs6000/aix-unwind.h b/libgcc/config/rs6000/aix-unwind.h index 9e126595edb..90431a4e3d7 100644 --- a/libgcc/config/rs6000/aix-unwind.h +++ b/libgcc/config/rs6000/aix-unwind.h @@ -22,14 +22,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ +/* Useful register numbers. */ + +#define LR_REGNO 65 +#define CR2_REGNO 70 +#define XER_REGNO 76 +#define FIRST_ALTIVEC_REGNO 77 +#define VRSAVE_REGNO 109 +#define VSCR_REGNO 110 + /* If the current unwind info (FS) does not contain explicit info saving R2, then we have to do a minor amount of code reading to figure out if it was saved. The big problem here is that the code that does the save/restore is generated by the linker, so we have no good way to determine at compile time what to do. */ -#define R_LR 65 - #ifdef __64BIT__ #define MD_FROB_UPDATE_CONTEXT(CTX, FS) \ do { \ @@ -37,7 +44,7 @@ { \ unsigned int *insn \ = (unsigned int *) \ - _Unwind_GetGR ((CTX), R_LR); \ + _Unwind_GetGR ((CTX), LR_REGNO); \ if (*insn == 0xE8410028) \ _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40); \ } \ @@ -49,9 +56,200 @@ { \ unsigned int *insn \ = (unsigned int *) \ - _Unwind_GetGR ((CTX), R_LR); \ + _Unwind_GetGR ((CTX), LR_REGNO); \ if (*insn == 0x80410014) \ _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 20); \ } \ } while (0) #endif + +/* Now on to MD_FALLBACK_FRAME_STATE_FOR. + 32bit AIX 5.2 and 5.3 only at this stage. */ + +#include <stdlib.h> +#include <stddef.h> +#include <signal.h> +#include <sys/machine.h> + +#ifdef __64BIT__ + +/* 64bit fallback not implemented yet, so MD_FALLBACK_FRAME_STATE_FOR not + defined. Arrange just for the code below to compile. */ +typedef struct __context64 mstate_t; + +#else + +typedef struct mstsave mstate_t; + +#define MD_FALLBACK_FRAME_STATE_FOR ppc_aix_fallback_frame_state + +#endif + +/* If we are compiling on AIX < 5.3, the VMX related datastructs are not + defined and we take measures to obtain proper runtime behavior if the + compiled code happens to run on a later version with VMX enabled. */ + +#ifndef MSR_VMX +#define MSR_VMX 0x2000000 +#endif + +typedef unsigned int uint; +typedef struct { uint v[4]; } vreg_t; +typedef struct { + vreg_t regs[32]; + uint pad1 [3]; + uint vscr; + uint vrsave; + uint pad2 [3]; +} vstate_t; + +#define EXT_CONTEXT_MARK 0x45435458 +#define EXT_CONTEXT_SIZE 4096 +#define BUMPER_SIZE (EXT_CONTEXT_SIZE - sizeof(vstate_t) - (5 * sizeof(int))) + +typedef struct { + uint pad1 [4]; + vstate_t vstate; + char bumper [BUMPER_SIZE]; + int mark; +} extended_context_t; + +typedef struct { + char bumper [offsetof (ucontext_t, uc_stack) + sizeof (stack_t)]; + extended_context_t * ectx; + int mark; +} vmx_ucontext_t; + +/* Determine whether CONTEXT designates a signal handler, and return the + associated ucontext_t address if so. Return NULL otherwise. */ + +static ucontext_t * +ucontext_for (struct _Unwind_Context *context) +{ + const unsigned int * ra = context->ra; + + /* AIX 5.2 and 5.3, threaded or not, share common patterns and feature + variants depending on the configured kernel (unix_mp or unix_64). */ + + if (*(ra - 5) == 0x4c00012c /* isync */ + && *(ra - 4) == 0x80ec0000 /* lwz r7,0(r12) */ + && *(ra - 3) == 0x804c0004 /* lwz r2,4(r12) */ + && *(ra - 2) == 0x7ce903a6 /* mtctr r7 */ + && *(ra - 1) == 0x4e800421 /* bctrl */ + && *(ra - 0) == 0x7dc37378) /* mr r3,r14 <-- context->ra */ + { + /* unix_64 */ + if (*(ra - 6) == 0x7d000164) /* mtmsrd r8 */ + { + switch (*(ra + 18)) + { + /* AIX 5.2 */ + case 0x835a0520: /* lwz r26,1312(r26) */ + return (ucontext_t *)(context->cfa + 0x70); + + /* AIX 5.3 */ + case 0x835a0570: /* lwz r26,1392(r26) */ + return (ucontext_t *)(context->cfa + 0x40); + + default: + return 0; + } + } + + /* unix_mp */ + if (*(ra - 6) == 0x7d000124) /* mtmsr r8 */ + { + typedef struct { + char pad[56]; + ucontext_t ucontext; + siginfo_t siginfo; + } aix52_stack_t; + + aix52_stack_t * frame = (aix52_stack_t *) context->cfa; + return &frame->ucontext; + } + } + + return 0; +} + +/* The fallback proper. */ + +#ifdef DWARF_ALT_FRAME_RETURN_COLUMN +#define RETURN_COLUMN DWARF_ALT_FRAME_RETURN_COLUMN +#else +#define RETURN_COLUMN ARG_POINTER_REGNUM +#endif + +#define REGISTER_CFA_OFFSET_FOR(FS,REGNO,ADDR,CFA)\ +do { \ +(FS)->regs.reg[REGNO].how = REG_SAVED_OFFSET; \ +(FS)->regs.reg[REGNO].loc.offset = (long) (ADDR) - (CFA); \ +} while (0); + +static _Unwind_Reason_Code +ppc_aix_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + ucontext_t * uctx = ucontext_for (context); + mstate_t * mctx; + + long new_cfa; + int i; + + if (uctx == NULL) + return _URC_END_OF_STACK; + + mctx = &uctx->uc_mcontext.jmp_context; + + /* The "kernel" frame cfa is the stack pointer at the signal occurrence + point. */ + new_cfa = mctx->gpr[STACK_POINTER_REGNUM]; + + fs->regs.cfa_how = CFA_REG_OFFSET; + fs->regs.cfa_reg = STACK_POINTER_REGNUM; + fs->regs.cfa_offset = new_cfa - (long) context->cfa; + + /* And we state how to find the various registers it has saved with + relative offset rules from there. */ + + for (i = 0; i < 32; i++) + if (i != STACK_POINTER_REGNUM) + REGISTER_CFA_OFFSET_FOR (fs, i, &mctx->gpr[i], new_cfa); + + REGISTER_CFA_OFFSET_FOR (fs, CR2_REGNO, &mctx->cr, new_cfa); + REGISTER_CFA_OFFSET_FOR (fs, XER_REGNO, &mctx->xer, new_cfa); + REGISTER_CFA_OFFSET_FOR (fs, LR_REGNO, &mctx->lr, new_cfa); + + fs->retaddr_column = RETURN_COLUMN; + REGISTER_CFA_OFFSET_FOR (fs, RETURN_COLUMN, &mctx->iar, new_cfa); + fs->signal_frame = 1; + + /* Honor FP Ever Used ... */ + if (mctx->fpeu) + { + for (i = 0; i < 32; i++) + REGISTER_CFA_OFFSET_FOR (fs, i+32, &mctx->fpr[i], new_cfa); + } + + /* Honor VMX context, if any. We expect the msr bit never to be set in + environments where there is no VMX support, e.g. on AIX < 5.3. */ + if (mctx->msr & MSR_VMX) + { + vmx_ucontext_t * uc = (vmx_ucontext_t *) uctx; + + if (uc->mark == EXT_CONTEXT_MARK && uc->ectx->mark == EXT_CONTEXT_MARK) + { + vstate_t * vstate = &uc->ectx->vstate; + + for (i = 0; i < 32; i++) + REGISTER_CFA_OFFSET_FOR + (fs, i+FIRST_ALTIVEC_REGNO, &vstate->regs[i], new_cfa); + + REGISTER_CFA_OFFSET_FOR (fs, VSCR_REGNO, &vstate->vscr, new_cfa); + REGISTER_CFA_OFFSET_FOR (fs, VRSAVE_REGNO, &vstate->vrsave, new_cfa); + } + } + + return _URC_NO_REASON; +} diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 088d51786d7..a6cf6fde3ad 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,11 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + +2012-05-16 Tobias Burnus <burnus@net-b.de> + + * io/unix.c (tempfile_open): Pass mode to "open" for O_CREAT. + 2012-05-14 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/52428 diff --git a/libgfortran/configure b/libgfortran/configure index e2db9ea2537..80bfe84bb89 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -8074,7 +8074,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -12321,7 +12328,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12324 "configure" +#line 12331 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12427,7 +12434,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12430 "configure" +#line 12437 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index c81163f2563..2e59efdba73 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -1099,9 +1099,9 @@ tempfile_open (const char *tempdir, char **fname) #if defined(HAVE_CRLF) && defined(O_BINARY) fd = open (template, O_RDWR | O_CREAT | O_EXCL | O_BINARY, - S_IRUSR | S_IWUSR); + S_IRUSR | S_IWUSR, 0600); #else - fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); + fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR, 0600); #endif } while (fd == -1 && errno == EEXIST); diff --git a/libgo/Makefile.am b/libgo/Makefile.am index f48a42cbc12..a27216a9626 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -439,6 +439,7 @@ runtime_files = \ runtime/go-string-to-int-array.c \ runtime/go-strplus.c \ runtime/go-strslice.c \ + runtime/go-traceback.c \ runtime/go-trampoline.c \ runtime/go-type-complex.c \ runtime/go-type-eface.c \ diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 97188b9e51f..bf9c0b5d7b2 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -203,22 +203,23 @@ am__libgo_la_SOURCES_DIST = runtime/go-append.c runtime/go-assert.c \ runtime/go-setenv.c runtime/go-signal.c runtime/go-strcmp.c \ runtime/go-string-to-byte-array.c \ runtime/go-string-to-int-array.c runtime/go-strplus.c \ - runtime/go-strslice.c runtime/go-trampoline.c \ - runtime/go-type-complex.c runtime/go-type-eface.c \ - runtime/go-type-error.c runtime/go-type-float.c \ - runtime/go-type-identity.c runtime/go-type-interface.c \ - runtime/go-type-string.c runtime/go-typedesc-equal.c \ - runtime/go-typestring.c runtime/go-unsafe-new.c \ - runtime/go-unsafe-newarray.c runtime/go-unsafe-pointer.c \ - runtime/go-unwind.c runtime/chan.c runtime/cpuprof.c \ - runtime/lock_sema.c runtime/thread-sema.c runtime/lock_futex.c \ - runtime/thread-linux.c runtime/mcache.c runtime/mcentral.c \ - runtime/mem_posix_memalign.c runtime/mem.c runtime/mfinal.c \ - runtime/mfixalloc.c runtime/mgc0.c runtime/mheap.c \ - runtime/msize.c runtime/proc.c runtime/runtime.c \ - runtime/signal_unix.c runtime/thread.c runtime/yield.c \ - runtime/rtems-task-variable-add.c iface.c malloc.c map.c \ - mprof.c reflect.c runtime1.c sema.c sigqueue.c string.c time.c + runtime/go-strslice.c runtime/go-traceback.c \ + runtime/go-trampoline.c runtime/go-type-complex.c \ + runtime/go-type-eface.c runtime/go-type-error.c \ + runtime/go-type-float.c runtime/go-type-identity.c \ + runtime/go-type-interface.c runtime/go-type-string.c \ + runtime/go-typedesc-equal.c runtime/go-typestring.c \ + runtime/go-unsafe-new.c runtime/go-unsafe-newarray.c \ + runtime/go-unsafe-pointer.c runtime/go-unwind.c runtime/chan.c \ + runtime/cpuprof.c runtime/lock_sema.c runtime/thread-sema.c \ + runtime/lock_futex.c runtime/thread-linux.c runtime/mcache.c \ + runtime/mcentral.c runtime/mem_posix_memalign.c runtime/mem.c \ + runtime/mfinal.c runtime/mfixalloc.c runtime/mgc0.c \ + runtime/mheap.c runtime/msize.c runtime/proc.c \ + runtime/runtime.c runtime/signal_unix.c runtime/thread.c \ + runtime/yield.c runtime/rtems-task-variable-add.c iface.c \ + malloc.c map.c mprof.c reflect.c runtime1.c sema.c sigqueue.c \ + string.c time.c @LIBGO_IS_LINUX_FALSE@am__objects_1 = lock_sema.lo thread-sema.lo @LIBGO_IS_LINUX_TRUE@am__objects_1 = lock_futex.lo thread-linux.lo @HAVE_SYS_MMAN_H_FALSE@am__objects_2 = mem_posix_memalign.lo @@ -240,16 +241,16 @@ am__objects_4 = go-append.lo go-assert.lo go-assert-interface.lo \ go-reflect-map.lo go-rune.lo go-runtime-error.lo go-setenv.lo \ go-signal.lo go-strcmp.lo go-string-to-byte-array.lo \ go-string-to-int-array.lo go-strplus.lo go-strslice.lo \ - go-trampoline.lo go-type-complex.lo go-type-eface.lo \ - go-type-error.lo go-type-float.lo go-type-identity.lo \ - go-type-interface.lo go-type-string.lo go-typedesc-equal.lo \ - go-typestring.lo go-unsafe-new.lo go-unsafe-newarray.lo \ - go-unsafe-pointer.lo go-unwind.lo chan.lo cpuprof.lo \ - $(am__objects_1) mcache.lo mcentral.lo $(am__objects_2) \ - mfinal.lo mfixalloc.lo mgc0.lo mheap.lo msize.lo proc.lo \ - runtime.lo signal_unix.lo thread.lo yield.lo $(am__objects_3) \ - iface.lo malloc.lo map.lo mprof.lo reflect.lo runtime1.lo \ - sema.lo sigqueue.lo string.lo time.lo + go-traceback.lo go-trampoline.lo go-type-complex.lo \ + go-type-eface.lo go-type-error.lo go-type-float.lo \ + go-type-identity.lo go-type-interface.lo go-type-string.lo \ + go-typedesc-equal.lo go-typestring.lo go-unsafe-new.lo \ + go-unsafe-newarray.lo go-unsafe-pointer.lo go-unwind.lo \ + chan.lo cpuprof.lo $(am__objects_1) mcache.lo mcentral.lo \ + $(am__objects_2) mfinal.lo mfixalloc.lo mgc0.lo mheap.lo \ + msize.lo proc.lo runtime.lo signal_unix.lo thread.lo yield.lo \ + $(am__objects_3) iface.lo malloc.lo map.lo mprof.lo reflect.lo \ + runtime1.lo sema.lo sigqueue.lo string.lo time.lo am_libgo_la_OBJECTS = $(am__objects_4) libgo_la_OBJECTS = $(am_libgo_la_OBJECTS) libgo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ @@ -865,6 +866,7 @@ runtime_files = \ runtime/go-string-to-int-array.c \ runtime/go-strplus.c \ runtime/go-strslice.c \ + runtime/go-traceback.c \ runtime/go-trampoline.c \ runtime/go-type-complex.c \ runtime/go-type-eface.c \ @@ -2414,6 +2416,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-string-to-int-array.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-strplus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-strslice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-traceback.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-trampoline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-type-complex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-type-eface.Plo@am__quote@ @@ -2829,6 +2832,13 @@ go-strslice.lo: runtime/go-strslice.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-strslice.lo `test -f 'runtime/go-strslice.c' || echo '$(srcdir)/'`runtime/go-strslice.c +go-traceback.lo: runtime/go-traceback.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT go-traceback.lo -MD -MP -MF $(DEPDIR)/go-traceback.Tpo -c -o go-traceback.lo `test -f 'runtime/go-traceback.c' || echo '$(srcdir)/'`runtime/go-traceback.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/go-traceback.Tpo $(DEPDIR)/go-traceback.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='runtime/go-traceback.c' object='go-traceback.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-traceback.lo `test -f 'runtime/go-traceback.c' || echo '$(srcdir)/'`runtime/go-traceback.c + go-trampoline.lo: runtime/go-trampoline.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT go-trampoline.lo -MD -MP -MF $(DEPDIR)/go-trampoline.Tpo -c -o go-trampoline.lo `test -f 'runtime/go-trampoline.c' || echo '$(srcdir)/'`runtime/go-trampoline.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/go-trampoline.Tpo $(DEPDIR)/go-trampoline.Plo diff --git a/libgo/go/debug/dwarf/line.go b/libgo/go/debug/dwarf/line.go index 52c3b114da3..f3456fba0a4 100644 --- a/libgo/go/debug/dwarf/line.go +++ b/libgo/go/debug/dwarf/line.go @@ -359,7 +359,7 @@ func (d *Data) parseLineProgram(u *unit, b *buf, hdr lineHdr, end Offset) { b.error("DWARF file number out of range") return } - lineInfo.Filename = hdr.files[i] + lineInfo.Filename = hdr.files[i-1] newLineInfo = true case LineSetColumn: lineInfo.Column = int(b.uint()) diff --git a/libgo/go/log/syslog/syslog_c.c b/libgo/go/log/syslog/syslog_c.c index 5809d0a94a9..3b4cddd5d86 100644 --- a/libgo/go/log/syslog/syslog_c.c +++ b/libgo/go/log/syslog/syslog_c.c @@ -10,7 +10,7 @@ can't represent a C varargs function in Go. */ void syslog_c(int, const char*) - asm ("libgo_log.syslog.syslog_c"); + asm ("log_syslog.syslog_c"); void syslog_c (int priority, const char *msg) diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c index abe78c44ea8..5d398b04a02 100644 --- a/libgo/runtime/go-signal.c +++ b/libgo/runtime/go-signal.c @@ -157,7 +157,6 @@ sig_handler (int sig) for (i = 0; runtime_sigtab[i].sig != -1; ++i) { - struct sigaction sa; SigTab *t; t = &runtime_sigtab[i]; @@ -177,21 +176,33 @@ sig_handler (int sig) runtime_startpanic (); - /* We should do a stack backtrace here. Until we can do that, - we reraise the signal in order to get a slightly better - report from the shell. */ + { + const char *name = NULL; - memset (&sa, 0, sizeof sa); +#ifdef HAVE_STRSIGNAL + name = strsignal (sig); +#endif - sa.sa_handler = SIG_DFL; + if (name == NULL) + runtime_printf ("Signal %d\n", sig); + else + runtime_printf ("%s\n", name); + } - i = sigemptyset (&sa.sa_mask); - __go_assert (i == 0); + runtime_printf ("\n"); - if (sigaction (sig, &sa, NULL) != 0) - abort (); + if (runtime_gotraceback ()) + { + G *g; - raise (sig); + g = runtime_g (); + runtime_traceback (g); + runtime_tracebackothers (g); + + /* The gc library calls runtime_dumpregs here, and provides + a function that prints the registers saved in context in + a readable form. */ + } runtime_exit (2); } @@ -230,12 +241,22 @@ static void sig_panic_info_handler (int sig, siginfo_t *info, void *context __attribute__ ((unused))) { - if (runtime_g () == NULL || info->si_code == SI_USER) + G *g; + + g = runtime_g (); + if (g == NULL || info->si_code == SI_USER) { sig_handler (sig); return; } + g->sig = sig; + g->sigcode0 = info->si_code; + g->sigcode1 = (uintptr_t) info->si_addr; + + /* It would be nice to set g->sigpc here as the gc library does, but + I don't know how to get it portably. */ + sig_panic_leadin (sig); switch (sig) @@ -284,12 +305,19 @@ sig_panic_info_handler (int sig, siginfo_t *info, static void sig_panic_handler (int sig) { - if (runtime_g () == NULL) + G *g; + + g = runtime_g (); + if (g == NULL) { sig_handler (sig); return; } + g->sig = sig; + g->sigcode0 = 0; + g->sigcode1 = 0; + sig_panic_leadin (sig); switch (sig) diff --git a/libgo/runtime/go-traceback.c b/libgo/runtime/go-traceback.c new file mode 100644 index 00000000000..2ff2ce3faef --- /dev/null +++ b/libgo/runtime/go-traceback.c @@ -0,0 +1,62 @@ +/* go-traceback.c -- stack backtrace for Go. + + Copyright 2012 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. */ + +#include "config.h" + +#include "unwind.h" + +#include "runtime.h" +#include "go-string.h" + +static _Unwind_Reason_Code +traceback (struct _Unwind_Context *context, void *varg) +{ + int *parg = (int *) varg; + uintptr pc; + int ip_before_insn = 0; + struct __go_string fn; + struct __go_string file; + int line; + +#ifdef HAVE_GETIPINFO + pc = _Unwind_GetIPInfo (context, &ip_before_insn); +#else + pc = _Unwind_GetIP (context); +#endif + + if (*parg > 100) + return _URC_END_OF_STACK; + ++*parg; + + /* FIXME: If PC is in the __morestack routine, we should ignore + it. */ + + /* Back up to the call instruction. */ + if (!ip_before_insn) + --pc; + + if (!__go_file_line (pc, &fn, &file, &line)) + return _URC_END_OF_STACK; + + if (runtime_showframe (fn.__data)) + { + runtime_printf ("%s\n", fn.__data); + runtime_printf ("\t%s:%d\n", file.__data, line); + } + + return _URC_NO_REASON; +} + +/* Print a stack trace for the current goroutine. */ + +void +runtime_traceback () +{ + int c; + + c = 0; + _Unwind_Backtrace (traceback, &c); +} diff --git a/libgo/runtime/mprof.goc b/libgo/runtime/mprof.goc index c61c65ccee3..a8bee206f9c 100644 --- a/libgo/runtime/mprof.goc +++ b/libgo/runtime/mprof.goc @@ -361,10 +361,11 @@ func Stack(b Slice, all bool) (n int32) { g->writenbuf = b.__count; USED(pc); USED(sp); - // runtime_goroutineheader(g); - // runtime_traceback(pc, sp, 0, g); - // if(all) - // runtime_tracebackothers(g); + runtime_goroutineheader(g); + runtime_traceback(); + runtime_goroutinetrailer(g); + if(all) + runtime_tracebackothers(g); n = b.__count - g->writenbuf; g->writebuf = nil; g->writenbuf = 0; diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c index eabd5e82664..890b492d404 100644 --- a/libgo/runtime/proc.c +++ b/libgo/runtime/proc.c @@ -50,6 +50,8 @@ uintptr runtime_stacks_sys; static void schedule(G*); +static void gtraceback(G*); + typedef struct Sched Sched; M runtime_m0; @@ -345,6 +347,9 @@ runtime_mcall(void (*pfn)(G*)) // the values for this thread. mp = runtime_m(); gp = runtime_g(); + + if(gp->dotraceback != nil) + gtraceback(gp); } if (gp == nil || !gp->fromgogo) { #ifdef USING_SPLIT_STACK @@ -523,19 +528,73 @@ runtime_goroutineheader(G *g) } void -runtime_tracebackothers(G *me) +runtime_goroutinetrailer(G *g) { - G *g; + if(g != nil && g->gopc != 0 && g->goid != 1) { + struct __go_string fn; + struct __go_string file; + int line; + + if(__go_file_line(g->gopc - 1, &fn, &file, &line)) { + runtime_printf("created by %s\n", fn.__data); + runtime_printf("\t%s:%d\n", file.__data, line); + } + } +} + +void +runtime_tracebackothers(G * volatile me) +{ + G * volatile g; for(g = runtime_allg; g != nil; g = g->alllink) { if(g == me || g->status == Gdead) continue; runtime_printf("\n"); runtime_goroutineheader(g); - // runtime_traceback(g->sched.pc, g->sched.sp, 0, g); + + // Our only mechanism for doing a stack trace is + // _Unwind_Backtrace. And that only works for the + // current thread, not for other random goroutines. + // So we need to switch context to the goroutine, get + // the backtrace, and then switch back. + + // This means that if g is running or in a syscall, we + // can't reliably print a stack trace. FIXME. + if(g->status == Gsyscall || g->status == Grunning) { + runtime_printf("no stack trace available\n"); + runtime_goroutinetrailer(g); + continue; + } + + g->dotraceback = me; + +#ifdef USING_SPLIT_STACK + __splitstack_getcontext(&me->stack_context[0]); +#endif + getcontext(&me->context); + + if(g->dotraceback) { + runtime_gogo(g); + } } } +// Do a stack trace of gp, and then restore the context to +// gp->dotraceback. + +static void +gtraceback(G* gp) +{ + G* ret; + + runtime_traceback(nil); + runtime_goroutinetrailer(gp); + ret = gp->dotraceback; + gp->dotraceback = nil; + runtime_gogo(ret); +} + // Mark this g as m's idle goroutine. // This functionality might be used in environments where programs // are limited to a single thread, to simulate a select-driven @@ -1171,7 +1230,7 @@ runtime_entersyscall(void) // Leave SP around for gc and traceback. #ifdef USING_SPLIT_STACK - g->gcstack = __splitstack_find(NULL, NULL, &g->gcstack_size, + g->gcstack = __splitstack_find(nil, nil, &g->gcstack_size, &g->gcnext_segment, &g->gcnext_sp, &g->gcinitial_sp); #else @@ -1227,9 +1286,11 @@ runtime_exitsyscall(void) // find that we still have mcpu <= mcpumax, then we can // start executing Go code immediately, without having to // schedlock/schedunlock. + // Also do fast return if any locks are held, so that + // panic code can use syscalls to open a file. gp = g; v = runtime_xadd(&runtime_sched.atomic, (1<<mcpuShift)); - if(m->profilehz == runtime_sched.profilehz && atomic_mcpu(v) <= atomic_mcpumax(v)) { + if((m->profilehz == runtime_sched.profilehz && atomic_mcpu(v) <= atomic_mcpumax(v)) || m->locks > 0) { // There's a cpu for us, so we can run. gp->status = Grunning; // Garbage collector isn't running (since we are), @@ -1322,7 +1383,7 @@ __go_go(void (*fn)(void*), void* arg) { byte *sp; size_t spsize; - G * volatile newg; // volatile to avoid longjmp warning + G *newg; schedlock(); @@ -1363,19 +1424,26 @@ __go_go(void (*fn)(void*), void* arg) if(sp == nil) runtime_throw("nil g->stack0"); - getcontext(&newg->context); - newg->context.uc_stack.ss_sp = sp; + { + // Avoid warnings about variables clobbered by + // longjmp. + byte * volatile vsp = sp; + size_t volatile vspsize = spsize; + G * volatile vnewg = newg; + + getcontext(&vnewg->context); + vnewg->context.uc_stack.ss_sp = vsp; #ifdef MAKECONTEXT_STACK_TOP - newg->context.uc_stack.ss_sp += spsize; + vnewg->context.uc_stack.ss_sp += vspsize; #endif - newg->context.uc_stack.ss_size = spsize; - makecontext(&newg->context, kickoff, 0); + vnewg->context.uc_stack.ss_size = vspsize; + makecontext(&vnewg->context, kickoff, 0); - newprocreadylocked(newg); - schedunlock(); + newprocreadylocked(vnewg); + schedunlock(); - return newg; -//printf(" goid=%d\n", newg->goid); + return vnewg; + } } // Put on gfree list. Sched must be locked. @@ -1554,7 +1622,7 @@ runtime_sigprof(uint8 *pc __attribute__ ((unused)), uint8 *lr __attribute__ ((unused)), G *gp __attribute__ ((unused))) { - // int32 n; + int32 n; if(prof.fn == nil || prof.hz == 0) return; @@ -1564,9 +1632,9 @@ runtime_sigprof(uint8 *pc __attribute__ ((unused)), runtime_unlock(&prof); return; } - // n = runtime_gentraceback(pc, sp, lr, gp, 0, prof.pcbuf, nelem(prof.pcbuf)); - // if(n > 0) - // prof.fn(prof.pcbuf, n); + n = runtime_callers(0, prof.pcbuf, nelem(prof.pcbuf)); + if(n > 0) + prof.fn(prof.pcbuf, n); runtime_unlock(&prof); } diff --git a/libgo/runtime/runtime.c b/libgo/runtime/runtime.c index c8443cbed99..3c8d76225fc 100644 --- a/libgo/runtime/runtime.c +++ b/libgo/runtime/runtime.c @@ -11,6 +11,17 @@ uint32 runtime_panicking; +int32 +runtime_gotraceback(void) +{ + const byte *p; + + p = runtime_getenv("GOTRACEBACK"); + if(p == nil || p[0] == '\0') + return 1; // default is on + return runtime_atoi(p); +} + static Lock paniclk; void @@ -31,20 +42,26 @@ runtime_startpanic(void) void runtime_dopanic(int32 unused __attribute__ ((unused))) { - /* + G* g; static bool didothers; + g = runtime_g(); if(g->sig != 0) - runtime_printf("[signal %x code=%p addr=%p pc=%p]\n", - g->sig, g->sigcode0, g->sigcode1, g->sigpc); + runtime_printf("[signal %x code=%p addr=%p]\n", + g->sig, (void*)(g->sigcode0), (void*)(g->sigcode1)); if(runtime_gotraceback()){ + if(g != runtime_m()->g0) { + runtime_printf("\n"); + runtime_goroutineheader(g); + runtime_traceback(); + runtime_goroutinetrailer(g); + } if(!didothers) { didothers = true; runtime_tracebackothers(g); } } - */ runtime_unlock(&paniclk); if(runtime_xadd(&runtime_panicking, -1) != 0) { @@ -185,10 +202,10 @@ runtime_fastrand1(void) } static struct root_list runtime_roots = -{ NULL, +{ nil, { { &syscall_Envs, sizeof syscall_Envs }, { &os_Args, sizeof os_Args }, - { NULL, 0 } }, + { nil, 0 } }, }; void @@ -209,3 +226,13 @@ runtime_cputicks(void) return 0; #endif } + +bool +runtime_showframe(const unsigned char *s) +{ + static int32 traceback = -1; + + if(traceback < 0) + traceback = runtime_gotraceback(); + return traceback > 1 || (__builtin_strchr((const char*)s, '.') != nil && __builtin_memcmp(s, "runtime.", 7) != 0); +} diff --git a/libgo/runtime/runtime.h b/libgo/runtime/runtime.h index 3e75b1583b8..91044184b1f 100644 --- a/libgo/runtime/runtime.h +++ b/libgo/runtime/runtime.h @@ -143,14 +143,16 @@ struct G M* m; // for debuggers, but offset not hard-coded M* lockedm; M* idlem; - // int32 sig; + int32 sig; int32 writenbuf; byte* writebuf; - // uintptr sigcode0; - // uintptr sigcode1; + uintptr sigcode0; + uintptr sigcode1; // uintptr sigpc; uintptr gopc; // pc of go statement that created this goroutine + G* dotraceback; + ucontext_t context; void* stack_context[10]; }; @@ -289,6 +291,11 @@ void* runtime_mal(uintptr); void runtime_schedinit(void); void runtime_initsig(void); void runtime_sigenable(uint32 sig); +int32 runtime_gotraceback(void); +void runtime_goroutineheader(G*); +void runtime_goroutinetrailer(G*); +void runtime_traceback(); +void runtime_tracebackothers(G*); String runtime_gostringnocopy(const byte*); void* runtime_mstart(void*); G* runtime_malg(int32, byte**, size_t*); @@ -434,6 +441,8 @@ void runtime_osyield(void); void runtime_LockOSThread(void) __asm__("runtime.LockOSThread"); void runtime_UnlockOSThread(void) __asm__("runtime.UnlockOSThread"); +bool runtime_showframe(const unsigned char*); + uintptr runtime_memlimit(void); // If appropriate, ask the operating system to control whether this @@ -468,3 +477,5 @@ void __go_register_gc_roots(struct root_list*); // This will be 0 when using split stacks, as in that case // the stacks are allocated by the splitstack library. extern uintptr runtime_stacks_sys; + +extern _Bool __go_file_line (uintptr, String*, String*, int *); diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index bc6d5c47792..f8d57398bc6 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org> * testsuite/lib/libgomp.exp: Add -fno-diagnostics-show-caret. diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in index aac25d57574..acdc5d73ae2 100644 --- a/libgomp/Makefile.in +++ b/libgomp/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -17,6 +17,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -140,6 +157,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(nodist_finclude_HEADERS) $(nodist_libsubinclude_HEADERS) \ $(nodist_noinst_HEADERS) $(nodist_toolexeclib_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ @@ -419,7 +441,6 @@ libgomp.spec: $(top_builddir)/config.status $(srcdir)/libgomp.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -427,6 +448,8 @@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \ } @@ -577,9 +600,7 @@ uninstall-html-am: uninstall-info-am: @$(PRE_UNINSTALL) - @if test -d '$(DESTDIR)$(infodir)' && \ - (install-info --version && \ - install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ @@ -653,8 +674,11 @@ maintainer-clean-aminfo: done install-nodist_fincludeHEADERS: $(nodist_finclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(fincludedir)" || $(MKDIR_P) "$(DESTDIR)$(fincludedir)" @list='$(nodist_finclude_HEADERS)'; test -n "$(fincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(fincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(fincludedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -671,8 +695,11 @@ uninstall-nodist_fincludeHEADERS: dir='$(DESTDIR)$(fincludedir)'; $(am__uninstall_files_from_dir) install-nodist_libsubincludeHEADERS: $(nodist_libsubinclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libsubincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)" @list='$(nodist_libsubinclude_HEADERS)'; test -n "$(libsubincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libsubincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -689,8 +716,11 @@ uninstall-nodist_libsubincludeHEADERS: dir='$(DESTDIR)$(libsubincludedir)'; $(am__uninstall_files_from_dir) install-nodist_toolexeclibHEADERS: $(nodist_toolexeclib_HEADERS) @$(NORMAL_INSTALL) - test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" @list='$(nodist_toolexeclib_HEADERS)'; test -n "$(toolexeclibdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -912,8 +942,11 @@ install-dvi: install-dvi-recursive install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) - test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)" @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -929,8 +962,11 @@ install-html: install-html-recursive install-html-am: $(HTMLS) @$(NORMAL_INSTALL) - test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ @@ -953,9 +989,12 @@ install-info: install-info-recursive install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) - test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)" @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ + fi; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ @@ -973,13 +1012,7 @@ install-info-am: $(INFO_DEPS) echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) - @am__run_installinfo=yes; \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) am__run_installinfo=no;; \ - *) (install-info --version) >/dev/null 2>&1 \ - || am__run_installinfo=no;; \ - esac; \ - if test $$am__run_installinfo = yes; then \ + @if $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ @@ -993,8 +1026,11 @@ install-pdf: install-pdf-recursive install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) - test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)" @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1006,8 +1042,11 @@ install-ps: install-ps-recursive install-ps-am: $(PSS) @$(NORMAL_INSTALL) - test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)" @list='$(PSS)'; test -n "$(psdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ diff --git a/libgomp/aclocal.m4 b/libgomp/aclocal.m4 index f4fef43f9f1..96323c0d76f 100644 --- a/libgomp/aclocal.m4 +++ b/libgomp/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, @@ -38,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.3], [], +m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -54,7 +54,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.3])dnl +[AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) diff --git a/libgomp/configure b/libgomp/configure index 8325e2da4d5..ee4d0b3edef 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -6599,7 +6599,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -11083,7 +11090,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11086 "configure" +#line 11093 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11189,7 +11196,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11192 "configure" +#line 11199 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libgomp/testsuite/Makefile.in b/libgomp/testsuite/Makefile.in index 886a8d6a6a0..68831699f9a 100644 --- a/libgomp/testsuite/Makefile.in +++ b/libgomp/testsuite/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -57,6 +74,11 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac DEJATOOL = $(PACKAGE) RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir ACLOCAL = @ACLOCAL@ diff --git a/libitm/ChangeLog b/libitm/ChangeLog index ac616d69aa2..688eddac159 100644 --- a/libitm/ChangeLog +++ b/libitm/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-04-04 H.J. Lu <hongjiu.lu@intel.com> PR libitm/52854 diff --git a/libitm/configure b/libitm/configure index df7e2db48ef..c2306fd4bf9 100644 --- a/libitm/configure +++ b/libitm/configure @@ -7290,7 +7290,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -11775,7 +11782,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11778 "configure" +#line 11785 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11881,7 +11888,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11884 "configure" +#line 11891 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libjava/ChangeLog b/libjava/ChangeLog index f417a49a5a4..619c88e825e 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-04-23 Andrew Haley <aph@redhat.com> * defineclass.cc (MAJOR_1_7, MINOR_1_7): New. diff --git a/libjava/classpath/ChangeLog.gcj b/libjava/classpath/ChangeLog.gcj index eae363d067f..53d206bdcc9 100644 --- a/libjava/classpath/ChangeLog.gcj +++ b/libjava/classpath/ChangeLog.gcj @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-01-01 Jakub Jelinek <jakub@redhat.com> * gnu/java/rmi/registry/RegistryImpl.java (version): Update diff --git a/libjava/classpath/configure b/libjava/classpath/configure index 5874086aa0c..21d0d5f755e 100755 --- a/libjava/classpath/configure +++ b/libjava/classpath/configure @@ -7592,7 +7592,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -11811,7 +11818,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11814 "configure" +#line 11821 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11917,7 +11924,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11920 "configure" +#line 11927 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -23878,7 +23885,7 @@ else JAVA_TEST=Object.java CLASS_TEST=Object.class cat << \EOF > $JAVA_TEST -/* #line 23881 "configure" */ +/* #line 23888 "configure" */ package java.lang; public class Object @@ -23971,7 +23978,7 @@ EOF if uudecode$EXEEXT Test.uue; then ac_cv_prog_uudecode_base64=yes else - echo "configure: 23974: uudecode had trouble decoding base 64 file 'Test.uue'" >&5 + echo "configure: 23981: uudecode had trouble decoding base 64 file 'Test.uue'" >&5 echo "configure: failed file was:" >&5 cat Test.uue >&5 ac_cv_prog_uudecode_base64=no @@ -23999,7 +24006,7 @@ JAVA_TEST=Test.java CLASS_TEST=Test.class TEST=Test cat << \EOF > $JAVA_TEST -/* [#]line 24002 "configure" */ +/* [#]line 24009 "configure" */ public class Test { public static void main (String args[]) { System.exit (0); @@ -24207,7 +24214,7 @@ if test "x${use_glibj_zip}" = xfalse || \ JAVA_TEST=Test.java CLASS_TEST=Test.class cat << \EOF > $JAVA_TEST - /* #line 24210 "configure" */ + /* #line 24217 "configure" */ public class Test { public static void main(String args) diff --git a/libjava/configure b/libjava/configure index 43fd51f03a3..655179a89af 100755 --- a/libjava/configure +++ b/libjava/configure @@ -8842,7 +8842,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -13358,7 +13365,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13361 "configure" +#line 13368 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13464,7 +13471,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13467 "configure" +#line 13474 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19457,7 +19464,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then : enableval=$enable_sjlj_exceptions; : else cat > conftest.$ac_ext << EOF -#line 19460 "configure" +#line 19467 "configure" struct S { ~S(); }; void bar(); void foo() diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog index 9fb1cac7758..e7e1023e9ed 100644 --- a/libmudflap/ChangeLog +++ b/libmudflap/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 24985 diff --git a/libmudflap/Makefile.in b/libmudflap/Makefile.in index ae342cf8073..515651320b8 100644 --- a/libmudflap/Makefile.in +++ b/libmudflap/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,6 +17,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -81,6 +98,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \ "$(DESTDIR)$(libsubincludedir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) @@ -125,6 +148,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(nobase_libsubinclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive @@ -341,7 +369,7 @@ all: config.h .SUFFIXES: .SUFFIXES: .c .lo .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -377,10 +405,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -394,7 +420,6 @@ distclean-hdr: -rm -f config.h stamp-h1 install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -402,6 +427,8 @@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \ } @@ -423,9 +450,9 @@ clean-toolexeclibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libmudflap.la: $(libmudflap_la_OBJECTS) $(libmudflap_la_DEPENDENCIES) +libmudflap.la: $(libmudflap_la_OBJECTS) $(libmudflap_la_DEPENDENCIES) $(EXTRA_libmudflap_la_DEPENDENCIES) $(libmudflap_la_LINK) -rpath $(toolexeclibdir) $(libmudflap_la_OBJECTS) $(libmudflap_la_LIBADD) $(LIBS) -libmudflapth.la: $(libmudflapth_la_OBJECTS) $(libmudflapth_la_DEPENDENCIES) +libmudflapth.la: $(libmudflapth_la_OBJECTS) $(libmudflapth_la_DEPENDENCIES) $(EXTRA_libmudflapth_la_DEPENDENCIES) $(libmudflapth_la_LINK) $(am_libmudflapth_la_rpath) $(libmudflapth_la_OBJECTS) $(libmudflapth_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -527,15 +554,18 @@ maintainer-clean-multi: $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE) install-nobase_libsubincludeHEADERS: $(nobase_libsubinclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libsubincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)" @list='$(nobase_libsubinclude_HEADERS)'; test -n "$(libsubincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libsubincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)" || exit 1; \ + fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ - echo "$(MKDIR_P) '$(DESTDIR)$(libsubincludedir)/$$dir'"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(libsubincludedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(libsubincludedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(libsubincludedir)/$$dir" || exit $$?; }; \ @@ -545,9 +575,7 @@ uninstall-nobase_libsubincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_libsubinclude_HEADERS)'; test -n "$(libsubincludedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(libsubincludedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(libsubincludedir)" && rm -f $$files + dir='$(DESTDIR)$(libsubincludedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -701,10 +729,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/libmudflap/aclocal.m4 b/libmudflap/aclocal.m4 index b62d573c110..e9d09e5b363 100644 --- a/libmudflap/aclocal.m4 +++ b/libmudflap/aclocal.m4 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,12 +20,15 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,19 +54,21 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -144,14 +150,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -191,6 +197,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -255,7 +262,7 @@ AC_CACHE_CHECK([dependency style of $depcc], break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -320,10 +327,13 @@ AC_DEFUN([AM_DEP_TRACK], if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -545,12 +555,15 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -569,8 +582,8 @@ AC_SUBST(install_sh)]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -590,7 +603,7 @@ AC_DEFUN([AM_MAINTAINER_MODE], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful @@ -701,12 +714,15 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -729,13 +745,14 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -743,13 +760,13 @@ AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -825,12 +842,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -853,13 +872,13 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -868,13 +887,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -896,10 +915,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) diff --git a/libmudflap/configure b/libmudflap/configure index f1c74a1f5ee..011b2c90110 100755 --- a/libmudflap/configure +++ b/libmudflap/configure @@ -634,6 +634,7 @@ CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -2797,11 +2798,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -3722,6 +3723,7 @@ fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3746,6 +3748,7 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -3805,7 +3808,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -6393,7 +6396,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -10607,7 +10617,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10610 "configure" +#line 10620 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10713,7 +10723,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10716 "configure" +#line 10726 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libmudflap/testsuite/Makefile.in b/libmudflap/testsuite/Makefile.in index 73411bdd108..f3404ca9ff9 100644 --- a/libmudflap/testsuite/Makefile.in +++ b/libmudflap/testsuite/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -55,6 +72,11 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = mfconfig.exp CONFIG_CLEAN_VPATH_FILES = SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac DEJATOOL = $(PACKAGE) RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir ACLOCAL = @ACLOCAL@ @@ -240,7 +262,7 @@ CTAGS: check-DEJAGNU: site.exp - srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ + srcdir='$(srcdir)'; export srcdir; \ EXPECT=$(EXPECT); export EXPECT; \ runtest=$(RUNTEST); \ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ @@ -251,12 +273,12 @@ check-DEJAGNU: site.exp else echo "WARNING: could not find \`runtest'" 1>&2; :;\ fi; \ exit $$exit_status -site.exp: Makefile +site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @echo 'Making a new site.exp file...' @echo '## these variables are automatically generated by make ##' >site.tmp @echo '# Do not edit here. If you wish to override these values' >>site.tmp @echo '# edit the last section' >>site.tmp - @echo 'set srcdir $(srcdir)' >>site.tmp + @echo 'set srcdir "$(srcdir)"' >>site.tmp @echo "set objdir `pwd`" >>site.tmp @echo 'set build_alias "$(build_alias)"' >>site.tmp @echo 'set build_triplet $(build_triplet)' >>site.tmp @@ -264,9 +286,16 @@ site.exp: Makefile @echo 'set host_triplet $(host_triplet)' >>site.tmp @echo 'set target_alias "$(target_alias)"' >>site.tmp @echo 'set target_triplet $(target_triplet)' >>site.tmp - @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp - @test ! -f site.exp || \ - sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \ + echo "## Begin content included from file $$f. Do not modify. ##" \ + && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \ + && echo "## End content included from file $$f. ##" \ + || exit 1; \ + done >> site.tmp + @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp + @if test -f site.exp; then \ + sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \ + fi @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp @@ -291,10 +320,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index 704981d9c13..3946e654ca1 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-03-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * configure.ac (enable_objc_gc): Remove alpha*-dec-osf* handling. diff --git a/libobjc/configure b/libobjc/configure index 2807d7394f9..5028c28fba0 100755 --- a/libobjc/configure +++ b/libobjc/configure @@ -6072,7 +6072,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -10587,7 +10594,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10590 "configure" +#line 10597 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10693,7 +10700,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10696 "configure" +#line 10703 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11464,7 +11471,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then : enableval=$enable_sjlj_exceptions; : else cat > conftest.$ac_ext << EOF -#line 11467 "configure" +#line 11474 "configure" @interface Frob @end @implementation Frob diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog index 96c61861f24..4c25e881327 100644 --- a/libquadmath/ChangeLog +++ b/libquadmath/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2011-11-21 Andreas Tobler <andreast@fgznet.ch> * configure: Regenerate. diff --git a/libquadmath/Makefile.in b/libquadmath/Makefile.in index 6e389cf6af1..10f800a0c68 100644 --- a/libquadmath/Makefile.in +++ b/libquadmath/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,6 +17,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -83,6 +100,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \ "$(DESTDIR)$(libsubincludedir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) @@ -176,6 +199,11 @@ TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(nodist_libsubinclude_HEADERS) ETAGS = etags CTAGS = ctags @@ -416,7 +444,7 @@ all: config.h .SUFFIXES: .SUFFIXES: .c .dvi .lo .o .obj .ps -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -452,10 +480,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -469,7 +495,6 @@ distclean-hdr: -rm -f config.h stamp-h1 install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -477,6 +502,8 @@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \ } @@ -636,7 +663,7 @@ strtod/mpn2flt128.lo: strtod/$(am__dirstamp) \ strtod/$(DEPDIR)/$(am__dirstamp) strtod/tens_in_limb.lo: strtod/$(am__dirstamp) \ strtod/$(DEPDIR)/$(am__dirstamp) -libquadmath.la: $(libquadmath_la_OBJECTS) $(libquadmath_la_DEPENDENCIES) +libquadmath.la: $(libquadmath_la_OBJECTS) $(libquadmath_la_DEPENDENCIES) $(EXTRA_libquadmath_la_DEPENDENCIES) $(libquadmath_la_LINK) $(am_libquadmath_la_rpath) $(libquadmath_la_OBJECTS) $(libquadmath_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -1034,9 +1061,7 @@ uninstall-html-am: uninstall-info-am: @$(PRE_UNINSTALL) - @if test -d '$(DESTDIR)$(infodir)' && \ - (install-info --version && \ - install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ @@ -1111,8 +1136,11 @@ maintainer-clean-aminfo: done install-nodist_libsubincludeHEADERS: $(nodist_libsubinclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libsubincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)" @list='$(nodist_libsubinclude_HEADERS)'; test -n "$(libsubincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libsubincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1126,9 +1154,7 @@ uninstall-nodist_libsubincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_libsubinclude_HEADERS)'; test -n "$(libsubincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(libsubincludedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(libsubincludedir)" && rm -f $$files + dir='$(DESTDIR)$(libsubincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -1200,10 +1226,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -1253,8 +1284,11 @@ install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) - test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)" @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1269,18 +1303,22 @@ install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) - test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ - if test -d "$$d$$p"; then \ + d2=$$d$$p; \ + if test -d "$$d2"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ - echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ + echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ - list2="$$list2 $$d$$p"; \ + list2="$$list2 $$d2"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ @@ -1292,9 +1330,12 @@ install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) - test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)" @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ + fi; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ @@ -1312,8 +1353,7 @@ install-info-am: $(INFO_DEPS) echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) - @if (install-info --version && \ - install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + @if $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ @@ -1327,8 +1367,11 @@ install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) - test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)" @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -1340,8 +1383,11 @@ install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) - test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)" @list='$(PSS)'; test -n "$(psdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ diff --git a/libquadmath/aclocal.m4 b/libquadmath/aclocal.m4 index 6116764e681..74cc84f1384 100644 --- a/libquadmath/aclocal.m4 +++ b/libquadmath/aclocal.m4 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,12 +20,15 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,19 +54,21 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -144,14 +150,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -191,6 +197,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -255,7 +262,7 @@ AC_CACHE_CHECK([dependency style of $depcc], break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -320,10 +327,13 @@ AC_DEFUN([AM_DEP_TRACK], if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -545,12 +555,15 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -569,8 +582,8 @@ AC_SUBST(install_sh)]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -590,7 +603,7 @@ AC_DEFUN([AM_MAINTAINER_MODE], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful @@ -736,12 +749,15 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -764,13 +780,14 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -778,13 +795,13 @@ AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -860,12 +877,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -888,13 +907,13 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -903,13 +922,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -931,10 +950,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) diff --git a/libquadmath/configure b/libquadmath/configure index 9d979337d18..28296ba60c7 100755 --- a/libquadmath/configure +++ b/libquadmath/configure @@ -646,6 +646,7 @@ CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -2841,11 +2842,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -2922,6 +2923,7 @@ fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3739,6 +3741,7 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -3798,7 +3801,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -6264,7 +6267,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -10513,7 +10523,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10516 "configure" +#line 10526 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10619,7 +10629,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10622 "configure" +#line 10632 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11508,6 +11518,7 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -11567,7 +11578,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. diff --git a/libssp/ChangeLog b/libssp/ChangeLog index 308f6fa7c0a..16d4bf6a8b8 100644 --- a/libssp/ChangeLog +++ b/libssp/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2011-11-21 Andreas Tobler <andreast@fgznet.ch> * configure: Regenerate. diff --git a/libssp/Makefile.in b/libssp/Makefile.in index a7db7a9c091..98996d6ff24 100644 --- a/libssp/Makefile.in +++ b/libssp/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,6 +17,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -82,6 +99,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \ "$(DESTDIR)$(libsubincludedir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) @@ -119,6 +142,11 @@ MULTIDIRS = MULTISUBDIR = MULTIDO = true MULTICLEAN = true +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(nobase_libsubinclude_HEADERS) ETAGS = etags CTAGS = ctags @@ -329,7 +357,7 @@ all: config.h .SUFFIXES: .SUFFIXES: .c .lo .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -365,10 +393,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -384,7 +410,6 @@ ssp/ssp.h: $(top_builddir)/config.status $(top_srcdir)/ssp/ssp.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -392,6 +417,8 @@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \ } @@ -413,9 +440,9 @@ clean-toolexeclibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libssp.la: $(libssp_la_OBJECTS) $(libssp_la_DEPENDENCIES) +libssp.la: $(libssp_la_OBJECTS) $(libssp_la_DEPENDENCIES) $(EXTRA_libssp_la_DEPENDENCIES) $(libssp_la_LINK) -rpath $(toolexeclibdir) $(libssp_la_OBJECTS) $(libssp_la_LIBADD) $(LIBS) -libssp_nonshared.la: $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_DEPENDENCIES) +libssp_nonshared.la: $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_DEPENDENCIES) $(EXTRA_libssp_nonshared_la_DEPENDENCIES) $(libssp_nonshared_la_LINK) -rpath $(toolexeclibdir) $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -496,15 +523,18 @@ maintainer-clean-multi: $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE) install-nobase_libsubincludeHEADERS: $(nobase_libsubinclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libsubincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)" @list='$(nobase_libsubinclude_HEADERS)'; test -n "$(libsubincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libsubincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)" || exit 1; \ + fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ - echo "$(MKDIR_P) '$(DESTDIR)$(libsubincludedir)/$$dir'"; \ + echo " $(MKDIR_P) '$(DESTDIR)$(libsubincludedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(libsubincludedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(libsubincludedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(libsubincludedir)/$$dir" || exit $$?; }; \ @@ -514,9 +544,7 @@ uninstall-nobase_libsubincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_libsubinclude_HEADERS)'; test -n "$(libsubincludedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(libsubincludedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(libsubincludedir)" && rm -f $$files + dir='$(DESTDIR)$(libsubincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -586,10 +614,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/libssp/aclocal.m4 b/libssp/aclocal.m4 index 0c2e5ea3660..c9005328ffd 100644 --- a/libssp/aclocal.m4 +++ b/libssp/aclocal.m4 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,12 +20,15 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,19 +54,21 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -144,14 +150,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -191,6 +197,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -255,7 +262,7 @@ AC_CACHE_CHECK([dependency style of $depcc], break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -320,10 +327,13 @@ AC_DEFUN([AM_DEP_TRACK], if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -545,12 +555,15 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -569,8 +582,8 @@ AC_SUBST(install_sh)]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -590,7 +603,7 @@ AC_DEFUN([AM_MAINTAINER_MODE], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful @@ -701,12 +714,15 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -729,13 +745,14 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -743,13 +760,13 @@ AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -825,12 +842,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -853,13 +872,13 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -868,13 +887,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -896,10 +915,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) diff --git a/libssp/configure b/libssp/configure index bd3f5662c4b..79dff40638b 100755 --- a/libssp/configure +++ b/libssp/configure @@ -636,6 +636,7 @@ CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -2802,11 +2803,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -3757,6 +3758,7 @@ fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3781,6 +3783,7 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -3840,7 +3843,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -6401,7 +6404,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -10650,7 +10660,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10653 "configure" +#line 10663 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10756,7 +10766,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10759 "configure" +#line 10769 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 874eab87fbc..85427ecdcb3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2012-05-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/44516 + * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust + dg-error line number. + +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-05-15 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/53339 @@ -21,8 +31,13 @@ PR libstdc++/53263 * include/debug/safe_iterator.h (__gnu_debug::__base): Move... - * include/debug/functions.h: ... Here. Add debug function - overloads to perform checks on normal iterators when possible. + * include/debug/functions.h: ... Here. + (__check_sorted_aux): Add overload for random access safe + iterators. + (__check_partition_lower_aux): New. + (__check_partition_lower): Use latter. + (__check_partition_upper_aux): New. + (__check_partition_upper): Use latter. * include/debug/macros.h (__glibcxx_check_heap) (__glibcxx_check_heap_pred): Use __gnu_debug::__base on iterator range. diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 6c2e2fd11a6..ae2d723b40b 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -7119,7 +7119,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -11497,7 +11504,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11500 "configure" +#line 11507 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11603,7 +11610,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11606 "configure" +#line 11613 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14961,7 +14968,7 @@ fi # # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. cat > conftest.$ac_ext << EOF -#line 14964 "configure" +#line 14971 "configure" struct S { ~S(); }; void bar(); void foo() @@ -15296,7 +15303,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 15299 "configure" +#line 15306 "configure" int main() { typedef bool atomic_type; @@ -15331,7 +15338,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15334 "configure" +#line 15341 "configure" int main() { typedef short atomic_type; @@ -15366,7 +15373,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15369 "configure" +#line 15376 "configure" int main() { // NB: _Atomic_word not necessarily int. @@ -15402,7 +15409,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15405 "configure" +#line 15412 "configure" int main() { typedef long long atomic_type; @@ -15481,7 +15488,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 15484 "configure" +#line 15491 "configure" int main() { _Decimal32 d1; @@ -15523,7 +15530,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 15526 "configure" +#line 15533 "configure" template<typename T1, typename T2> struct same { typedef T2 type; }; @@ -15557,7 +15564,7 @@ $as_echo "$enable_int128" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15560 "configure" +#line 15567 "configure" template<typename T1, typename T2> struct same { typedef T2 type; }; diff --git a/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc b/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc index d2694e29c4c..a6881dbcf82 100644 --- a/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc +++ b/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc @@ -2,7 +2,7 @@ // { dg-options "-std=gnu++0x" } // { dg-require-cstdint "" } -// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation +// Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -51,5 +51,5 @@ test04() // { dg-error "required from here" "" { target *-*-* } 46 } // { dg-error "denominator cannot be zero" "" { target *-*-* } 265 } // { dg-error "out of range" "" { target *-*-* } 266 } -// { dg-error "overflow in constant expression" "" { target *-*-* } 61 } +// { dg-error "overflow in constant expression" "" { target *-*-* } 62 } // { dg-prune-output "not a member" } diff --git a/libtool.m4 b/libtool.m4 index 67321a7d070..a7f99ac7dbc 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -1232,7 +1232,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog index ad2be69f642..401884df694 100644 --- a/lto-plugin/ChangeLog +++ b/lto-plugin/ChangeLog @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-02-22 Kai Tietz <ktietz@redhat.com> PR lto/50616 diff --git a/lto-plugin/Makefile.in b/lto-plugin/Makefile.in index 0c8d89fc7e2..dd5c0846348 100644 --- a/lto-plugin/Makefile.in +++ b/lto-plugin/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -18,6 +18,23 @@ # Makefile.am is used by automake 1.11 to generate Makefile.in. VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -80,6 +97,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(libexecsubdir)" LTLIBRARIES = $(libexecsub_LTLIBRARIES) am_liblto_plugin_la_OBJECTS = lto-plugin.lo @@ -100,6 +123,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(liblto_plugin_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags ACLOCAL = @ACLOCAL@ @@ -253,7 +281,7 @@ all: config.h .SUFFIXES: .SUFFIXES: .c .lo .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -289,10 +317,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -306,7 +332,6 @@ distclean-hdr: -rm -f config.h stamp-h1 install-libexecsubLTLIBRARIES: $(libexecsub_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libexecsubdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecsubdir)" @list='$(libexecsub_LTLIBRARIES)'; test -n "$(libexecsubdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -314,6 +339,8 @@ install-libexecsubLTLIBRARIES: $(libexecsub_LTLIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libexecsubdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libexecsubdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libexecsubdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libexecsubdir)"; \ } @@ -335,7 +362,7 @@ clean-libexecsubLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -liblto_plugin.la: $(liblto_plugin_la_OBJECTS) $(liblto_plugin_la_DEPENDENCIES) +liblto_plugin.la: $(liblto_plugin_la_OBJECTS) $(liblto_plugin_la_DEPENDENCIES) $(EXTRA_liblto_plugin_la_DEPENDENCIES) $(liblto_plugin_la_LINK) -rpath $(libexecsubdir) $(liblto_plugin_la_OBJECTS) $(liblto_plugin_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -430,10 +457,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/lto-plugin/aclocal.m4 b/lto-plugin/aclocal.m4 index ce9a5c2e428..6df1c8eda40 100644 --- a/lto-plugin/aclocal.m4 +++ b/lto-plugin/aclocal.m4 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,12 +20,15 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,19 +54,21 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -144,14 +150,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -191,6 +197,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -255,7 +262,7 @@ AC_CACHE_CHECK([dependency style of $depcc], break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -320,10 +327,13 @@ AC_DEFUN([AM_DEP_TRACK], if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -545,12 +555,15 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -569,8 +582,8 @@ AC_SUBST(install_sh)]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -590,7 +603,7 @@ AC_DEFUN([AM_MAINTAINER_MODE], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful @@ -701,12 +714,15 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -729,13 +745,14 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -743,13 +760,13 @@ AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -825,12 +842,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -853,13 +872,13 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -868,13 +887,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -896,10 +915,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) diff --git a/lto-plugin/configure b/lto-plugin/configure index 7f1ade113a1..a119f1dc1bc 100755 --- a/lto-plugin/configure +++ b/lto-plugin/configure @@ -626,6 +626,7 @@ ac_lto_plugin_warn_cflags am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -2855,11 +2856,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -3704,6 +3705,7 @@ fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3728,6 +3730,7 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -3787,7 +3790,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -6060,7 +6063,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -10544,7 +10554,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10547 "configure" +#line 10557 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10650,7 +10660,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10653 "configure" +#line 10663 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/zlib/ChangeLog.gcj b/zlib/ChangeLog.gcj index 8cce45d3023..b2c00395077 100644 --- a/zlib/ChangeLog.gcj +++ b/zlib/ChangeLog.gcj @@ -1,3 +1,7 @@ +2012-05-16 H.J. Lu <hongjiu.lu@intel.com> + + * configure: Regenerated. + 2012-03-02 Matthias Klose <doko@ubuntu.com> * Imported zlib 1.2.5; merged local changes. diff --git a/zlib/Makefile.in b/zlib/Makefile.in index f5ef37a647f..b8d7a857c0b 100644 --- a/zlib/Makefile.in +++ b/zlib/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,6 +17,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -77,6 +94,12 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(toolexeclibdir)" LIBRARIES = $(toolexeclib_LIBRARIES) ARFLAGS = cru @@ -120,6 +143,11 @@ MULTIDIRS = MULTISUBDIR = MULTIDO = true MULTICLEAN = true +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags ACLOCAL = @ACLOCAL@ @@ -302,7 +330,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -338,7 +366,6 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): install-toolexeclibLIBRARIES: $(toolexeclib_LIBRARIES) @$(NORMAL_INSTALL) - test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" @list='$(toolexeclib_LIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -346,6 +373,8 @@ install-toolexeclibLIBRARIES: $(toolexeclib_LIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \ echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \ $(INSTALL_DATA) $$list2 "$(DESTDIR)$(toolexeclibdir)" || exit $$?; } @$(POST_INSTALL) @@ -362,13 +391,11 @@ uninstall-toolexeclibLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(toolexeclib_LIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(toolexeclibdir)' && rm -f "$$files" )"; \ - cd "$(DESTDIR)$(toolexeclibdir)" && rm -f $$files + dir='$(DESTDIR)$(toolexeclibdir)'; $(am__uninstall_files_from_dir) clean-toolexeclibLIBRARIES: -test -z "$(toolexeclib_LIBRARIES)" || rm -f $(toolexeclib_LIBRARIES) -libz.a: $(libz_a_OBJECTS) $(libz_a_DEPENDENCIES) +libz.a: $(libz_a_OBJECTS) $(libz_a_DEPENDENCIES) $(EXTRA_libz_a_DEPENDENCIES) -rm -f libz.a $(libz_a_AR) libz.a $(libz_a_OBJECTS) $(libz_a_LIBADD) $(RANLIB) libz.a @@ -381,7 +408,7 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libzgcj_convenience.la: $(libzgcj_convenience_la_OBJECTS) $(libzgcj_convenience_la_DEPENDENCIES) +libzgcj_convenience.la: $(libzgcj_convenience_la_OBJECTS) $(libzgcj_convenience_la_DEPENDENCIES) $(EXTRA_libzgcj_convenience_la_DEPENDENCIES) $(LINK) $(am_libzgcj_convenience_la_rpath) $(libzgcj_convenience_la_OBJECTS) $(libzgcj_convenience_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -583,10 +610,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/zlib/aclocal.m4 b/zlib/aclocal.m4 index b79c9352073..3e7b9754f23 100644 --- a/zlib/aclocal.m4 +++ b/zlib/aclocal.m4 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,12 +20,15 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,19 +54,21 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -144,14 +150,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -191,6 +197,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -255,7 +262,7 @@ AC_CACHE_CHECK([dependency style of $depcc], break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -320,10 +327,13 @@ AC_DEFUN([AM_DEP_TRACK], if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -545,12 +555,15 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -569,8 +582,8 @@ AC_SUBST(install_sh)]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -590,7 +603,7 @@ AC_DEFUN([AM_MAINTAINER_MODE], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful @@ -701,12 +714,15 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -729,13 +745,14 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -743,13 +760,13 @@ AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -825,12 +842,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -853,13 +872,13 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -868,13 +887,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -896,10 +915,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) diff --git a/zlib/configure b/zlib/configure index f7fe2b7bd51..8d51eec30ec 100755 --- a/zlib/configure +++ b/zlib/configure @@ -629,6 +629,7 @@ LIBTOOL am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -2823,11 +2824,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -3752,6 +3753,7 @@ fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3776,6 +3778,7 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -3835,7 +3838,7 @@ else break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -5869,7 +5872,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -10386,7 +10396,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10389 "configure" +#line 10399 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10492,7 +10502,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10495 "configure" +#line 10505 "configure" #include "confdefs.h" #if HAVE_DLFCN_H |