summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-29 09:21:19 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-29 09:21:19 +0000
commit4b5553a3a115a1822c78b95caa6bf9e3836be017 (patch)
tree563fb37c887b47ab52594848d1c3b6adfdf66448
parent074f914ef873c7b7981839045c56aa9ca2256c88 (diff)
downloadgcc-4b5553a3a115a1822c78b95caa6bf9e3836be017.tar.gz
2009-10-29 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 153696 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@153697 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.MELT2
-rw-r--r--gcc/ChangeLog295
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog174
-rw-r--r--gcc/ada/Makefile.rtl3
-rw-r--r--gcc/ada/a-textio.adb156
-rw-r--r--gcc/ada/a-textio.ads50
-rw-r--r--gcc/ada/a-witeio.adb153
-rw-r--r--gcc/ada/a-witeio.ads53
-rw-r--r--gcc/ada/a-ztexio.adb147
-rw-r--r--gcc/ada/a-ztexio.ads68
-rw-r--r--gcc/ada/adaint.c22
-rw-r--r--gcc/ada/ali.adb2
-rw-r--r--gcc/ada/checks.adb9
-rw-r--r--gcc/ada/exp_aggr.adb2
-rw-r--r--gcc/ada/exp_attr.adb22
-rw-r--r--gcc/ada/exp_ch3.adb134
-rw-r--r--gcc/ada/exp_ch4.adb142
-rw-r--r--gcc/ada/exp_ch4.ads9
-rw-r--r--gcc/ada/exp_ch9.adb17
-rw-r--r--gcc/ada/exp_ch9.ads4
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in451
-rw-r--r--gcc/ada/gcc-interface/decl.c24
-rw-r--r--gcc/ada/gnat_rm.texi42
-rw-r--r--gcc/ada/gnat_ugn.texi27
-rw-r--r--gcc/ada/gnatbind.adb24
-rw-r--r--gcc/ada/init.c10
-rw-r--r--gcc/ada/make.adb2
-rw-r--r--gcc/ada/makeutl.adb31
-rw-r--r--gcc/ada/par-ch4.adb84
-rw-r--r--gcc/ada/prj-err.adb13
-rw-r--r--gcc/ada/prj-nmsc.adb318
-rw-r--r--gcc/ada/prj-part.adb34
-rw-r--r--gcc/ada/prj-tree.adb5
-rw-r--r--gcc/ada/raise-gcc.c34
-rw-r--r--gcc/ada/s-crtl.ads3
-rw-r--r--gcc/ada/s-fileio.adb295
-rw-r--r--gcc/ada/s-fileio.ads74
-rwxr-xr-xgcc/ada/s-os_lib.adb68
-rwxr-xr-xgcc/ada/s-os_lib.ads23
-rw-r--r--gcc/ada/sem_aggr.adb141
-rw-r--r--gcc/ada/sem_attr.adb11
-rw-r--r--gcc/ada/sem_ch12.adb38
-rw-r--r--gcc/ada/sem_ch3.adb12
-rw-r--r--gcc/ada/sem_res.adb7
-rw-r--r--gcc/ada/sem_type.adb14
-rw-r--r--gcc/ada/sem_util.adb175
-rw-r--r--gcc/ada/sem_util.ads9
-rw-r--r--gcc/ada/sem_warn.adb137
-rw-r--r--gcc/ada/sem_warn.ads5
-rw-r--r--gcc/ada/styleg.adb7
-rw-r--r--gcc/ada/tbuild.adb53
-rw-r--r--gcc/ada/tbuild.ads7
-rw-r--r--gcc/ada/types.ads2
-rw-r--r--gcc/alias.c7
-rw-r--r--gcc/bb-reorder.c6
-rw-r--r--gcc/builtins.c3
-rw-r--r--gcc/c-typeck.c5
-rw-r--r--gcc/cgraphunit.c5
-rw-r--r--gcc/combine.c51
-rw-r--r--gcc/common.opt3
-rw-r--r--gcc/config/arm/arm.c14
-rw-r--r--gcc/config/arm/arm.md70
-rw-r--r--gcc/config/i386/i386.c5
-rw-r--r--gcc/config/i386/mingw.opt4
-rw-r--r--gcc/config/i386/mingw32.h2
-rw-r--r--gcc/config/mips/mips.c53
-rw-r--r--gcc/config/sh/sh.md13
-rw-r--r--gcc/cp/ChangeLog25
-rw-r--r--gcc/cp/call.c25
-rw-r--r--gcc/cp/class.c3
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/decl.c11
-rw-r--r--gcc/cp/mangle.c2
-rw-r--r--gcc/cp/name-lookup.c178
-rw-r--r--gcc/cp/parser.c20
-rw-r--r--gcc/cp/pt.c13
-rw-r--r--gcc/cp/semantics.c69
-rw-r--r--gcc/dbxout.c3
-rw-r--r--gcc/df-problems.c23
-rw-r--r--gcc/doc/invoke.texi21
-rw-r--r--gcc/doc/tm.texi6
-rw-r--r--gcc/dwarf2out.c3
-rw-r--r--gcc/expmed.c24
-rw-r--r--gcc/final.c10
-rw-r--r--gcc/fold-const.c2
-rw-r--r--gcc/fortran/ChangeLog11
-rw-r--r--gcc/fortran/resolve.c3
-rw-r--r--gcc/fortran/trans-common.c5
-rw-r--r--gcc/gcc.c10
-rw-r--r--gcc/gimple.c66
-rw-r--r--gcc/ifcvt.c13
-rw-r--r--gcc/ipa-struct-reorg.c14
-rw-r--r--gcc/opts.c4
-rw-r--r--gcc/recog.c64
-rw-r--r--gcc/sched-rgn.c6
-rw-r--r--gcc/target-def.h2
-rw-r--r--gcc/target.h3
-rw-r--r--gcc/targhooks.c10
-rw-r--r--gcc/targhooks.h1
-rw-r--r--gcc/testsuite/ChangeLog156
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C1
-rw-r--r--gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C2
-rw-r--r--gcc/testsuite/g++.dg/lookup/using16.C2
-rw-r--r--gcc/testsuite/gcc.dg/torture/ipa-pta-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-25.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-109.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-26.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-27.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-28.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-29.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-33.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-44.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-48.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-50.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-52.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-54.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-56.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-58.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-60.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-70.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-72.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-87.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-88.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-89.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-91.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-92.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-93.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-95.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-96.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c4
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect-2.f907
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect-3.f906
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect-4.f905
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect-5.f905
-rw-r--r--gcc/testsuite/gnat.dg/null_pointer_deref1.adb2
-rw-r--r--gcc/testsuite/gnat.dg/null_pointer_deref2.adb2
-rw-r--r--gcc/tree-complex.c4
-rw-r--r--gcc/tree-eh.c100
-rw-r--r--gcc/tree-ssa-alias.c28
-rw-r--r--gcc/tree-ssa-structalias.c227
-rw-r--r--gcc/tree-ssa.c5
-rw-r--r--gcc/tree-vect-data-refs.c6
-rw-r--r--gcc/tree.c37
-rw-r--r--gcc/var-tracking.c5
-rw-r--r--libgomp/ChangeLog4
-rw-r--r--libstdc++-v3/ChangeLog13
-rw-r--r--libstdc++-v3/include/bits/stl_iterator_base_funcs.h8
-rw-r--r--libstdc++-v3/include/parallel/multiseq_selection.h28
-rw-r--r--lto-plugin/ChangeLog11
-rwxr-xr-xlto-plugin/configure430
-rw-r--r--lto-plugin/configure.ac2
-rw-r--r--lto-plugin/lto-plugin.c10
175 files changed, 3691 insertions, 2185 deletions
diff --git a/ChangeLog.MELT b/ChangeLog.MELT
index b30546b9ac7..852cd94a175 100644
--- a/ChangeLog.MELT
+++ b/ChangeLog.MELT
@@ -1,3 +1,5 @@
+2009-10-29 Basile Starynkevitch <basile@starynkevitch.net>
+ MELT branch merged with trunk rev 153696
2009-10-27 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 153581
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3014db71c12..98d35a30adf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,216 @@
+2009-10-29 Chao-ying Fu <fu@mips.com>
+
+ * config/mips/mips.c (mips_emit_unary, mips_force_unary): New
+ functions.
+ (mips_expand_synci_loop): Use the length rtx to control the
+ synci loop from the begin rtx that points to the first byte of
+ the cache line.
+
+2009-10-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * doc/invoke.texi: Rename -use-linker-plugin -fuse-linker-plugin.
+
+2009-10-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * dbxout.c (dbxout_common_check): Accept non public trees.
+ * dwarf2out.c (fortran_common): Accept non public trees.
+
+2009-10-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * common.opt (fuse-linker-plugin): New option.
+ * gcc.c (LINK_COMMAND_SPEC, main): Rename use-linker-plugin to
+ fuse-linker-plugin.
+ * opts.c (common_handle_option): Ignore OPT_fuse_linker_plugin.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/39715
+ * config/arm/arm.md (cstoresi4): Use gen_cstoresi_ltu_thumb1.
+ (gen_cstoresi_ltu_thumb1): New splitter.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41808
+ PR lto/41839
+ * tree-ssa.c (useless_type_conversion_p): Do not treat
+ conversions to pointers to incomplete types as useless.
+ * gimple.c (gimple_types_compatible_p): Compare struct tags,
+ not typedef names.
+
+2009-10-28 Jakub Jelinek <jakub@redhat.com>
+
+ * var-tracking.c (emit_note_insn_var_location): Don't call the second
+ vt_expand_loc unnecessarily when location is not a register nor
+ memory.
+
+ PR middle-end/41837
+ * ipa-struct-reorg.c (find_field_in_struct_1): Return NULL if
+ fields don't have DECL_NAME.
+
+ PR debug/41801
+ * builtins.c (get_builtin_sync_mem): Expand loc in ptr_mode,
+ call convert_memory_address on addr.
+
+ PR target/41762
+ * config/i386/i386.c (ix86_pic_register_p): Don't call
+ rtx_equal_for_cselib_p for VALUEs discarded as useless.
+
+2009-10-28 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * var-tracking.c (emit_note_insn_var_location): Get the mode of
+ a variable part from its REG, MEM or VALUE.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (gimple_get_alias_set): Fix comment typo.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ * tree.c (free_lang_data_in_type): Do not call get_alias_set.
+ (free_lang_data): Unconditionally compute alias sets for all
+ standard integer types. Bail out if gate bailed out previously.
+ Do not reset the types_compatible_p langhook.
+ (gate_free_lang_data): Remove.
+ (struct pass_ipa_free_lang_data): Enable unconditionally.
+ * gimple.c (gimple_get_alias_set): Use the same alias-set for
+ all pointer types.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/41855
+ * tree-ssa-alias.c (refs_may_alias_p_1): Deal with CONST_DECLs
+ (ref_maybe_used_by_call_p_1): Fix bcopy handling.
+ (call_may_clobber_ref_p_1): Likewise.
+ * tree-ssa-structalias.c (find_func_aliases): Likewise.
+ * alias.c (nonoverlapping_memrefs_p): Deal with CONST_DECLs.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/41812
+
+ Revert:
+ 2009-06-27 Paolo Bonzini <bonzini@gnu.org>
+
+ * df-problems.c (df_md_scratch): New.
+ (df_md_alloc, df_md_free): Allocate/free it.
+ (df_md_local_compute): Only include live registers in init.
+ (df_md_transfer_function): Prune the in-set computed by
+ the confluence function, and the gen-set too.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/39715
+ * combine.c (simplify_comparison): Use extensions to
+ widen comparisons. Try an ANDing first.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/40741
+ * config/arm/arm.c (thumb1_rtx_costs): IOR or XOR with
+ a small constant is cheap.
+ * config/arm/arm.md (andsi3, iorsi3): Try to place the result of
+ force_reg on the LHS.
+ (xorsi3): Likewise, and split the XOR if the constant is complex
+ and not in Thumb mode.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ * expmed.c (emit_store_flag): Check costs before
+ transforming to the opposite representation.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ * config/sh/sh.md (cbranchfp4_media): Remove hack extending
+ cstore result to DImode.
+
+2009-10-28 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.md (stuff_delay_slot): Move const_int pattern
+ inside the unspec vector.
+
+2009-10-27 Richard Henderson <rth@redhat.com>
+
+ * cgraphunit.c (cgraph_optimize): Maintain timevar stack properly.
+
+2009-10-27 Richard Henderson <rth@redhat.com>
+
+ PR c++/41819
+ * tree-eh.c (eh_region_may_contain_throw_map): Rename from
+ eh_region_may_contain_throw; update users.
+ (eh_region_may_contain_throw): New function.
+ (lower_catch): Check flag_exceptions before creating exception region.
+ (lower_eh_filter, lower_eh_must_not_throw): Likewise.
+ (lower_cleanup): Tidy existing flag_exceptions check to match.
+
+2009-10-27 Kai Tietz <kai.tietz@onevision.com>
+
+ PR/41799
+ * config/i386/mingw32.h (CHECK_EXECUTE_STACK_ENABLED): New macro.
+ * config/i386/mingw.opt: Add fset-stack-executable.
+ * config/i386/i386.c (ix86_trampoline_init): Make call to
+ emit_library_call conditional, if CHECK_EXECUTE_STACK_ENABLED is
+ defined and its value is not zero.
+ * doc/invoke.texi
+
+2009-10-27 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-structalias.c (find_func_aliases): In IPA mode
+ handle calls to externally visible functions like in regular mode.
+ (create_variable_info_for): Do not create function infos here.
+ (have_alias_info): Remove write-only variable.
+ (solve_constraints): New function split out from common code
+ in compute_points_to_sets and ipa_pta_execute.
+ (compute_points_to_sets): Adjust.
+ (ipa_pta_execute): Likewise. Handle clones and externally visible
+ functions like in non-IPA mode.
+
+2009-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/41842
+ * c-typeck.c (convert_arguments): Return -1 if any of the arguments is
+ error_mark_node.
+
+2009-10-27 Richard Guenther <rguenther@suse.de>
+
+ * tree-complex.c (expand_complex_div_wide): Check for
+ INTEGER_CST, not TREE_CONSTANT on comparison folding result.
+
+2009-10-27 Revital Eres <eres@il.ibm.com>
+
+ PR tree-optimization/40648
+ * tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
+ Change decision of when to peel for alignment.
+
+2009-10-27 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41821
+ * gimple.c (gimple_types_compatible_p): Handle OFFSET_TYPE.
+
+2009-10-27 Aldy Hernandez <aldyh@redhat.com>
+
+ PR bootstrap/41451
+ * fold-const.c (fold_binary_loc): Do not call
+ protected_set_expr_location.
+
+2009-10-27 Wei Guozhi <carrot@google.com>
+
+ PR target/41705
+ * target.h (have_conditional_execution): Add a new target hook
+ function.
+ * target-def.h (TARGET_HAVE_CONDITIONAL_EXECUTION): Likewise.
+ * targhooks.h (default_have_conditional_execution): Likewise.
+ * targhooks.c (default_have_conditional_execution): Likewise.
+ * doc/tm.texi (TARGET_HAVE_CONDITIONAL_EXECUTION): Document it.
+ * config/arm/arm.c (TARGET_HAVE_CONDITIONAL_EXECUTION): Define it.
+ (arm_have_conditional_execution): New function.
+ * ifcvt.c (noce_process_if_block, find_if_header,
+ cond_exec_find_if_block, dead_or_predicable): Change the usage of
+ macro HAVE_conditional_execution to a target hook call.
+ * recog.c (peephole2_optimize): Likewise.
+ * sched-rgn.c (add_branch_dependences): Likewise.
+ * final.c (asm_insn_count, final_scan_insn): Likewise.
+ * bb-reorder.c (HAVE_conditional_execution): Remove it.
+
2009-10-26 Ben Elliston <bje@au.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com>
Ulrich Weigand <uweigand@de.ibm.com>
@@ -165,7 +378,7 @@
(expand_expr_addr_expr): Likewise.
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise.
* cfgexpand.c (expand_debug_expr): Likewise.
-
+
* auto-inc-dec.c: Include "target.h".
(try_merge): Use appropriate address mode instead of Pmode.
(find_inc): Likewise.
@@ -208,7 +421,7 @@
(multiplier_allowed_in_address_p): Likewise.
(get_address_cost): Likewise.
* varasm.c (make_decl_rtl): Likewise.
-
+
* expr.c (expand_assignment): Always convert offsets to appropriate
address mode.
(store_expr): Likewise.
@@ -219,7 +432,7 @@
* reload.c (form_sum): Add MODE argument, use it instead of Pmode.
Update recursive calls.
(subst_indexed_address): Update calls to form_sum.
-
+
* tree-flow.h (addr_for_mem_ref): Add ADDRSPACE argument.
* tree-ssa-address.c: Include "target.h".
(templates): Replace by ...
@@ -230,7 +443,7 @@
instead of global cache. Update call to gen_addr_rtx.
(valid_mem_ref_p): Update call to addr_for_mem_ref.
* expr.c (expand_expr_real_1): Update call to addr_for_mem_ref.
-
+
* rtl.h (convert_memory_address_addr_space): Add prototype.
(convert_memory_address): Define as macro.
* explow.c (convert_memory_address): Rename to ...
@@ -543,8 +756,8 @@
* ipa-reference.c (check_call): Noreturn notrhow calls do not write
to memory.
- (analyze_function): When analyzing noreturn nothrow call, do not compute
- written stats; free bitmaps of vars early if possible.
+ (analyze_function): When analyzing noreturn nothrow call, do not
+ compute written stats; free bitmaps of vars early if possible.
(generate_summary): Only update bitmaps if computed.
(propagate): Only dump bitmaps if computed.
(ipa_reference_read_summary): Fix pasto.
@@ -638,7 +851,7 @@
(m32c_function_value): Make static, add new 'outgoing' argument.
(m32c_libcall_value): Make static, add new 'fun' argument.
(TARGET_FUNCTION_VALUE, TARGET_LIBCALL_VALUE): Declare.
- * config/m32c/m32c.h: (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
+ * config/m32c/m32c.h (FUNCTION_VALUE, LIBCALL_VALUE): Remove.
(FUNCTION_VALUE_REGNO_P): Redefine, use m32c_function_value_regno_p.
* config/m32c/m32c-protos.h (m32c_function_value_regno_p): Declare.
(m32c_function_value, m32c_libcall_value): Delete declaration.
@@ -648,10 +861,7 @@
* Makefile.in (PLUGIN_HEADERS): Add output.h and IPA_UTILS_H.
2009-10-22 Razya Ladelsky <razya@il.ibm.com>
-
- * testsuite/gcc.dg/autopar/outer-4.c: Adjust scan.
- * testsuite/gcc.dg/autopar/outer-5.c: Adjust scan.
- * testsuite/gcc.dg/autopar/outer-5.c: Add scan optimized.
+
* tree-cfg.c (gimple_duplicate_sese_tail): Fix typos/indentation/white
space.
@@ -675,30 +885,23 @@
* lto-streamer-in.c (lto_input_location): Likewise.
2009-10-22 Razya Ladelsky <razya@il.ibm.com>
-
- * cfgloopmanip.c (duplicate_subloops): Export.
+
+ * cfgloopmanip.c (duplicate_subloops): Export.
* tree-parloops.c (loop_parallel_p): Dump if loop is innermost.
- (transform_to_exit_first_loop): Duplicate bbs starting from
+ (transform_to_exit_first_loop): Duplicate bbs starting from
header up to loop->latch instead of exit->src.
Initialize control variable to the correct number of iterations.
(gather_scalar_reductions): Do not register double reductions.
- (parallelize_loops): Dump which loop is tested.
- Indicate whether the parallelized loop is inner or not.
+ (parallelize_loops): Dump which loop is tested.
+ Indicate whether the parallelized loop is inner or not.
Remove the innermost-loop requirement.
- * cfgloop.h (duplicate_subloops): Export.
+ * cfgloop.h (duplicate_subloops): Export.
* tree-cfg.c (add_phi_args_after_redirect): New function.
(gimple_duplicate_sese_tail): Remove the no-subloops constraint.
Call duplicate_subloops.
Update number of iterations at the exit condition.
Don't redirect nexits always to the loop exit.
Redirect copied edges from latch to the loop exit.
- * testsuite/libgomp.graphite/force-parallel-2.c: Adjust scan.
- * testsuite/gcc.dg/autopar/outer-1.c: New testcase.
- * testsuite/gcc.dg/autopar/outer-2.c: New testcase.
- * testsuite/gcc.dg/autopar/outer-3.c: New testcase.
- * testsuite/gcc.dg/autopar/outer-4.c: New testcase.
- * testsuite/gcc.dg/autopar/outer-5.c: New testcase.
- * testsuite/gcc.dg/autopar/outer-6.c: New testcase.
2009-10-22 Jan Hubicka <jh@suse.cz>
@@ -706,10 +909,10 @@
flag_ltrans check.
* ipa-inline.c (cgraph_mark_inline_edge,
cgraph_decide_inlining_of_small_function,
- cgraph_decide_inlining, inline_read_summary): Disable indirect inlining
- for WPA for time being.
+ cgraph_decide_inlining, inline_read_summary): Disable indirect
+ inlining for WPA for time being.
- PR tree-optimize/40556
+ PR tree-optimize/40556
* ipa-inline.c (cgraph_early_inlining): Fix iterations condition.
2009-10-22 Richard Guenther <rguenther@suse.de>
@@ -729,8 +932,8 @@
(ipa_reference_read_summary): Stream in calls_read_all properly.
(read_write_all_from_decl): New function.
(propagate): Handle OVERWRITABLE nodes and external calls here.
- * ipa-pre-const.c (check_call): In IPA mode handle indirect calls
- only.
+ * ipa-pre-const.c (check_call): In IPA mode handle indirect
+ calls only.
(analyze_function): Do not check visibility here.
(add_new_function): We summary OVERWRITABLE too.
(generate_summary): Stream OVERWRITABLE nodes too.
@@ -744,10 +947,11 @@
(ipcp_init_stage): Analyze all functions for whopr/lto.
(ipcp_propagate_stage): Skip external calls.
(ipcp_iterate_stage): Call ipa_update_after_lto_read if needed.
- * ipa-reference.c (write_node_summary_p): Fix thinko about availability.
+ * ipa-reference.c (write_node_summary_p): Fix thinko about
+ availability.
* cgraphunit.c (ipa_passes): When in lto, ne er produce new summaries;
- when in ltrans, skip executing of ipa passes since everything should've
- been done.
+ when in ltrans, skip executing of ipa passes since everything
+ should've been done.
* ipa-inline.c (cgraph_decide_inlining): Remove FIXMEs.
(inline_generate_summary): Likewise.
(inline_read_summary): New function.
@@ -771,9 +975,11 @@
(ipa_edge_args_vector): Move into GGC.
(ipa_check_create_edge_args): Update.
(ipa_update_after_lto_read): New.
- * passes.c (ipa_write_summaries_1): When in wpa, do not write summaries.
+ * passes.c (ipa_write_summaries_1): When in wpa, do not write
+ summaries.
(ipa_read_summaries): When in ltrans, so not read summaries.
- * lto-streamer.c (lto_get_section_name): Add LTO_section_jump_functions.
+ * lto-streamer.c (lto_get_section_name): Add
+ LTO_section_jump_functions.
* lto-streamer.h (LTO_section_jump_functions): New section.
(produce_asm): Declare.
* lto-cgraph.c (output_cgraph): Output edges in reverse order.
@@ -796,7 +1002,7 @@
* config/ia64/ia64.c (ia64_override_options): Set
flag_ira_loop_pressure up for -O3.
* config/rs6000/rs6000.c (rs6000_override_options): Ditto.
-
+
2009-10-21 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/41497
@@ -934,9 +1140,8 @@
2009-10-20 Wolfgang Gellerich <gellerich@de.ibm.com>
* config/s390/s390.md: Added agen condition to operand
- forwarding bypasses.
- Added bypass for early address generation use of int results.
- Updated comments.
+ forwarding bypasses. Added bypass for early address generation
+ use of int results. Updated comments.
2009-10-20 Stefan Dösinger <stefan@codeweavers.com>
@@ -1194,10 +1399,10 @@
PR target/23983
* config/rs6000/predicates.md: Update copyright year.
* config/rs6000/altivec.md: Ditto.
-
+
* config/rs6000/t-rs6000 (TM_H): Add rs6000-builtin.def.
(MD_INCLUDES): Add a2.md.
-
+
* config/rs6000/rs6000.c (rs6000_builtin_decls): Change
RS6000_BUILTIN_COUNT to MAX_RS6000_BUILTINS.
(builtin_classify): New static vector to classify various builtins
@@ -1277,7 +1482,7 @@
* config/arm/neon.md (neon_vshll_n<mode>): Checking Bounds fixed.
2009-10-14 DJ Delorie <dj@redhat.com>
-
+
* config/h8300/h8300.c (F): New.
(Fpa): New.
(h8300_emit_stack_adjustment): Call them.
@@ -1370,7 +1575,7 @@
* doc/invoke.texi (-fira-loop-pressure, ira-loop-reserved-regs):
Describe.
* doc/tm.texi (STACK_REG_COVER_CLASS): Describe.
-
+
2009-10-14 Richard Guenther <rguenther@suse.de>
* lto-symtab.c (lto_symtab_compatible): Fold in ...
@@ -9828,11 +10033,6 @@
* calls.c (emit_library_call_value_1): Update call to
hard_libcall_value.
* explow.c (hard_libcall_value): Use new target hook.
- * testsuite/lib/target-supports.exp
- (check_effective_target_arm_hard_vfp_ok): New hook.
- (check_effective_target_arm_neon_ok): Improve test for neon
- availability.
- * testsuite/gcc.target/arm/eabi1.c: Only run test in base variant.
* config/arm/arm.c: Include cgraph.h
(TARGET_FUNCTION_VALUE): Override default hook.
(arm_pcs_default): New variable.
@@ -14938,7 +15138,6 @@
(OMP_CLAUSE_LOCATION): New macro.
(struct tree_omp_clause): Add location field.
(build_omp_clause): Add argument.
- * testsuite/gcc.dg/gomp/for-1.c: Fix column.
* cp/pt.c (tsubst_omp_for_iterator): Pass location to
build_omp_clause.
* cp/parser.c (cp_parser_omp_var_list_no_open): Same.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 3fb5c938e9b..9d4ce67efec 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20091027
+20091029
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index dae8d315f49..218dc32a915 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,177 @@
+2009-10-28 Bob Duff <duff@adacore.com>
+
+ * s-fileio.adb: Give more information in exception messages.
+
+2009-10-28 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Document new -gnatyt requirement for space after right
+ paren if next token starts with digit or letter.
+ * styleg.adb (Check_Right_Paren): New rule for space after if next
+ character is a letter or digit.
+
+2009-10-28 Thomas Quinot <quinot@adacore.com>
+
+ * s-crtl.ads (System.CRTL.strerror): New function.
+
+2009-10-28 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_type.adb: Add guard to recover some type errors.
+
+2009-10-28 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Add_To_Or_Remove_From_List): New name of procedure
+ Add_If_Not_In_List to account to the fact that a directory may be
+ removed from the list. Only remove directory if Removed is True.
+
+2009-10-28 Gary Dismukes <dismukes@adacore.com>
+
+ * a-textio.ads, a-textio.ads: Put back function EOF_Char in private
+ part. Put back body of function EOF_Char.
+ * a-tienau.adb: Remove with of Interfaces.C_Streams and change EOF back
+ to EOF_Char.
+
+2009-10-28 Emmanuel Briot <briot@adacore.com>
+
+ * prj-tree.adb (Free): Fix memory leak.
+
+2009-10-28 Thomas Quinot <quinot@adacore.com>
+
+ * s-fileio.adb: Minor reformatting
+
+2009-10-28 Arnaud Charlet <charlet@adacore.com>
+
+ * gcc-interface/Make-lang.in: Update dependencies.
+
+2009-10-28 Robert Dewar <dewar@adacore.com>
+
+ * exp_attr.adb, exp_ch9.adb, prj-nmsc.adb, tbuild.adb, ali.adb,
+ types.ads: Minor reformatting
+
+2009-10-28 Tristan Gingold <gingold@adacore.com>
+
+ * init.c: Fix __gnat_error_handler for Darwin10 (Snow Leopard)
+
+2009-10-28 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Type_Conversion): Perform Integer promotion for
+ the operand of the unary minus and ABS operators.
+
+ * sem_type.adb (Covers): A concurrent type and its corresponding record
+ type are compatible.
+ * exp_attr.adb (Expand_N_Attribute_Reference): Do not rewrite a 'Access
+ attribute reference for the current instance of a protected type while
+ analyzing an access discriminant constraint in a component definition.
+ Such a reference is handled in the corresponding record's init proc,
+ while initializing the constrained component.
+ * exp_ch9.adb (Expand_N_Protected_Type_Declaration): When creating the
+ corresponding record type, propagate components'
+ Has_Per_Object_Constraint flag.
+ * exp_ch3.adb (Build_Init_Procedure.Build_Init_Statements):
+ For a concurrent type, set up concurrent aspects before initializing
+ components with a per object constrain, because they may be controlled,
+ and their initialization may call entries or protected subprograms of
+ the enclosing concurrent object.
+
+2009-10-28 Emmanuel Briot <briot@adacore.com>
+
+ * prj-nmsc.adb (Add_If_Not_In_List): New subprogram, for better sharing
+ of code.
+ (Find_Source_Dirs): resolve links if Opt.Follow_Links_For_Dirs when
+ processing the directories specified explicitly in the project file.
+
+2009-10-28 Robert Dewar <dewar@adacore.com>
+
+ * a-ztexio.adb, a-ztexio.ads, a-witeio.ads, a-witeio.adb,
+ a-textio.ads, a-textio.adb: Reorganize (moving specs from private part
+ to body).
+ (Initialize_Standard_Files): New procedure.
+ * a-tienau.adb: Minor change to make EOF directly visible
+ * a-tirsfi.ads, a-wrstfi.adb, a-wrstfi.ads, a-zrstfi.adb,
+ a-zrstfi.ads, a-tirsfi.adb: New unit, initial version.
+ * gnat_rm.texi: Add documentation for
+ Ada.[Wide_[Wide_]]Text_IO.Reset_Standard_Files.
+ * Makefile.rtl: Add entries for
+ Ada.[Wide_[Wide_]]Text_IO.Reset_Standard_Files
+
+2009-10-28 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch9.ads: Minor reformatting
+ * sem_ch3.adb: Minor reformatting
+ * sem_aggr.adb: Minor reformatting.
+ * sem_attr.adb: Minor reformatting
+ * tbuild.adb, tbuild.ads, par-ch4.adb, exp_ch4.adb (Tbuild.New_Op_Node):
+ New subprogram.
+ Minor code reorganization/factoring.
+
+2009-10-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (purpose_member_field): New static function.
+ (annotate_rep): Use it instead of purpose_member.
+
+2009-10-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * raise-gcc (db_region_for): Use _Unwind_GetIPInfo instead of
+ _Unwind_GetIP if HAVE_GETIPINFO is defined.
+ (db_action_for): Likewise.
+
+2009-10-27 Robert Dewar <dewar@adacore.com>
+
+ * s-fileio.adb, s-fileio.ads, sem_util.adb, sem_warn.adb,
+ sem_warn.ads: Minor reformatting
+
+2009-10-27 Robert Dewar <dewar@adacore.com>
+
+ * sem_warn.adb, sem_util.adb, sem_util.ads: Minor reformatting. Add
+ comments.
+
+2009-10-27 Robert Dewar <dewar@adacore.com>
+
+ * s-os_lib.ads, s-os_lib.adb, prj-err.adb, makeutl.adb: Minor
+ reformatting.
+
+2009-10-27 Ed Schonberg <schonberg@adacore.com>
+
+ * sem.util.ads, sem_util.adb (Denotes_Same_Object,
+ Denotes_Same_Prefix): New functions to detect overlap between actuals
+ that are not by-copy in a call, when one of them is in-out.
+ * sem_warn.ads, sem_warn.adb (Warn_On_Overlapping_Actuals): New
+ procedure, called on a subprogram call to warn when an in-out actual
+ that is not by-copy overlaps with another actual, thus leadind to
+ potentially dangerous aliasing in the body of the called subprogram.
+ Currently the warning is under control of the -gnatX switch.
+ * sem_res.adb (resolve_call): call Warn_On_Overlapping_Actuals.
+
+2009-10-27 Thomas Quinot <quinot@adacore.com>
+
+ * sem_ch12.adb (Install_Formal_Packages): Do not omit installation of
+ visible entities when the formal package doesn't have a box.
+
+ * checks.adb: Minor reformatting.
+
+2009-10-27 Vincent Celier <celier@adacore.com>
+
+ * prj-part.adb (Parse): Catch exception Types.Unrecoverable_Error and
+ set Project to Empty_Node.
+
+2009-10-27 Robert Dewar <dewar@adacore.com>
+
+ * gnatbind.adb: Minor reformatting
+
+2009-10-27 Arnaud Charlet <charlet@adacore.com>
+
+ * exp_aggr.adb: Fix comment.
+
+2009-10-27 Emmanuel Briot <briot@adacore.com>
+
+ * prj-err.adb (Error_Msg): take into account continuation lines when
+ computing whether we have a warning.
+
+2009-10-27 Vasiliy Fofanov <fofanov@adacore.com>
+
+ * make.adb, s-os_lib.adb, s-os_lib.ads (Create_Temp_Output_File): New
+ routine that is designed to create temp file descriptor specifically
+ for redirecting an output stream.
+
2009-10-24 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 5f06d1cf2e8..4f26f1569b5 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -258,6 +258,7 @@ GNATRTL_NONTASKING_OBJS= \
a-timoau$(objext) \
a-timoio$(objext) \
a-tiocst$(objext) \
+ a-tirsfi$(objext) \
a-titest$(objext) \
a-tiunio$(objext) \
a-unccon$(objext) \
@@ -265,6 +266,7 @@ GNATRTL_NONTASKING_OBJS= \
a-wichun$(objext) \
a-widcha$(objext) \
a-witeio$(objext) \
+ a-wrstfi$(objext) \
a-wtcoau$(objext) \
a-wtcoio$(objext) \
a-wtcstr$(objext) \
@@ -286,6 +288,7 @@ GNATRTL_NONTASKING_OBJS= \
a-wwunio$(objext) \
a-zchara$(objext) \
a-zchuni$(objext) \
+ a-zrstfi$(objext) \
a-ztcoau$(objext) \
a-ztcoio$(objext) \
a-ztcstr$(objext) \
diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb
index b3a98fcb3ec..ceacfe5b127 100644
--- a/gcc/ada/a-textio.adb
+++ b/gcc/ada/a-textio.adb
@@ -57,15 +57,30 @@ package body Ada.Text_IO is
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
+ -- Default wide character encoding
+
+ Err_Name : aliased String := "*stderr" & ASCII.NUL;
+ In_Name : aliased String := "*stdin" & ASCII.NUL;
+ Out_Name : aliased String := "*stdout" & ASCII.NUL;
+ -- Names of standard files
+ --
+ -- Use "preallocated" strings to avoid calling "new" during the elaboration
+ -- of the run time. This is needed in the tasking case to avoid calling
+ -- Task_Lock too early. A filename is expected to end with a null character
+ -- in the runtime, here the null characters are added just to have a
+ -- correct filename length.
+ --
+ -- Note: the names for these files are bogus, and probably it would be
+ -- better for these files to have no names, but the ACVC tests insist!
+ -- We use names that are bound to fail in open etc.
+
+ Null_Str : aliased constant String := "";
+ -- Used as form string for standard files
-----------------------
-- Local Subprograms --
-----------------------
- function Getc_Immed (File : File_Type) return int;
- -- This routine is identical to Getc, except that the read is done in
- -- Get_Immediate mode (i.e. without waiting for a line return).
-
function Get_Upper_Half_Char
(C : Character;
File : File_Type) return Character;
@@ -82,18 +97,48 @@ package body Ada.Text_IO is
-- This routine is identical to Get_Upper_Half_Char, except that the reads
-- are done in Get_Immediate mode (i.e. without waiting for a line return).
+ function Getc (File : File_Type) return int;
+ -- Gets next character from file, which has already been checked for being
+ -- in read status, and returns the character read if no error occurs. The
+ -- result is EOF if the end of file was read.
+
+ function Getc_Immed (File : File_Type) return int;
+ -- This routine is identical to Getc, except that the read is done in
+ -- Get_Immediate mode (i.e. without waiting for a line return).
+
function Has_Upper_Half_Character (Item : String) return Boolean;
-- Returns True if any of the characters is in the range 16#80#-16#FF#
+ function Nextc (File : File_Type) return int;
+ -- Returns next character from file without skipping past it (i.e. it is a
+ -- combination of Getc followed by an Ungetc).
+
procedure Put_Encoded (File : File_Type; Char : Character);
-- Called to output a character Char to the given File, when the encoding
-- method for the file is other than brackets, and Char is upper half.
+ procedure Putc (ch : int; File : File_Type);
+ -- Outputs the given character to the file, which has already been checked
+ -- for being in output status. Device_Error is raised if the character
+ -- cannot be written.
+
procedure Set_WCEM (File : in out File_Type);
-- Called by Open and Create to set the wide character encoding method for
-- the file, processing a WCEM form parameter if one is present. File is
-- IN OUT because it may be closed in case of an error.
+ procedure Terminate_Line (File : File_Type);
+ -- If the file is in Write_File or Append_File mode, and the current line
+ -- is not terminated, then a line terminator is written using New_Line.
+ -- Note that there is no Terminate_Page routine, because the page mark at
+ -- the end of the file is implied if necessary.
+
+ procedure Ungetc (ch : int; File : File_Type);
+ -- Pushes back character into stream, using ungetc. The caller has checked
+ -- that the file is in read status. Device_Error is raised if the character
+ -- cannot be pushed back. An attempt to push back and end of file character
+ -- (EOF) is ignored.
+
-------------------
-- AFCB_Allocate --
-------------------
@@ -965,6 +1010,52 @@ package body Ada.Text_IO is
return False;
end Has_Upper_Half_Character;
+ -------------------------------
+ -- Initialize_Standard_Files --
+ -------------------------------
+
+ procedure Initialize_Standard_Files is
+ begin
+ Standard_Err.Stream := stderr;
+ Standard_Err.Name := Err_Name'Access;
+ Standard_Err.Form := Null_Str'Unrestricted_Access;
+ Standard_Err.Mode := FCB.Out_File;
+ Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
+ Standard_Err.Is_Temporary_File := False;
+ Standard_Err.Is_System_File := True;
+ Standard_Err.Is_Text_File := True;
+ Standard_Err.Access_Method := 'T';
+ Standard_Err.Self := Standard_Err;
+ Standard_Err.WC_Method := Default_WCEM;
+
+ Standard_In.Stream := stdin;
+ Standard_In.Name := In_Name'Access;
+ Standard_In.Form := Null_Str'Unrestricted_Access;
+ Standard_In.Mode := FCB.In_File;
+ Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
+ Standard_In.Is_Temporary_File := False;
+ Standard_In.Is_System_File := True;
+ Standard_In.Is_Text_File := True;
+ Standard_In.Access_Method := 'T';
+ Standard_In.Self := Standard_In;
+ Standard_In.WC_Method := Default_WCEM;
+
+ Standard_Out.Stream := stdout;
+ Standard_Out.Name := Out_Name'Access;
+ Standard_Out.Form := Null_Str'Unrestricted_Access;
+ Standard_Out.Mode := FCB.Out_File;
+ Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
+ Standard_Out.Is_Temporary_File := False;
+ Standard_Out.Is_System_File := True;
+ Standard_Out.Is_Text_File := True;
+ Standard_Out.Access_Method := 'T';
+ Standard_Out.Self := Standard_Out;
+ Standard_Out.WC_Method := Default_WCEM;
+
+ FIO.Make_Unbuffered (AP (Standard_Out));
+ FIO.Make_Unbuffered (AP (Standard_Err));
+ end Initialize_Standard_Files;
+
-------------
-- Is_Open --
-------------
@@ -2198,20 +2289,8 @@ package body Ada.Text_IO is
end if;
end Write;
- -- Use "preallocated" strings to avoid calling "new" during the
- -- elaboration of the run time. This is needed in the tasking case to
- -- avoid calling Task_Lock too early. A filename is expected to end with a
- -- null character in the runtime, here the null characters are added just
- -- to have a correct filename length.
-
- Err_Name : aliased String := "*stderr" & ASCII.NUL;
- In_Name : aliased String := "*stdin" & ASCII.NUL;
- Out_Name : aliased String := "*stdout" & ASCII.NUL;
-
begin
- -------------------------------
- -- Initialize Standard Files --
- -------------------------------
+ -- Initialize Standard Files
for J in WC_Encoding_Method loop
if WC_Encoding = WC_Encoding_Letters (J) then
@@ -2219,51 +2298,10 @@ begin
end if;
end loop;
- -- Note: the names in these files are bogus, and probably it would be
- -- better for these files to have no names, but the ACVC test insist!
- -- We use names that are bound to fail in open etc.
-
- Standard_Err.Stream := stderr;
- Standard_Err.Name := Err_Name'Access;
- Standard_Err.Form := Null_Str'Unrestricted_Access;
- Standard_Err.Mode := FCB.Out_File;
- Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
- Standard_Err.Is_Temporary_File := False;
- Standard_Err.Is_System_File := True;
- Standard_Err.Is_Text_File := True;
- Standard_Err.Access_Method := 'T';
- Standard_Err.Self := Standard_Err;
- Standard_Err.WC_Method := Default_WCEM;
-
- Standard_In.Stream := stdin;
- Standard_In.Name := In_Name'Access;
- Standard_In.Form := Null_Str'Unrestricted_Access;
- Standard_In.Mode := FCB.In_File;
- Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
- Standard_In.Is_Temporary_File := False;
- Standard_In.Is_System_File := True;
- Standard_In.Is_Text_File := True;
- Standard_In.Access_Method := 'T';
- Standard_In.Self := Standard_In;
- Standard_In.WC_Method := Default_WCEM;
-
- Standard_Out.Stream := stdout;
- Standard_Out.Name := Out_Name'Access;
- Standard_Out.Form := Null_Str'Unrestricted_Access;
- Standard_Out.Mode := FCB.Out_File;
- Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
- Standard_Out.Is_Temporary_File := False;
- Standard_Out.Is_System_File := True;
- Standard_Out.Is_Text_File := True;
- Standard_Out.Access_Method := 'T';
- Standard_Out.Self := Standard_Out;
- Standard_Out.WC_Method := Default_WCEM;
+ Initialize_Standard_Files;
FIO.Chain_File (AP (Standard_In));
FIO.Chain_File (AP (Standard_Out));
FIO.Chain_File (AP (Standard_Err));
- FIO.Make_Unbuffered (AP (Standard_Out));
- FIO.Make_Unbuffered (AP (Standard_Err));
-
end Ada.Text_IO;
diff --git a/gcc/ada/a-textio.ads b/gcc/ada/a-textio.ads
index 9277ccbbae5..d22b2f9c635 100644
--- a/gcc/ada/a-textio.ads
+++ b/gcc/ada/a-textio.ads
@@ -41,6 +41,7 @@
with Ada.IO_Exceptions;
with Ada.Streams;
+
with System;
with System.File_Control_Block;
with System.WCh_Con;
@@ -443,9 +444,6 @@ private
-- The Standard Files --
------------------------
- Null_Str : aliased constant String := "";
- -- Used as name and form of standard files
-
Standard_In_AFCB : aliased Text_AFCB;
Standard_Out_AFCB : aliased Text_AFCB;
Standard_Err_AFCB : aliased Text_AFCB;
@@ -460,47 +458,15 @@ private
Current_Err : aliased File_Type := Standard_Err;
-- Current files
- -----------------------
- -- Local Subprograms --
- -----------------------
-
- -- These subprograms are in the private part of the spec so that they can
- -- be shared by the routines in the body of Ada.Text_IO.Wide_Text_IO.
-
- -- Note: we use Integer in these declarations instead of the more accurate
- -- Interfaces.C_Streams.int, because we do not want to drag in the spec of
- -- this interfaces package with the spec of Ada.Text_IO, and we know that
- -- in fact these types are identical
-
function EOF_Char return Integer;
-- Returns the system-specific character indicating the end of a text file.
-- This is exported for use by child packages such as Enumeration_Aux to
- -- eliminate their needing to depend directly on Interfaces.C_Streams.
-
- function Getc (File : File_Type) return Integer;
- -- Gets next character from file, which has already been checked for
- -- being in read status, and returns the character read if no error
- -- occurs. The result is EOF if the end of file was read.
-
- function Nextc (File : File_Type) return Integer;
- -- Returns next character from file without skipping past it (i.e. it
- -- is a combination of Getc followed by an Ungetc).
-
- procedure Putc (ch : Integer; File : File_Type);
- -- Outputs the given character to the file, which has already been
- -- checked for being in output status. Device_Error is raised if the
- -- character cannot be written.
-
- procedure Terminate_Line (File : File_Type);
- -- If the file is in Write_File or Append_File mode, and the current
- -- line is not terminated, then a line terminator is written using
- -- New_Line. Note that there is no Terminate_Page routine, because
- -- the page mark at the end of the file is implied if necessary.
-
- procedure Ungetc (ch : Integer; File : File_Type);
- -- Pushes back character into stream, using ungetc. The caller has
- -- checked that the file is in read status. Device_Error is raised
- -- if the character cannot be pushed back. An attempt to push back
- -- and end of file character (EOF) is ignored.
+ -- eliminate their needing to depend directly on Interfaces.C_Streams,
+ -- which is not available in certain target environments (such as AAMP).
+
+ procedure Initialize_Standard_Files;
+ -- Initializes the file control blocks for the standard files. Called from
+ -- the elaboration routine for this package, and from Reset_Standard_Files
+ -- in package Ada.Text_IO.Reset_Standard_Files.
end Ada.Text_IO;
diff --git a/gcc/ada/a-witeio.adb b/gcc/ada/a-witeio.adb
index e877405820f..efd5021849d 100644
--- a/gcc/ada/a-witeio.adb
+++ b/gcc/ada/a-witeio.adb
@@ -57,26 +57,62 @@ package body Ada.Wide_Text_IO is
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
+ -- Default wide character encoding
+
+ Err_Name : aliased String := "*stderr" & ASCII.NUL;
+ In_Name : aliased String := "*stdin" & ASCII.NUL;
+ Out_Name : aliased String := "*stdout" & ASCII.NUL;
+ -- Names of standard files
+ --
+ -- Use "preallocated" strings to avoid calling "new" during the elaboration
+ -- of the run time. This is needed in the tasking case to avoid calling
+ -- Task_Lock too early. A filename is expected to end with a null character
+ -- in the runtime, here the null characters are added just to have a
+ -- correct filename length.
+ --
+ -- Note: the names for these files are bogus, and probably it would be
+ -- better for these files to have no names, but the ACVC tests insist!
+ -- We use names that are bound to fail in open etc.
+
+ Null_Str : aliased constant String := "";
+ -- Used as form string for standard files
-----------------------
-- Local Subprograms --
-----------------------
- function Getc_Immed (File : File_Type) return int;
- -- This routine is identical to Getc, except that the read is done in
- -- Get_Immediate mode (i.e. without waiting for a line return).
-
function Get_Wide_Char_Immed
(C : Character;
File : File_Type) return Wide_Character;
-- This routine is identical to Get_Wide_Char, except that the reads are
-- done in Get_Immediate mode (i.e. without waiting for a line return).
+ function Getc_Immed (File : File_Type) return int;
+ -- This routine is identical to Getc, except that the read is done in
+ -- Get_Immediate mode (i.e. without waiting for a line return).
+
+ procedure Putc (ch : int; File : File_Type);
+ -- Outputs the given character to the file, which has already been checked
+ -- for being in output status. Device_Error is raised if the character
+ -- cannot be written.
+
procedure Set_WCEM (File : in out File_Type);
-- Called by Open and Create to set the wide character encoding method for
-- the file, processing a WCEM form parameter if one is present. File is
-- IN OUT because it may be closed in case of an error.
+ procedure Terminate_Line (File : File_Type);
+ -- If the file is in Write_File or Append_File mode, and the current line
+ -- is not terminated, then a line terminator is written using New_Line.
+ -- Note that there is no Terminate_Page routine, because the page mark at
+ -- the end of the file is implied if necessary.
+
+ procedure Ungetc (ch : int; File : File_Type);
+ -- Pushes back character into stream, using ungetc. The caller has checked
+ -- that the file is in read status. Device_Error is raised if the character
+ -- cannot be pushed back. An attempt to push back and end of file character
+ -- (EOF) is ignored.
+
-------------------
-- AFCB_Allocate --
-------------------
@@ -843,6 +879,52 @@ package body Ada.Wide_Text_IO is
return ch;
end Getc_Immed;
+ -------------------------------
+ -- Initialize_Standard_Files --
+ -------------------------------
+
+ procedure Initialize_Standard_Files is
+ begin
+ Standard_Err.Stream := stderr;
+ Standard_Err.Name := Err_Name'Access;
+ Standard_Err.Form := Null_Str'Unrestricted_Access;
+ Standard_Err.Mode := FCB.Out_File;
+ Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
+ Standard_Err.Is_Temporary_File := False;
+ Standard_Err.Is_System_File := True;
+ Standard_Err.Is_Text_File := True;
+ Standard_Err.Access_Method := 'T';
+ Standard_Err.Self := Standard_Err;
+ Standard_Err.WC_Method := Default_WCEM;
+
+ Standard_In.Stream := stdin;
+ Standard_In.Name := In_Name'Access;
+ Standard_In.Form := Null_Str'Unrestricted_Access;
+ Standard_In.Mode := FCB.In_File;
+ Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
+ Standard_In.Is_Temporary_File := False;
+ Standard_In.Is_System_File := True;
+ Standard_In.Is_Text_File := True;
+ Standard_In.Access_Method := 'T';
+ Standard_In.Self := Standard_In;
+ Standard_In.WC_Method := Default_WCEM;
+
+ Standard_Out.Stream := stdout;
+ Standard_Out.Name := Out_Name'Access;
+ Standard_Out.Form := Null_Str'Unrestricted_Access;
+ Standard_Out.Mode := FCB.Out_File;
+ Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
+ Standard_Out.Is_Temporary_File := False;
+ Standard_Out.Is_System_File := True;
+ Standard_Out.Is_Text_File := True;
+ Standard_Out.Access_Method := 'T';
+ Standard_Out.Self := Standard_Out;
+ Standard_Out.WC_Method := Default_WCEM;
+
+ FIO.Make_Unbuffered (AP (Standard_Out));
+ FIO.Make_Unbuffered (AP (Standard_Err));
+ end Initialize_Standard_Files;
+
-------------
-- Is_Open --
-------------
@@ -856,9 +938,9 @@ package body Ada.Wide_Text_IO is
-- Line --
----------
- -- Note: we assume that it is impossible in practice for the line
- -- to exceed the value of Count'Last, i.e. no check is required for
- -- overflow raising layout error.
+ -- Note: we assume that it is impossible in practice for the line to exceed
+ -- the value of Count'Last, i.e. no check is required for overflow raising
+ -- layout error.
function Line (File : File_Type) return Positive_Count is
begin
@@ -1840,20 +1922,8 @@ package body Ada.Wide_Text_IO is
set_text_mode (fileno (File.Stream));
end Write;
- -- Use "preallocated" strings to avoid calling "new" during the
- -- elaboration of the run time. This is needed in the tasking case to
- -- avoid calling Task_Lock too early. A filename is expected to end with
- -- a null character in the runtime, here the null characters are added
- -- just to have a correct filename length.
-
- Err_Name : aliased String := "*stderr" & ASCII.NUL;
- In_Name : aliased String := "*stdin" & ASCII.NUL;
- Out_Name : aliased String := "*stdout" & ASCII.NUL;
-
begin
- -------------------------------
- -- Initialize Standard Files --
- -------------------------------
+ -- Initialize Standard Files
for J in WC_Encoding_Method loop
if WC_Encoding = WC_Encoding_Letters (J) then
@@ -1861,51 +1931,10 @@ begin
end if;
end loop;
- -- Note: the names in these files are bogus, and probably it would be
- -- better for these files to have no names, but the ACVC test insist!
- -- We use names that are bound to fail in open etc.
-
- Standard_Err.Stream := stderr;
- Standard_Err.Name := Err_Name'Access;
- Standard_Err.Form := Null_Str'Unrestricted_Access;
- Standard_Err.Mode := FCB.Out_File;
- Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
- Standard_Err.Is_Temporary_File := False;
- Standard_Err.Is_System_File := True;
- Standard_Err.Is_Text_File := True;
- Standard_Err.Access_Method := 'T';
- Standard_Err.Self := Standard_Err;
- Standard_Err.WC_Method := Default_WCEM;
-
- Standard_In.Stream := stdin;
- Standard_In.Name := In_Name'Access;
- Standard_In.Form := Null_Str'Unrestricted_Access;
- Standard_In.Mode := FCB.In_File;
- Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
- Standard_In.Is_Temporary_File := False;
- Standard_In.Is_System_File := True;
- Standard_In.Is_Text_File := True;
- Standard_In.Access_Method := 'T';
- Standard_In.Self := Standard_In;
- Standard_In.WC_Method := Default_WCEM;
-
- Standard_Out.Stream := stdout;
- Standard_Out.Name := Out_Name'Access;
- Standard_Out.Form := Null_Str'Unrestricted_Access;
- Standard_Out.Mode := FCB.Out_File;
- Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
- Standard_Out.Is_Temporary_File := False;
- Standard_Out.Is_System_File := True;
- Standard_Out.Is_Text_File := True;
- Standard_Out.Access_Method := 'T';
- Standard_Out.Self := Standard_Out;
- Standard_Out.WC_Method := Default_WCEM;
+ Initialize_Standard_Files;
FIO.Chain_File (AP (Standard_In));
FIO.Chain_File (AP (Standard_Out));
FIO.Chain_File (AP (Standard_Err));
- FIO.Make_Unbuffered (AP (Standard_Out));
- FIO.Make_Unbuffered (AP (Standard_Err));
-
end Ada.Wide_Text_IO;
diff --git a/gcc/ada/a-witeio.ads b/gcc/ada/a-witeio.ads
index 0af805eb980..2cf02b69b05 100644
--- a/gcc/ada/a-witeio.ads
+++ b/gcc/ada/a-witeio.ads
@@ -42,6 +42,9 @@
with Ada.IO_Exceptions;
with Ada.Streams;
+
+with Interfaces.C_Streams;
+
with System;
with System.File_Control_Block;
with System.WCh_Con;
@@ -441,9 +444,6 @@ private
-- The Standard Files --
------------------------
- Null_Str : aliased constant String := "";
- -- Used as name and form of standard files
-
Standard_Err_AFCB : aliased Wide_Text_AFCB;
Standard_In_AFCB : aliased Wide_Text_AFCB;
Standard_Out_AFCB : aliased Wide_Text_AFCB;
@@ -458,26 +458,24 @@ private
Current_Err : aliased File_Type := Standard_Err;
-- Current files
+ procedure Initialize_Standard_Files;
+ -- Initializes the file control blocks for the standard files. Called from
+ -- the elaboration routine for this package, and from Reset_Standard_Files
+ -- in package Ada.Wide_Text_IO.Reset_Standard_Files.
+
-----------------------
-- Local Subprograms --
-----------------------
-- These subprograms are in the private part of the spec so that they can
- -- be shared by the routines in the body of Ada.Text_IO.Wide_Text_IO.
-
- -- Note: we use Integer in these declarations instead of the more accurate
- -- Interfaces.C_Streams.int, because we do not want to drag in the spec of
- -- this interfaces package with the spec of Ada.Text_IO, and we know that
- -- in fact these types are identical
+ -- be shared by the children of Ada.Wide_Text_IO.
- function Getc (File : File_Type) return Integer;
- -- Gets next character from file, which has already been checked for
- -- being in read status, and returns the character read if no error
- -- occurs. The result is EOF if the end of file was read.
+ function Getc (File : File_Type) return Interfaces.C_Streams.int;
+ -- Gets next character from file, which has already been checked for being
+ -- in read status, and returns the character read if no error occurs. The
+ -- result is EOF if the end of file was read.
- procedure Get_Character
- (File : File_Type;
- Item : out Character);
+ procedure Get_Character (File : File_Type; Item : out Character);
-- This is essentially a copy of the normal Get routine from Text_IO. It
-- obtains a single character from the input file File, and places it in
-- Item. This character may be the leading character of a Wide_Character
@@ -491,25 +489,8 @@ private
-- read and is passed in C. The wide character value is returned as the
-- result, and the file pointer is bumped past the character.
- function Nextc (File : File_Type) return Integer;
- -- Returns next character from file without skipping past it (i.e. it
- -- is a combination of Getc followed by an Ungetc).
-
- procedure Putc (ch : Integer; File : File_Type);
- -- Outputs the given character to the file, which has already been
- -- checked for being in output status. Device_Error is raised if the
- -- character cannot be written.
-
- procedure Terminate_Line (File : File_Type);
- -- If the file is in Write_File or Append_File mode, and the current
- -- line is not terminated, then a line terminator is written using
- -- New_Line. Note that there is no Terminate_Page routine, because
- -- the page mark at the end of the file is implied if necessary.
-
- procedure Ungetc (ch : Integer; File : File_Type);
- -- Pushes back character into stream, using ungetc. The caller has
- -- checked that the file is in read status. Device_Error is raised
- -- if the character cannot be pushed back. An attempt to push back
- -- and end of file character (EOF) is ignored.
+ function Nextc (File : File_Type) return Interfaces.C_Streams.int;
+ -- Returns next character from file without skipping past it (i.e. it is a
+ -- combination of Getc followed by an Ungetc).
end Ada.Wide_Text_IO;
diff --git a/gcc/ada/a-ztexio.adb b/gcc/ada/a-ztexio.adb
index 64ad87215db..8be8a91d9e2 100644
--- a/gcc/ada/a-ztexio.adb
+++ b/gcc/ada/a-ztexio.adb
@@ -57,26 +57,62 @@ package body Ada.Wide_Wide_Text_IO is
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
+ -- Default wide character encoding
+
+ Err_Name : aliased String := "*stderr" & ASCII.NUL;
+ In_Name : aliased String := "*stdin" & ASCII.NUL;
+ Out_Name : aliased String := "*stdout" & ASCII.NUL;
+ -- Names of standard files
+ --
+ -- Use "preallocated" strings to avoid calling "new" during the elaboration
+ -- of the run time. This is needed in the tasking case to avoid calling
+ -- Task_Lock too early. A filename is expected to end with a null character
+ -- in the runtime, here the null characters are added just to have a
+ -- correct filename length.
+ --
+ -- Note: the names for these files are bogus, and probably it would be
+ -- better for these files to have no names, but the ACVC tests insist!
+ -- We use names that are bound to fail in open etc.
+
+ Null_Str : aliased constant String := "";
+ -- Used as form string for standard files
-----------------------
-- Local Subprograms --
-----------------------
- function Getc_Immed (File : File_Type) return int;
- -- This routine is identical to Getc, except that the read is done in
- -- Get_Immediate mode (i.e. without waiting for a line return).
-
function Get_Wide_Wide_Char_Immed
(C : Character;
File : File_Type) return Wide_Wide_Character;
-- This routine is identical to Get_Wide_Wide_Char, except that the reads
-- are done in Get_Immediate mode (i.e. without waiting for a line return).
+ function Getc_Immed (File : File_Type) return int;
+ -- This routine is identical to Getc, except that the read is done in
+ -- Get_Immediate mode (i.e. without waiting for a line return).
+
+ procedure Putc (ch : int; File : File_Type);
+ -- Outputs the given character to the file, which has already been checked
+ -- for being in output status. Device_Error is raised if the character
+ -- cannot be written.
+
procedure Set_WCEM (File : in out File_Type);
-- Called by Open and Create to set the wide character encoding method for
-- the file, processing a WCEM form parameter if one is present. File is
-- IN OUT because it may be closed in case of an error.
+ procedure Terminate_Line (File : File_Type);
+ -- If the file is in Write_File or Append_File mode, and the current line
+ -- is not terminated, then a line terminator is written using New_Line.
+ -- Note that there is no Terminate_Page routine, because the page mark at
+ -- the end of the file is implied if necessary.
+
+ procedure Ungetc (ch : int; File : File_Type);
+ -- Pushes back character into stream, using ungetc. The caller has checked
+ -- that the file is in read status. Device_Error is raised if the character
+ -- cannot be pushed back. An attempt to push back and end of file character
+ -- (EOF) is ignored.
+
-------------------
-- AFCB_Allocate --
-------------------
@@ -843,6 +879,52 @@ package body Ada.Wide_Wide_Text_IO is
return ch;
end Getc_Immed;
+ -------------------------------
+ -- Initialize_Standard_Files --
+ -------------------------------
+
+ procedure Initialize_Standard_Files is
+ begin
+ Standard_Err.Stream := stderr;
+ Standard_Err.Name := Err_Name'Access;
+ Standard_Err.Form := Null_Str'Unrestricted_Access;
+ Standard_Err.Mode := FCB.Out_File;
+ Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
+ Standard_Err.Is_Temporary_File := False;
+ Standard_Err.Is_System_File := True;
+ Standard_Err.Is_Text_File := True;
+ Standard_Err.Access_Method := 'T';
+ Standard_Err.Self := Standard_Err;
+ Standard_Err.WC_Method := Default_WCEM;
+
+ Standard_In.Stream := stdin;
+ Standard_In.Name := In_Name'Access;
+ Standard_In.Form := Null_Str'Unrestricted_Access;
+ Standard_In.Mode := FCB.In_File;
+ Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
+ Standard_In.Is_Temporary_File := False;
+ Standard_In.Is_System_File := True;
+ Standard_In.Is_Text_File := True;
+ Standard_In.Access_Method := 'T';
+ Standard_In.Self := Standard_In;
+ Standard_In.WC_Method := Default_WCEM;
+
+ Standard_Out.Stream := stdout;
+ Standard_Out.Name := Out_Name'Access;
+ Standard_Out.Form := Null_Str'Unrestricted_Access;
+ Standard_Out.Mode := FCB.Out_File;
+ Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
+ Standard_Out.Is_Temporary_File := False;
+ Standard_Out.Is_System_File := True;
+ Standard_Out.Is_Text_File := True;
+ Standard_Out.Access_Method := 'T';
+ Standard_Out.Self := Standard_Out;
+ Standard_Out.WC_Method := Default_WCEM;
+
+ FIO.Make_Unbuffered (AP (Standard_Out));
+ FIO.Make_Unbuffered (AP (Standard_Err));
+ end Initialize_Standard_Files;
+
-------------
-- Is_Open --
-------------
@@ -1840,20 +1922,8 @@ package body Ada.Wide_Wide_Text_IO is
set_text_mode (fileno (File.Stream));
end Write;
- -- Use "preallocated" strings to avoid calling "new" during the
- -- elaboration of the run time. This is needed in the tasking case to
- -- avoid calling Task_Lock too early. A filename is expected to end with
- -- a null character in the runtime, here the null characters are added
- -- just to have a correct filename length.
-
- Err_Name : aliased String := "*stderr" & ASCII.NUL;
- In_Name : aliased String := "*stdin" & ASCII.NUL;
- Out_Name : aliased String := "*stdout" & ASCII.NUL;
-
begin
- -------------------------------
- -- Initialize Standard Files --
- -------------------------------
+ -- Initialize Standard Files
for J in WC_Encoding_Method loop
if WC_Encoding = WC_Encoding_Letters (J) then
@@ -1861,51 +1931,10 @@ begin
end if;
end loop;
- -- Note: the names in these files are bogus, and probably it would be
- -- better for these files to have no names, but the ACVC test insist!
- -- We use names that are bound to fail in open etc.
-
- Standard_Err.Stream := stderr;
- Standard_Err.Name := Err_Name'Access;
- Standard_Err.Form := Null_Str'Unrestricted_Access;
- Standard_Err.Mode := FCB.Out_File;
- Standard_Err.Is_Regular_File := is_regular_file (fileno (stderr)) /= 0;
- Standard_Err.Is_Temporary_File := False;
- Standard_Err.Is_System_File := True;
- Standard_Err.Is_Text_File := True;
- Standard_Err.Access_Method := 'T';
- Standard_Err.Self := Standard_Err;
- Standard_Err.WC_Method := Default_WCEM;
-
- Standard_In.Stream := stdin;
- Standard_In.Name := In_Name'Access;
- Standard_In.Form := Null_Str'Unrestricted_Access;
- Standard_In.Mode := FCB.In_File;
- Standard_In.Is_Regular_File := is_regular_file (fileno (stdin)) /= 0;
- Standard_In.Is_Temporary_File := False;
- Standard_In.Is_System_File := True;
- Standard_In.Is_Text_File := True;
- Standard_In.Access_Method := 'T';
- Standard_In.Self := Standard_In;
- Standard_In.WC_Method := Default_WCEM;
-
- Standard_Out.Stream := stdout;
- Standard_Out.Name := Out_Name'Access;
- Standard_Out.Form := Null_Str'Unrestricted_Access;
- Standard_Out.Mode := FCB.Out_File;
- Standard_Out.Is_Regular_File := is_regular_file (fileno (stdout)) /= 0;
- Standard_Out.Is_Temporary_File := False;
- Standard_Out.Is_System_File := True;
- Standard_Out.Is_Text_File := True;
- Standard_Out.Access_Method := 'T';
- Standard_Out.Self := Standard_Out;
- Standard_Out.WC_Method := Default_WCEM;
+ Initialize_Standard_Files;
FIO.Chain_File (AP (Standard_In));
FIO.Chain_File (AP (Standard_Out));
FIO.Chain_File (AP (Standard_Err));
- FIO.Make_Unbuffered (AP (Standard_Out));
- FIO.Make_Unbuffered (AP (Standard_Err));
-
end Ada.Wide_Wide_Text_IO;
diff --git a/gcc/ada/a-ztexio.ads b/gcc/ada/a-ztexio.ads
index 81ab9924775..6c75acd1936 100644
--- a/gcc/ada/a-ztexio.ads
+++ b/gcc/ada/a-ztexio.ads
@@ -42,6 +42,9 @@
with Ada.IO_Exceptions;
with Ada.Streams;
+
+with Interfaces.C_Streams;
+
with System;
with System.File_Control_Block;
with System.WCh_Con;
@@ -357,13 +360,13 @@ private
PM : constant := Character'Pos (ASCII.FF);
-- Used as page mark, except at end of file where it is implied
- -------------------------------------
+ ------------------------------------------
-- Wide_Wide_Text_IO File Control Block --
- -------------------------------------
+ ------------------------------------------
Default_WCEM : WCh_Con.WC_Encoding_Method := WCh_Con.WCEM_UTF8;
- -- This gets modified during initialization (see body) using
- -- the default value established in the call to Set_Globals.
+ -- This gets modified during initialization (see body) using the default
+ -- value established in the call to Set_Globals.
package FCB renames System.File_Control_Block;
@@ -443,9 +446,6 @@ private
-- The Standard Files --
------------------------
- Null_Str : aliased constant String := "";
- -- Used as name and form of standard files
-
Standard_Err_AFCB : aliased Wide_Wide_Text_AFCB;
Standard_In_AFCB : aliased Wide_Wide_Text_AFCB;
Standard_Out_AFCB : aliased Wide_Wide_Text_AFCB;
@@ -460,31 +460,28 @@ private
Current_Err : aliased File_Type := Standard_Err;
-- Current files
+ procedure Initialize_Standard_Files;
+ -- Initializes the file control blocks for the standard files. Called from
+ -- the elaboration routine for this package, and from Reset_Standard_Files
+ -- in package Ada.Wide_Wide_Text_IO.Reset_Standard_Files.
+
-----------------------
-- Local Subprograms --
-----------------------
-- These subprograms are in the private part of the spec so that they can
- -- be shared by the routines in the body of Ada.Text_IO.Wide_Wide_Text_IO.
-
- -- Note: we use Integer in these declarations instead of the more accurate
- -- Interfaces.C_Streams.int, because we do not want to drag in the spec of
- -- this interfaces package with the spec of Ada.Text_IO, and we know that
- -- in fact these types are identical
+ -- be shared by the children of Ada.Text_IO.Wide_Wide_Text_IO.
- function Getc (File : File_Type) return Integer;
- -- Gets next character from file, which has already been checked for
- -- being in read status, and returns the character read if no error
- -- occurs. The result is EOF if the end of file was read.
+ function Getc (File : File_Type) return Interfaces.C_Streams.int;
+ -- Gets next character from file, which has already been checked for being
+ -- in read status, and returns the character read if no error occurs. The
+ -- result is EOF if the end of file was read.
- procedure Get_Character
- (File : File_Type;
- Item : out Character);
- -- This is essentially a copy of the normal Get routine from Text_IO. It
+ procedure Get_Character (File : File_Type; Item : out Character);
+ -- This is essentially copy of Wide_Wide_Text_IO.Get. It obtains a single
-- obtains a single character from the input file File, and places it in
- -- Item. This character may be the leading character of a
- -- Wide_Wide_Character sequence, but that is up to the caller to deal
- -- with.
+ -- Item. This result may be the leading character of a Wide_Wide_Character
+ -- sequence, but that is up to the caller to deal with.
function Get_Wide_Wide_Char
(C : Character;
@@ -494,25 +491,8 @@ private
-- read and is passed in C. The wide character value is returned as the
-- result, and the file pointer is bumped past the character.
- function Nextc (File : File_Type) return Integer;
- -- Returns next character from file without skipping past it (i.e. it
- -- is a combination of Getc followed by an Ungetc).
-
- procedure Putc (ch : Integer; File : File_Type);
- -- Outputs the given character to the file, which has already been
- -- checked for being in output status. Device_Error is raised if the
- -- character cannot be written.
-
- procedure Terminate_Line (File : File_Type);
- -- If the file is in Write_File or Append_File mode, and the current
- -- line is not terminated, then a line terminator is written using
- -- New_Line. Note that there is no Terminate_Page routine, because
- -- the page mark at the end of the file is implied if necessary.
-
- procedure Ungetc (ch : Integer; File : File_Type);
- -- Pushes back character into stream, using ungetc. The caller has
- -- checked that the file is in read status. Device_Error is raised
- -- if the character cannot be pushed back. An attempt to push back
- -- and end of file character (EOF) is ignored.
+ function Nextc (File : File_Type) return Interfaces.C_Streams.int;
+ -- Returns next character from file without skipping past it (i.e. it is a
+ -- combination of Getc followed by an Ungetc).
end Ada.Wide_Wide_Text_IO;
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index c3405daaf44..135d3179570 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -923,6 +923,28 @@ __gnat_create_output_file (char *path)
}
int
+__gnat_create_output_file_new (char *path)
+{
+ int fd;
+#if defined (VMS)
+ fd = open (path, O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_EXCL, PERM,
+ "rfm=stmlf", "ctx=rec", "rat=none", "rop=nlk",
+ "shr=del,get,put,upd");
+#elif defined (__MINGW32__)
+ {
+ TCHAR wpath[GNAT_MAX_PATH_LEN];
+
+ S2WSC (wpath, path, GNAT_MAX_PATH_LEN);
+ fd = _topen (wpath, O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_EXCL, PERM);
+ }
+#else
+ fd = open (path, O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_EXCL, PERM);
+#endif
+
+ return fd < 0 ? -1 : fd;
+}
+
+int
__gnat_open_append (char *path, int fmode)
{
int fd;
diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb
index b2357eae970..20438cf66e6 100644
--- a/gcc/ada/ali.adb
+++ b/gcc/ada/ali.adb
@@ -190,7 +190,7 @@ package body ALI is
function Get_Name
(Ignore_Spaces : Boolean := False;
- Ignore_Special : Boolean := False)return Name_Id;
+ Ignore_Special : Boolean := False) return Name_Id;
-- Skip blanks, then scan out a name (name is left in Name_Buffer with
-- length in Name_Len, as well as being returned in Name_Id form).
-- If Lower is set to True then the Name_Buffer will be converted to
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index d1a2b460c90..ff511665b73 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -28,6 +28,7 @@ with Debug; use Debug;
with Einfo; use Einfo;
with Errout; use Errout;
with Exp_Ch2; use Exp_Ch2;
+with Exp_Ch4; use Exp_Ch4;
with Exp_Ch11; use Exp_Ch11;
with Exp_Pakd; use Exp_Pakd;
with Exp_Util; use Exp_Util;
@@ -844,7 +845,10 @@ package body Checks is
begin
-- Skip check if back end does overflow checks, or the overflow flag
- -- is not set anyway, or we are not doing code expansion.
+ -- is not set anyway, or we are not doing code expansion, or the
+ -- parent node is a type conversion whose operand is an arithmetic
+ -- operation on signed integers on which the expander can promote
+ -- later the operands to type Integer (see Expand_N_Type_Conversion).
-- Special case CLI target, where arithmetic overflow checks can be
-- performed for integer and long_integer
@@ -852,6 +856,9 @@ package body Checks is
if Backend_Overflow_Checks_On_Target
or else not Do_Overflow_Check (N)
or else not Expander_Active
+ or else (Present (Parent (N))
+ and then Nkind (Parent (N)) = N_Type_Conversion
+ and then Integer_Promotion_Possible (Parent (N)))
or else
(VM_Target = CLI_Target and then Siz >= Standard_Integer_Size)
then
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 913e46df374..75eb8f500fa 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -509,7 +509,7 @@ package body Exp_Aggr is
-- 10. No controlled actions need to be generated for components
- -- 11. The backend is a No_VM backend and the array has aliased components
+ -- 11. For a VM back end, the array should have no aliased components
function Backend_Processing_Possible (N : Node_Id) return Boolean is
Typ : constant Entity_Id := Etype (N);
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index d5cce9b43ee..48bd566b38b 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -654,10 +654,18 @@ package body Exp_Attr is
Make_Build_In_Place_Call_In_Anonymous_Context (Pref);
end if;
- -- If prefix is a protected type name, this is a reference to
- -- the current instance of the type.
-
- if Is_Protected_Self_Reference (Pref) then
+ -- If prefix is a protected type name, this is a reference to the
+ -- current instance of the type. For a component definition, nothing
+ -- to do (expansion will occur in the init proc). In other contexts,
+ -- rewrite into reference to current instance.
+
+ if Is_Protected_Self_Reference (Pref)
+ and then not
+ (Nkind_In (Parent (N), N_Index_Or_Discriminant_Constraint,
+ N_Discriminant_Association)
+ and then Nkind (Parent (Parent (Parent (Parent (N))))) =
+ N_Component_Definition)
+ then
Rewrite (Pref, Concurrent_Ref (Pref));
Analyze (Pref);
end if;
@@ -680,9 +688,9 @@ package body Exp_Attr is
function Enclosing_Object (N : Node_Id) return Node_Id;
-- If N denotes a compound name (selected component, indexed
- -- component, or slice), returns the name of the outermost
- -- such enclosing object. Otherwise returns N. If the object
- -- is a renaming, then the renamed object is returned.
+ -- component, or slice), returns the name of the outermost such
+ -- enclosing object. Otherwise returns N. If the object is a
+ -- renaming, then the renamed object is returned.
----------------------
-- Enclosing_Object --
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 414e5670115..9a91e2aa9bb 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -2733,70 +2733,11 @@ package body Exp_Ch3 is
Next_Non_Pragma (Decl);
end loop;
- if Per_Object_Constraint_Components then
-
- -- Second pass: components with per-object constraints
-
- Decl := First_Non_Pragma (Component_Items (Comp_List));
- while Present (Decl) loop
- Loc := Sloc (Decl);
- Id := Defining_Identifier (Decl);
- Typ := Etype (Id);
-
- if Has_Access_Constraint (Id)
- and then No (Expression (Decl))
- then
- if Has_Non_Null_Base_Init_Proc (Typ) then
- Append_List_To (Statement_List,
- Build_Initialization_Call (Loc,
- Make_Selected_Component (Loc,
- Prefix => Make_Identifier (Loc, Name_uInit),
- Selector_Name => New_Occurrence_Of (Id, Loc)),
- Typ,
- In_Init_Proc => True,
- Enclos_Type => Rec_Type,
- Discr_Map => Discr_Map));
-
- Clean_Task_Names (Typ, Proc_Id);
-
- elsif Component_Needs_Simple_Initialization (Typ) then
- Append_List_To (Statement_List,
- Build_Assignment
- (Id, Get_Simple_Init_Val (Typ, N, Esize (Id))));
- end if;
- end if;
-
- Next_Non_Pragma (Decl);
- end loop;
- end if;
-
- -- Process the variant part
-
- if Present (Variant_Part (Comp_List)) then
- Alt_List := New_List;
- Variant := First_Non_Pragma (Variants (Variant_Part (Comp_List)));
- while Present (Variant) loop
- Loc := Sloc (Variant);
- Append_To (Alt_List,
- Make_Case_Statement_Alternative (Loc,
- Discrete_Choices =>
- New_Copy_List (Discrete_Choices (Variant)),
- Statements =>
- Build_Init_Statements (Component_List (Variant))));
- Next_Non_Pragma (Variant);
- end loop;
-
- -- The expression of the case statement which is a reference
- -- to one of the discriminants is replaced by the appropriate
- -- formal parameter of the initialization procedure.
-
- Append_To (Statement_List,
- Make_Case_Statement (Loc,
- Expression =>
- New_Reference_To (Discriminal (
- Entity (Name (Variant_Part (Comp_List)))), Loc),
- Alternatives => Alt_List));
- end if;
+ -- Set up tasks and protected object support. This needs to be done
+ -- before any component with a per-object access discriminant
+ -- constraint, or any variant part (which may contain such
+ -- components) is initialized, because the initialization of these
+ -- components may reference the enclosing concurrent object.
-- For a task record type, add the task create call and calls
-- to bind any interrupt (signal) entries.
@@ -2898,6 +2839,71 @@ package body Exp_Ch3 is
end if;
end if;
+ if Per_Object_Constraint_Components then
+
+ -- Second pass: components with per-object constraints
+
+ Decl := First_Non_Pragma (Component_Items (Comp_List));
+ while Present (Decl) loop
+ Loc := Sloc (Decl);
+ Id := Defining_Identifier (Decl);
+ Typ := Etype (Id);
+
+ if Has_Access_Constraint (Id)
+ and then No (Expression (Decl))
+ then
+ if Has_Non_Null_Base_Init_Proc (Typ) then
+ Append_List_To (Statement_List,
+ Build_Initialization_Call (Loc,
+ Make_Selected_Component (Loc,
+ Prefix => Make_Identifier (Loc, Name_uInit),
+ Selector_Name => New_Occurrence_Of (Id, Loc)),
+ Typ,
+ In_Init_Proc => True,
+ Enclos_Type => Rec_Type,
+ Discr_Map => Discr_Map));
+
+ Clean_Task_Names (Typ, Proc_Id);
+
+ elsif Component_Needs_Simple_Initialization (Typ) then
+ Append_List_To (Statement_List,
+ Build_Assignment
+ (Id, Get_Simple_Init_Val (Typ, N, Esize (Id))));
+ end if;
+ end if;
+
+ Next_Non_Pragma (Decl);
+ end loop;
+ end if;
+
+ -- Process the variant part
+
+ if Present (Variant_Part (Comp_List)) then
+ Alt_List := New_List;
+ Variant := First_Non_Pragma (Variants (Variant_Part (Comp_List)));
+ while Present (Variant) loop
+ Loc := Sloc (Variant);
+ Append_To (Alt_List,
+ Make_Case_Statement_Alternative (Loc,
+ Discrete_Choices =>
+ New_Copy_List (Discrete_Choices (Variant)),
+ Statements =>
+ Build_Init_Statements (Component_List (Variant))));
+ Next_Non_Pragma (Variant);
+ end loop;
+
+ -- The expression of the case statement which is a reference
+ -- to one of the discriminants is replaced by the appropriate
+ -- formal parameter of the initialization procedure.
+
+ Append_To (Statement_List,
+ Make_Case_Statement (Loc,
+ Expression =>
+ New_Reference_To (Discriminal (
+ Entity (Name (Variant_Part (Comp_List)))), Loc),
+ Alternatives => Alt_List));
+ end if;
+
-- If no initializations when generated for component declarations
-- corresponding to this Statement_List, append a null statement
-- to the Statement_List to make it a valid Ada tree.
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 6a65e10a167..6a7ea4fdb1b 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -8042,88 +8042,41 @@ package body Exp_Ch4 is
-- have to be sure not to generate junk overflow checks in the first
-- place, since it would be trick to remove them here!
- declare
- Root_Operand_Type : constant Entity_Id := Root_Type (Operand_Type);
-
- begin
- -- Enable transformation if all conditions are met
-
- if
- -- We only do this transformation for source constructs. We assume
- -- that the expander knows what it is doing when it generates code.
+ if Integer_Promotion_Possible (N) then
- Comes_From_Source (N)
+ -- All conditions met, go ahead with transformation
- -- If the operand type is Short_Integer or Short_Short_Integer,
- -- then we will promote to Integer, which is available on all
- -- targets, and is sufficient to ensure no intermediate overflow.
- -- Furthermore it is likely to be as efficient or more efficient
- -- than using the smaller type for the computation so we do this
- -- unconditionally.
-
- and then
- (Root_Operand_Type = Base_Type (Standard_Short_Integer)
- or else
- Root_Operand_Type = Base_Type (Standard_Short_Short_Integer))
-
- -- Test for interesting operation, which includes addition,
- -- division, exponentiation, multiplication, subtraction, and
- -- unary negation.
+ declare
+ Opnd : Node_Id;
+ L, R : Node_Id;
- and then Nkind_In (Operand, N_Op_Add,
- N_Op_Divide,
- N_Op_Expon,
- N_Op_Minus,
- N_Op_Multiply,
- N_Op_Subtract)
- then
- -- All conditions met, go ahead with transformation
+ begin
+ R :=
+ Make_Type_Conversion (Loc,
+ Subtype_Mark => New_Reference_To (Standard_Integer, Loc),
+ Expression => Relocate_Node (Right_Opnd (Operand)));
- declare
- Opnd : Node_Id;
- L, R : Node_Id;
+ Opnd := New_Op_Node (Nkind (Operand), Loc);
+ Set_Right_Opnd (Opnd, R);
- begin
- R :=
+ if Nkind (Operand) in N_Binary_Op then
+ L :=
Make_Type_Conversion (Loc,
Subtype_Mark => New_Reference_To (Standard_Integer, Loc),
- Expression => Relocate_Node (Right_Opnd (Operand)));
-
- if Nkind (Operand) = N_Op_Minus then
- Opnd := Make_Op_Minus (Loc, Right_Opnd => R);
+ Expression => Relocate_Node (Left_Opnd (Operand)));
- else
- L :=
- Make_Type_Conversion (Loc,
- Subtype_Mark => New_Reference_To (Standard_Integer, Loc),
- Expression => Relocate_Node (Left_Opnd (Operand)));
-
- case Nkind (Operand) is
- when N_Op_Add =>
- Opnd := Make_Op_Add (Loc, L, R);
- when N_Op_Divide =>
- Opnd := Make_Op_Divide (Loc, L, R);
- when N_Op_Expon =>
- Opnd := Make_Op_Expon (Loc, L, R);
- when N_Op_Multiply =>
- Opnd := Make_Op_Multiply (Loc, L, R);
- when N_Op_Subtract =>
- Opnd := Make_Op_Subtract (Loc, L, R);
- when others =>
- raise Program_Error;
- end case;
+ Set_Left_Opnd (Opnd, L);
+ end if;
- Rewrite (N,
- Make_Type_Conversion (Loc,
- Subtype_Mark => Relocate_Node (Subtype_Mark (N)),
- Expression => Opnd));
+ Rewrite (N,
+ Make_Type_Conversion (Loc,
+ Subtype_Mark => Relocate_Node (Subtype_Mark (N)),
+ Expression => Opnd));
- Analyze_And_Resolve (N, Target_Type);
- return;
- end if;
- end;
- end if;
- end;
+ Analyze_And_Resolve (N, Target_Type);
+ return;
+ end;
+ end if;
-- Do validity check if validity checking operands
@@ -9187,6 +9140,51 @@ package body Exp_Ch4 is
return;
end Insert_Dereference_Action;
+ --------------------------------
+ -- Integer_Promotion_Possible --
+ --------------------------------
+
+ function Integer_Promotion_Possible (N : Node_Id) return Boolean is
+ Operand : constant Node_Id := Expression (N);
+ Operand_Type : constant Entity_Id := Etype (Operand);
+ Root_Operand_Type : constant Entity_Id := Root_Type (Operand_Type);
+
+ begin
+ pragma Assert (Nkind (N) = N_Type_Conversion);
+
+ return
+
+ -- We only do the transformation for source constructs. We assume
+ -- that the expander knows what it is doing when it generates code.
+
+ Comes_From_Source (N)
+
+ -- If the operand type is Short_Integer or Short_Short_Integer,
+ -- then we will promote to Integer, which is available on all
+ -- targets, and is sufficient to ensure no intermediate overflow.
+ -- Furthermore it is likely to be as efficient or more efficient
+ -- than using the smaller type for the computation so we do this
+ -- unconditionally.
+
+ and then
+ (Root_Operand_Type = Base_Type (Standard_Short_Integer)
+ or else
+ Root_Operand_Type = Base_Type (Standard_Short_Short_Integer))
+
+ -- Test for interesting operation, which includes addition,
+ -- division, exponentiation, multiplication, subtraction, absolute
+ -- value and unary negation. Unary "+" is omitted since it is a
+ -- no-op and thus can't overflow.
+
+ and then Nkind_In (Operand, N_Op_Abs,
+ N_Op_Add,
+ N_Op_Divide,
+ N_Op_Expon,
+ N_Op_Minus,
+ N_Op_Multiply,
+ N_Op_Subtract);
+ end Integer_Promotion_Possible;
+
------------------------------
-- Make_Array_Comparison_Op --
------------------------------
diff --git a/gcc/ada/exp_ch4.ads b/gcc/ada/exp_ch4.ads
index d1ed208f1b3..fad8c15eea1 100644
--- a/gcc/ada/exp_ch4.ads
+++ b/gcc/ada/exp_ch4.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, 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- --
@@ -88,4 +88,11 @@ package Exp_Ch4 is
-- to insert those bodies at the right place. Nod provides the Sloc
-- value for generated code.
+ function Integer_Promotion_Possible (N : Node_Id) return Boolean;
+ -- Returns true if the node is a type conversion whose operand is an
+ -- arithmetic operation on signed integers, and the base type of the
+ -- signed integer type is smaller than Standard.Integer. In such case we
+ -- have special circuitry in Expand_N_Type_Conversion to promote both of
+ -- the operands to type Integer.
+
end Exp_Ch4;
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index db22726bb64..e26734ea40e 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -7821,20 +7821,23 @@ package body Exp_Ch9 is
declare
Old_Comp : constant Node_Id := Component_Definition (Priv);
- Pent : constant Entity_Id := Defining_Identifier (Priv);
+ Oent : constant Entity_Id := Defining_Identifier (Priv);
New_Comp : Node_Id;
+ Nent : constant Entity_Id :=
+ Make_Defining_Identifier (Sloc (Oent),
+ Chars => Chars (Oent));
begin
if Present (Subtype_Indication (Old_Comp)) then
New_Comp :=
- Make_Component_Definition (Sloc (Pent),
+ Make_Component_Definition (Sloc (Oent),
Aliased_Present => False,
Subtype_Indication =>
New_Copy_Tree (Subtype_Indication (Old_Comp),
Discr_Map));
else
New_Comp :=
- Make_Component_Definition (Sloc (Pent),
+ Make_Component_Definition (Sloc (Oent),
Aliased_Present => False,
Access_Definition =>
New_Copy_Tree (Access_Definition (Old_Comp),
@@ -7843,10 +7846,12 @@ package body Exp_Ch9 is
New_Priv :=
Make_Component_Declaration (Loc,
- Defining_Identifier =>
- Make_Defining_Identifier (Sloc (Pent), Chars (Pent)),
+ Defining_Identifier => Nent,
Component_Definition => New_Comp,
- Expression => Expression (Priv));
+ Expression => Expression (Priv));
+
+ Set_Has_Per_Object_Constraint (Nent,
+ Has_Per_Object_Constraint (Oent));
Append_To (Cdecls, New_Priv);
end;
diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads
index 8e795e12c0f..61279d4eac5 100644
--- a/gcc/ada/exp_ch9.ads
+++ b/gcc/ada/exp_ch9.ads
@@ -173,8 +173,8 @@ package Exp_Ch9 is
-- meaning is to get the Task_Id for the currently executing task.
function Convert_Concurrent
- (N : Node_Id;
- Typ : Entity_Id) return Node_Id;
+ (N : Node_Id;
+ Typ : Entity_Id) return Node_Id;
-- N is an expression of type Typ. If the type is not a concurrent type
-- then it is returned unchanged. If it is a task or protected reference,
-- Convert_Concurrent creates an unchecked conversion node from this
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 163274c4332..02887029b22 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -1295,29 +1295,30 @@ ada/checks.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/casing.ads ada/checks.ads ada/checks.adb ada/csets.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
- ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads \
- ada/exp_ch7.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/fname-uf.ads \
- ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads \
- ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
- ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \
- ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
- ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
- ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \
- ada/sem.ads ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch3.ads \
- ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_dist.ads \
- ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads ada/sem_scil.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
- ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
- ada/stand.ads ada/stringt.ads ada/stringt.adb ada/system.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
- ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads
+ ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads \
+ ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_dist.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/fname.ads \
+ ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads ada/inline.ads \
+ ada/itypes.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-load.ads ada/lib-sort.adb ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
+ ada/rtsfind.adb ada/sem.ads ada/sem_aux.ads ada/sem_cat.ads \
+ ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
+ ada/sem_dist.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads \
+ ada/sem_scil.ads ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \
+ ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
+ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
+ ada/validsw.ads
ada/comperr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -1467,12 +1468,12 @@ ada/exp_aggr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
ada/exp_aggr.ads ada/exp_aggr.adb ada/exp_ch11.ads ada/exp_ch2.ads \
- ada/exp_ch3.ads ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads \
- ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/fname.ads \
- ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
- ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads ada/inline.ads \
- ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/exp_ch3.ads ada/exp_ch4.ads ada/exp_ch6.ads ada/exp_ch7.ads \
+ ada/exp_ch9.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/expander.ads \
+ ada/fname.ads ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads \
+ ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads \
ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
@@ -1691,31 +1692,32 @@ ada/exp_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
ada/exp_aggr.ads ada/exp_atag.ads ada/exp_ch11.ads ada/exp_ch2.ads \
- ada/exp_ch5.ads ada/exp_ch5.adb ada/exp_ch6.ads ada/exp_ch7.ads \
- ada/exp_dbug.ads ada/exp_disp.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/fname-uf.ads \
- ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
- ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/itypes.ads \
- ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
- ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch13.ads \
- ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads \
- ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads ada/sem_scil.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \
- ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
+ ada/exp_ch4.ads ada/exp_ch5.ads ada/exp_ch5.adb ada/exp_ch6.ads \
+ ada/exp_ch7.ads ada/exp_dbug.ads ada/exp_disp.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/fname.ads \
+ ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/interfac.ads \
+ ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads \
+ ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch8.ads \
+ ada/sem_disp.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads \
+ ada/sem_scil.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
+ ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
ada/exp_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -1723,34 +1725,35 @@ ada/exp_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
ada/exp_aggr.ads ada/exp_atag.ads ada/exp_ch11.ads ada/exp_ch2.ads \
- ada/exp_ch3.ads ada/exp_ch6.ads ada/exp_ch6.adb ada/exp_ch7.ads \
- ada/exp_ch9.ads ada/exp_dbug.ads ada/exp_disp.ads ada/exp_dist.ads \
- ada/exp_intr.ads ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/exp_util.adb ada/exp_vfpt.ads ada/fname.ads ada/fname-uf.ads \
- ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads \
- ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/interfac.ads \
- ada/itypes.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
- ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads \
- ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
- ada/opt.ads ada/output.ads ada/restrict.ads ada/restrict.adb \
- ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb ada/scans.ads \
- ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_attr.ads \
- ada/sem_aux.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch3.ads \
- ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads \
- ada/sem_dist.ads ada/sem_eval.ads ada/sem_mech.ads ada/sem_res.ads \
- ada/sem_scil.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
+ ada/exp_ch3.ads ada/exp_ch4.ads ada/exp_ch6.ads ada/exp_ch6.adb \
+ ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_dbug.ads ada/exp_disp.ads \
+ ada/exp_dist.ads ada/exp_intr.ads ada/exp_pakd.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/exp_vfpt.ads ada/fname.ads \
+ ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads ada/inline.ads \
+ ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
+ ada/sem_attr.ads ada/sem_aux.ads ada/sem_ch12.ads ada/sem_ch13.ads \
+ ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
+ ada/sem_disp.ads ada/sem_dist.ads ada/sem_eval.ads ada/sem_mech.ads \
+ ada/sem_res.ads ada/sem_scil.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
ada/exp_ch7.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -2006,25 +2009,26 @@ ada/exp_pakd.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/casing.ads ada/checks.ads ada/checks.adb ada/debug.ads \
ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/exp_aggr.ads \
- ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads ada/exp_ch7.ads \
- ada/exp_dbug.ads ada/exp_pakd.ads ada/exp_pakd.adb ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/freeze.ads ada/get_targ.ads \
- ada/gnat.ads ada/g-htable.ads ada/hostparm.ads ada/inline.ads \
- ada/itypes.ads ada/layout.ads ada/lib.ads ada/namet.ads ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_aux.ads ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch8.ads \
- ada/sem_eval.ads ada/sem_res.ads ada/sem_scil.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
- ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads ada/exp_ch6.ads \
+ ada/exp_ch7.ads ada/exp_dbug.ads ada/exp_pakd.ads ada/exp_pakd.adb \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/freeze.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/hostparm.ads \
+ ada/inline.ads ada/itypes.ads ada/layout.ads ada/lib.ads ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/sem.ads ada/sem_aux.ads ada/sem_ch13.ads ada/sem_ch3.ads \
+ ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_scil.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/validsw.ads
ada/exp_prag.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -3022,12 +3026,12 @@ ada/sem_aggr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/casing.ads ada/checks.ads ada/checks.adb ada/csets.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
- ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads \
- ada/exp_ch7.ads ada/exp_disp.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/fname.ads \
- ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
- ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/itypes.ads \
- ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads \
+ ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_disp.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/expander.ads \
+ ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-htable.ads ada/hostparm.ads ada/inline.ads ada/interfac.ads \
+ ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
ada/namet-sp.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \
ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads \
@@ -3055,32 +3059,32 @@ ada/sem_attr.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \
ada/checks.adb ada/csets.ads ada/debug.ads ada/debug_a.ads \
ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/exp_aggr.ads \
- ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads ada/exp_ch7.ads \
- ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/fname.ads \
- ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
- ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/scans.ads \
- ada/sdefault.ads ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads \
- ada/sem_attr.adb ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch10.ads \
- ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch6.ads \
- ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
- ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads \
- ada/sem_res.ads ada/sem_res.adb ada/sem_scil.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
- ada/sinput.ads ada/sinput.adb ada/snames.ads ada/snames.adb \
- ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-exctab.adb \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypef.ads ada/ttypes.ads \
- ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads ada/exp_ch6.ads \
+ ada/exp_ch7.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/expander.ads \
+ ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-htable.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
+ ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/sdefault.ads ada/sem.ads ada/sem_aggr.ads \
+ ada/sem_attr.ads ada/sem_attr.adb ada/sem_aux.ads ada/sem_cat.ads \
+ ada/sem_ch10.ads ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.ads \
+ ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \
+ ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb \
+ ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb ada/sem_scil.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/snames.adb ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-carun8.ads ada/s-exctab.ads \
+ ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypef.ads \
+ ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
ada/validsw.ads ada/widechar.ads
@@ -3271,35 +3275,35 @@ ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch3.ads \
- ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads \
- ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/exp_util.adb ada/fname.ads ada/freeze.ads ada/get_targ.ads \
- ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads \
- ada/inline.ads ada/interfac.ads ada/itypes.ads ada/layout.ads \
- ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb \
- ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/scans.ads \
- ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_attr.ads \
- ada/sem_aux.ads ada/sem_case.ads ada/sem_case.adb ada/sem_cat.ads \
- ada/sem_cat.adb ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch3.adb \
- ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads \
- ada/sem_dist.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb \
- ada/sem_mech.ads ada/sem_res.ads ada/sem_scil.ads ada/sem_smem.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \
- ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \
- ada/widechar.ads
+ ada/exp_ch4.ads ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads \
+ ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/freeze.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads \
+ ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/itypes.ads \
+ ada/layout.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
+ ada/sem_attr.ads ada/sem_aux.ads ada/sem_case.ads ada/sem_case.adb \
+ ada/sem_cat.ads ada/sem_cat.adb ada/sem_ch13.ads ada/sem_ch3.ads \
+ ada/sem_ch3.adb ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
+ ada/sem_disp.ads ada/sem_dist.ads ada/sem_elim.ads ada/sem_eval.ads \
+ ada/sem_eval.adb ada/sem_mech.ads ada/sem_res.ads ada/sem_scil.ads \
+ ada/sem_smem.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
+ ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
+ ada/validsw.ads ada/widechar.ads
ada/sem_ch4.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -3338,34 +3342,34 @@ ada/sem_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/casing.ads ada/checks.ads ada/checks.adb ada/csets.ads \
ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads \
- ada/exp_ch7.ads ada/exp_code.ads ada/exp_disp.ads ada/exp_pakd.ads \
- ada/exp_tss.ads ada/exp_util.ads ada/expander.ads ada/fname.ads \
- ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesorg.ads \
- ada/g-htable.ads ada/hostparm.ads ada/interfac.ads ada/itypes.ads \
- ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
- ada/par_sco.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
- ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_case.ads \
- ada/sem_case.adb ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch3.ads \
- ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch5.adb ada/sem_ch6.ads \
- ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
- ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads \
- ada/sem_res.ads ada/sem_res.adb ada/sem_scil.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sem_warn.adb \
- ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \
- ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
- ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
- ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
- ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/validsw.ads ada/widechar.ads
+ ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads \
+ ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_code.ads ada/exp_disp.ads \
+ ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads ada/expander.ads \
+ ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads ada/interfac.ads \
+ ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/par_sco.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads \
+ ada/sem_case.ads ada/sem_case.adb ada/sem_cat.ads ada/sem_ch13.ads \
+ ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch5.adb \
+ ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \
+ ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb \
+ ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb ada/sem_scil.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
+ ada/sem_warn.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+ ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
ada/sem_ch6.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -3469,33 +3473,34 @@ ada/sem_ch9.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/casing.ads ada/checks.ads ada/checks.adb ada/csets.ads \
ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads \
- ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads ada/exp_pakd.ads \
- ada/exp_tss.ads ada/exp_util.ads ada/expander.ads ada/fname.ads \
- ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
- ada/g-htable.ads ada/hostparm.ads ada/interfac.ads ada/itypes.ads \
- ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
- ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
- ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads \
- ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads \
- ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_ch9.adb \
- ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads \
- ada/sem_eval.ads ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb \
- ada/sem_scil.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
- ada/sinput.adb ada/snames.ads ada/sprint.ads ada/stand.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
- ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-utf_32.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
- ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
+ ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads \
+ ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads \
+ ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads ada/expander.ads \
+ ada/fname.ads ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-htable.ads ada/hostparm.ads ada/interfac.ads \
+ ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads ada/sem_aux.ads \
+ ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.ads \
+ ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_ch9.ads \
+ ada/sem_ch9.adb ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
+ ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads ada/sem_res.ads \
+ ada/sem_res.adb ada/sem_scil.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/sinput.adb ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-crc32.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
+ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-utf_32.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
ada/sem_disp.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
@@ -3699,12 +3704,12 @@ ada/sem_res.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/debug.ads ada/debug_a.ads ada/debug_a.adb ada/einfo.ads \
ada/einfo.adb ada/elists.ads ada/elists.adb ada/err_vars.ads \
ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/exp_aggr.ads \
- ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch6.ads ada/exp_ch7.ads \
- ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/fname.ads \
- ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
- ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads ada/inline.ads \
- ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch4.ads ada/exp_ch6.ads \
+ ada/exp_ch7.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_pakd.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/expander.ads \
+ ada/fname.ads ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-hesorg.ads ada/g-htable.ads ada/hostparm.ads \
+ ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads \
ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 6abb366bd07..c3766ee99b7 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -7231,6 +7231,23 @@ annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref)
UI_From_Int (TYPE_ALIGN (gnu_type) / BITS_PER_UNIT));
}
+/* Return first element of field list whose TREE_PURPOSE is ELEM or whose
+ DECL_ORIGINAL_FIELD of TREE_PURPOSE is ELEM. Return NULL_TREE if there
+ is no such element in the list. */
+
+static tree
+purpose_member_field (const_tree elem, tree list)
+{
+ while (list)
+ {
+ tree field = TREE_PURPOSE (list);
+ if (elem == field || elem == DECL_ORIGINAL_FIELD (field))
+ return list;
+ list = TREE_CHAIN (list);
+ }
+ return NULL_TREE;
+}
+
/* Given GNAT_ENTITY, a record type, and GNU_TYPE, its corresponding GCC type,
set Component_Bit_Offset and Esize of the components to the position and
size used by Gigi. */
@@ -7254,11 +7271,12 @@ annotate_rep (Entity_Id gnat_entity, tree gnu_type)
|| (Ekind (gnat_field) == E_Discriminant
&& !Is_Unchecked_Union (Scope (gnat_field))))
{
- tree parent_offset, t;
-
- t = purpose_member (gnat_to_gnu_field_decl (gnat_field), gnu_list);
+ tree t = purpose_member_field (gnat_to_gnu_field_decl (gnat_field),
+ gnu_list);
if (t)
{
+ tree parent_offset;
+
if (type_annotate_only && Is_Tagged_Type (gnat_entity))
{
/* In this mode the tag and parent components are not
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index e25400d09fc..4b906fe91e9 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -307,10 +307,13 @@ The GNAT Library
* Ada.Strings.Wide_Unbounded.Wide_Text_IO (a-swuwti.ads)::
* Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO (a-szuzti.ads)::
* Ada.Text_IO.C_Streams (a-tiocst.ads)::
+* Ada.Text_IO.Reset_Standard_Files (a-tirsfi.ads)::
* Ada.Wide_Characters.Unicode (a-wichun.ads)::
* Ada.Wide_Text_IO.C_Streams (a-wtcstr.ads)::
+* Ada.Wide_Text_IO.Reset_Standard_Files (a-wrstfi.ads)::
* Ada.Wide_Wide_Characters.Unicode (a-zchuni.ads)::
* Ada.Wide_Wide_Text_IO.C_Streams (a-ztcstr.ads)::
+* Ada.Wide_Wide_Text_IO.Reset_Standard_Files (a-zrstfi.ads)::
* GNAT.Altivec (g-altive.ads)::
* GNAT.Altivec.Conversions (g-altcon.ads)::
* GNAT.Altivec.Vector_Operations (g-alveop.ads)::
@@ -13496,10 +13499,13 @@ of GNAT, and will generate a warning message.
* Ada.Strings.Wide_Unbounded.Wide_Text_IO (a-swuwti.ads)::
* Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO (a-szuzti.ads)::
* Ada.Text_IO.C_Streams (a-tiocst.ads)::
+* Ada.Text_IO.Reset_Standard_Files (a-tirsfi.ads)::
* Ada.Wide_Characters.Unicode (a-wichun.ads)::
* Ada.Wide_Text_IO.C_Streams (a-wtcstr.ads)::
+* Ada.Wide_Text_IO.Reset_Standard_Files (a-wrstfi.ads)::
* Ada.Wide_Wide_Characters.Unicode (a-zchuni.ads)::
* Ada.Wide_Wide_Text_IO.C_Streams (a-ztcstr.ads)::
+* Ada.Wide_Wide_Text_IO.Reset_Standard_Files (a-zrstfi.ads)::
* GNAT.Altivec (g-altive.ads)::
* GNAT.Altivec.Conversions (g-altcon.ads)::
* GNAT.Altivec.Vector_Operations (g-alveop.ads)::
@@ -13819,6 +13825,18 @@ C streams and @code{Text_IO}. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
+@node Ada.Text_IO.Reset_Standard_Files (a-tirsfi.ads)
+@section @code{Ada.Text_IO.Reset_Standard_Files} (@file{a-tirsfi.ads})
+@cindex @code{Ada.Text_IO.Reset_Standard_Files} (@file{a-tirsfi.ads})
+@cindex @code{Text_IO} resetting standard files
+
+@noindent
+This procedure is used to reset the status of the standard files used
+by Ada.Text_IO. This is useful in a situation (such as a restart in an
+embedded application) where the status of the files may change during
+execution (for example a standard input file may be redefined to be
+interactive).
+
@node Ada.Wide_Characters.Unicode (a-wichun.ads)
@section @code{Ada.Wide_Characters.Unicode} (@file{a-wichun.ads})
@cindex @code{Ada.Wide_Characters.Unicode} (@file{a-wichun.ads})
@@ -13839,6 +13857,18 @@ C streams and @code{Wide_Text_IO}. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
+@node Ada.Wide_Text_IO.Reset_Standard_Files (a-wrstfi.ads)
+@section @code{Ada.Wide_Text_IO.Reset_Standard_Files} (@file{a-wrstfi.ads})
+@cindex @code{Ada.Wide_Text_IO.Reset_Standard_Files} (@file{a-wrstfi.ads})
+@cindex @code{Wide_Text_IO} resetting standard files
+
+@noindent
+This procedure is used to reset the status of the standard files used
+by Ada.Wide_Text_IO. This is useful in a situation (such as a restart in an
+embedded application) where the status of the files may change during
+execution (for example a standard input file may be redefined to be
+interactive).
+
@node Ada.Wide_Wide_Characters.Unicode (a-zchuni.ads)
@section @code{Ada.Wide_Wide_Characters.Unicode} (@file{a-zchuni.ads})
@cindex @code{Ada.Wide_Wide_Characters.Unicode} (@file{a-zchuni.ads})
@@ -13859,6 +13889,18 @@ C streams and @code{Wide_Wide_Text_IO}. The stream identifier can be
extracted from a file opened on the Ada side, and an Ada file
can be constructed from a stream opened on the C side.
+@node Ada.Wide_Wide_Text_IO.Reset_Standard_Files (a-zrstfi.ads)
+@section @code{Ada.Wide_Wide_Text_IO.Reset_Standard_Files} (@file{a-zrstfi.ads})
+@cindex @code{Ada.Wide_Wide_Text_IO.Reset_Standard_Files} (@file{a-zrstfi.ads})
+@cindex @code{Wide_Wide_Text_IO} resetting standard files
+
+@noindent
+This procedure is used to reset the status of the standard files used
+by Ada.Wide_Wide_Text_IO. This is useful in a situation (such as a
+restart in an embedded application) where the status of the files may
+change during execution (for example a standard input file may be
+redefined to be interactive).
+
@node GNAT.Altivec (g-altive.ads)
@section @code{GNAT.Altivec} (@file{g-altive.ads})
@cindex @code{GNAT.Altivec} (@file{g-altive.ads})
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index d777f6dd099..77d52eb0321 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -6434,6 +6434,10 @@ If the token preceding a left parenthesis ends with a letter or digit, then
a space must separate the two tokens.
@item
+if the token following a right parenthesis starts with a letter or digit, then
+a space must separate the two tokens.
+
+@item
A right parenthesis must either be the first non-blank character on
a line, or it must be preceded by a non-blank character.
@@ -6524,8 +6528,6 @@ the exception of ORDERED_SUBPROGRAMS, UNNECESSARY_BLANK_LINES,
XTRA_PARENS, and DOS_LINE_ENDINGS. In addition
@end ifset
-
-
The switch
@ifclear vms
@option{-gnatyN}
@@ -20659,7 +20661,7 @@ Invoking @command{gnatcheck} on the command line has the form:
@smallexample
$ gnatcheck @ovar{switches} @{@var{filename}@}
@r{[}^-files^/FILES^=@{@var{arg_list_filename}@}@r{]}
- @r{[}-cargs @var{gcc_switches}@r{]} @r{[}-rules @var{rule_options}@r{]}
+ @r{[}-cargs @var{gcc_switches}@r{]} -rules @var{rule_options}
@end smallexample
@noindent
@@ -20785,18 +20787,9 @@ Quiet mode. All the diagnostics about rule violations are placed in the
Short format of the report file (no version information, no list of applied
rules, no list of checked sources is included)
-@cindex @option{^-s1^/COMPILER_STYLE^} (@command{gnatcheck})
-@item ^-s1^/COMPILER_STYLE^
-Include the compiler-style section in the report file
-
-@cindex @option{^-s2^/BY_RULES^} (@command{gnatcheck})
-@item ^-s2^/BY_RULES^
-Include the section containing diagnostics ordered by rules in the report file
-
-@cindex @option{^-s3^/BY_FILES_BY_RULES^} (@command{gnatcheck})
-@item ^-s3^/BY_FILES_BY_RULES^
-Include the section containing diagnostics ordered by files and then by rules
-in the report file
+@cindex @option{^--include-file=@var{file}^/INCLUDE_FILE=@var{file}^} (@command{gnatcheck})
+@item ^--include-file^/INCLUDE_FILE^
+Append the content of the specified text file to the report file
@cindex @option{^-t^/TIME^} (@command{gnatcheck})
@item ^-t^/TIME^
@@ -21226,7 +21219,9 @@ This rule has no parameters.
@cindex @code{Anonymous_Subtypes} rule (for @command{gnatcheck})
@noindent
-Flag all uses of anonymous subtypes. A use of an anonymous subtype is
+Flag all uses of anonymous subtypes (except cases when subtype indication
+is a part of a record component definition, and this subtype indication
+depends on a discriminant). A use of an anonymous subtype is
any instance of a subtype indication with a constraint, other than one
that occurs immediately within a subtype declaration. Any use of a range
other than as a constraint used immediately within a subtype declaration
diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb
index 48eceb0ff77..fb3dc3d74ba 100644
--- a/gcc/ada/gnatbind.adb
+++ b/gcc/ada/gnatbind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, 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- --
@@ -838,6 +838,28 @@ begin
end if;
end loop;
+ -- Subunits do not appear in the elaboration table because they
+ -- are subsumed by their parent units, but we need to list them
+ -- for other tools. For now they are listed after other files,
+ -- rather than right after their parent, since there is no easy
+ -- link between the elaboration table and the ALIs table ???
+ -- Note also that subunits may appear repeatedly in the list,
+ -- if the parent unit appears in the context of several units
+ -- in the closure.
+
+ for J in Sdep.First .. Sdep.Last loop
+ if Sdep.Table (J).Subunit_Name /= No_Name
+ and then not Is_Internal_File_Name (Sdep.Table (J).Sfile)
+ then
+ if not Zero_Formatting then
+ Write_Str (" ");
+ end if;
+
+ Write_Str (Get_Name_String (Sdep.Table (J).Sfile));
+ Write_Eol;
+ end if;
+ end loop;
+
if not Zero_Formatting then
Write_Eol;
end if;
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 0483d82724b..f9bcf634e53 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -2114,6 +2114,7 @@ __gnat_install_handler(void)
#elif defined(__APPLE__)
#include <signal.h>
+#include <sys/syscall.h>
#include <mach/mach_vm.h>
#include <mach/mach_init.h>
#include <mach/vm_statistics.h>
@@ -2123,9 +2124,9 @@ char __gnat_alternate_stack[32 * 1024]; /* 1 * MINSIGSTKSZ */
static void __gnat_error_handler (int sig, siginfo_t * si, void * uc);
-/* Defined in xnu unix_signal.c */
+/* Defined in xnu unix_signal.c.
+ Tell the kernel to re-use alt stack when delivering a signal. */
#define UC_RESET_ALT_STACK 0x80000000
-extern int sigreturn (void *uc, int flavour);
/* Return true if ADDR is within a stack guard area. */
static int
@@ -2173,8 +2174,9 @@ __gnat_error_handler (int sig, siginfo_t * si, void * uc ATTRIBUTE_UNUSED)
msg = "erroneous memory access";
}
/* Reset the use of alt stack, so that the alt stack will be used
- for the next signal delivery. */
- sigreturn (NULL, UC_RESET_ALT_STACK);
+ for the next signal delivery.
+ The stack can't be used in case of stack checking. */
+ syscall (SYS_sigreturn, NULL, UC_RESET_ALT_STACK);
break;
case SIGFPE:
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index dacf290c273..c7eab81d935 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -7372,7 +7372,7 @@ package body Make is
Multilib_Gcc_Path := GNAT.OS_Lib.Locate_Exec_On_Path (Multilib_Gcc.all);
- Create_Temp_File (Output_FD, Output_Name);
+ Create_Temp_Output_File (Output_FD, Output_Name);
if Output_FD = Invalid_FD then
return;
diff --git a/gcc/ada/makeutl.adb b/gcc/ada/makeutl.adb
index a570737d711..f9775495f5b 100644
--- a/gcc/ada/makeutl.adb
+++ b/gcc/ada/makeutl.adb
@@ -25,6 +25,7 @@
with ALI; use ALI;
with Debug;
+with Fname;
with Osint; use Osint;
with Output; use Output;
with Opt; use Opt;
@@ -213,31 +214,35 @@ package body Makeutl is
if Unit_Name /= No_Name then
-- For separates, the file is no longer associated with the
- -- unit ("proc-sep.adb" is not associated with unit "proc.sep".
- -- So we need to check whether the source file still exists in
+ -- unit ("proc-sep.adb" is not associated with unit "proc.sep")
+ -- so we need to check whether the source file still exists in
-- the source tree: it will if it matches the naming scheme
-- (and then will be for the same unit).
if Find_Source
- (In_Tree => Project_Tree,
- Project => No_Project,
- Base_Name => SD.Sfile) = No_Source
+ (In_Tree => Project_Tree,
+ Project => No_Project,
+ Base_Name => SD.Sfile) = No_Source
then
- -- If this is not a runtime file (when using -a) ? Otherwise
- -- we get complaints about a-except.adb, which uses
- -- separates.
-
- if not Check_Readonly_Files
- or else Find_File (SD.Sfile, Osint.Source) = No_File
+ -- If this is not a runtime file or if, when gnatmake switch
+ -- -a is used, we are not able to find this subunit in the
+ -- source directories, then recompilation is needed.
+
+ if not Fname.Is_Internal_File_Name (SD.Sfile)
+ or else
+ (Check_Readonly_Files
+ and then Find_File (SD.Sfile, Osint.Source) = No_File)
then
if Verbose_Mode then
Write_Line
- ("While parsing ALI file: Sdep associates "
+ ("While parsing ALI file, file "
& Get_Name_String (SD.Sfile)
- & " with unit " & Get_Name_String (Unit_Name)
+ & " is indicated as containing subunit "
+ & Get_Name_String (Unit_Name)
& " but this does not match what was found while"
& " parsing the project. Will recompile");
end if;
+
return False;
end if;
end if;
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index f07f54e5098..2bb9d25fcc1 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -89,9 +89,6 @@ package body Ch4 is
-- prefix. The current token is known to be an apostrophe and the
-- following token is known to be RANGE.
- procedure Set_Op_Name (Node : Node_Id);
- -- Procedure to set name field (Chars) in operator node
-
-------------------------
-- Bad_Range_Attribute --
-------------------------
@@ -102,51 +99,6 @@ package body Ch4 is
Resync_Expression;
end Bad_Range_Attribute;
- ------------------
- -- Set_Op_Name --
- ------------------
-
- procedure Set_Op_Name (Node : Node_Id) is
- type Name_Of_Type is array (N_Op) of Name_Id;
- Name_Of : constant Name_Of_Type := Name_Of_Type'(
- N_Op_And => Name_Op_And,
- N_Op_Or => Name_Op_Or,
- N_Op_Xor => Name_Op_Xor,
- N_Op_Eq => Name_Op_Eq,
- N_Op_Ne => Name_Op_Ne,
- N_Op_Lt => Name_Op_Lt,
- N_Op_Le => Name_Op_Le,
- N_Op_Gt => Name_Op_Gt,
- N_Op_Ge => Name_Op_Ge,
- N_Op_Add => Name_Op_Add,
- N_Op_Subtract => Name_Op_Subtract,
- N_Op_Concat => Name_Op_Concat,
- N_Op_Multiply => Name_Op_Multiply,
- N_Op_Divide => Name_Op_Divide,
- N_Op_Mod => Name_Op_Mod,
- N_Op_Rem => Name_Op_Rem,
- N_Op_Expon => Name_Op_Expon,
- N_Op_Plus => Name_Op_Add,
- N_Op_Minus => Name_Op_Subtract,
- N_Op_Abs => Name_Op_Abs,
- N_Op_Not => Name_Op_Not,
-
- -- We don't really need these shift operators, since they never
- -- appear as operators in the source, but the path of least
- -- resistance is to put them in (the aggregate must be complete)
-
- N_Op_Rotate_Left => Name_Rotate_Left,
- N_Op_Rotate_Right => Name_Rotate_Right,
- N_Op_Shift_Left => Name_Shift_Left,
- N_Op_Shift_Right => Name_Shift_Right,
- N_Op_Shift_Right_Arithmetic => Name_Shift_Right_Arithmetic);
-
- begin
- if Nkind (Node) in N_Op then
- Set_Chars (Node, Name_Of (Nkind (Node)));
- end if;
- end Set_Op_Name;
-
--------------------------
-- 4.1 Name (also 6.4) --
--------------------------
@@ -1600,10 +1552,9 @@ package body Ch4 is
end if;
Node2 := Node1;
- Node1 := New_Node (Logical_Op, Op_Location);
+ Node1 := New_Op_Node (Logical_Op, Op_Location);
Set_Left_Opnd (Node1, Node2);
Set_Right_Opnd (Node1, P_Relation);
- Set_Op_Name (Node1);
exit when Token not in Token_Class_Logop;
end loop;
@@ -1704,10 +1655,9 @@ package body Ch4 is
end if;
Node2 := Node1;
- Node1 := New_Node (Logical_Op, Op_Location);
+ Node1 := New_Op_Node (Logical_Op, Op_Location);
Set_Left_Opnd (Node1, Node2);
Set_Right_Opnd (Node1, P_Relation);
- Set_Op_Name (Node1);
exit when Token not in Token_Class_Logop;
end loop;
@@ -1768,9 +1718,8 @@ package body Ch4 is
-- P_Relational_Operator also parses the IN and NOT IN operations.
Optok := Token_Ptr;
- Node2 := New_Node (P_Relational_Operator, Optok);
+ Node2 := New_Op_Node (P_Relational_Operator, Optok);
Set_Left_Opnd (Node2, Node1);
- Set_Op_Name (Node2);
-- Case of IN or NOT IN
@@ -1881,18 +1830,17 @@ package body Ch4 is
Style.Check_Exponentiation_Operator;
end if;
- Node2 := New_Node (N_Op_Expon, Token_Ptr);
+ Node2 := New_Op_Node (N_Op_Expon, Token_Ptr);
Scan; -- past **
Set_Left_Opnd (Node2, Node1);
Set_Right_Opnd (Node2, P_Primary);
- Set_Op_Name (Node2);
Node1 := Node2;
end if;
loop
exit when Token not in Token_Class_Mulop;
Tokptr := Token_Ptr;
- Node2 := New_Node (P_Multiplying_Operator, Tokptr);
+ Node2 := New_Op_Node (P_Multiplying_Operator, Tokptr);
if Style_Check then
Style.Check_Binary_Operator;
@@ -1901,14 +1849,13 @@ package body Ch4 is
Scan; -- past operator
Set_Left_Opnd (Node2, Node1);
Set_Right_Opnd (Node2, P_Factor);
- Set_Op_Name (Node2);
Node1 := Node2;
end loop;
loop
exit when Token not in Token_Class_Binary_Addop;
Tokptr := Token_Ptr;
- Node2 := New_Node (P_Binary_Adding_Operator, Tokptr);
+ Node2 := New_Op_Node (P_Binary_Adding_Operator, Tokptr);
if Style_Check then
Style.Check_Binary_Operator;
@@ -1917,7 +1864,6 @@ package body Ch4 is
Scan; -- past operator
Set_Left_Opnd (Node2, Node1);
Set_Right_Opnd (Node2, P_Term);
- Set_Op_Name (Node2);
Node1 := Node2;
end loop;
@@ -1931,7 +1877,7 @@ package body Ch4 is
if Token in Token_Class_Unary_Addop then
Tokptr := Token_Ptr;
- Node1 := New_Node (P_Unary_Adding_Operator, Tokptr);
+ Node1 := New_Op_Node (P_Unary_Adding_Operator, Tokptr);
if Style_Check then
Style.Check_Unary_Plus_Or_Minus;
@@ -1939,7 +1885,6 @@ package body Ch4 is
Scan; -- past operator
Set_Right_Opnd (Node1, P_Term);
- Set_Op_Name (Node1);
else
Node1 := P_Term;
end if;
@@ -1981,12 +1926,11 @@ package body Ch4 is
loop
exit when Token not in Token_Class_Binary_Addop;
Tokptr := Token_Ptr;
- Node2 := New_Node (P_Binary_Adding_Operator, Tokptr);
+ Node2 := New_Op_Node (P_Binary_Adding_Operator, Tokptr);
Scan; -- past operator
Set_Left_Opnd (Node2, Node1);
Node1 := P_Term;
Set_Right_Opnd (Node2, Node1);
- Set_Op_Name (Node2);
-- Check if we're still concatenating string literals
@@ -2214,11 +2158,10 @@ package body Ch4 is
loop
exit when Token not in Token_Class_Mulop;
Tokptr := Token_Ptr;
- Node2 := New_Node (P_Multiplying_Operator, Tokptr);
+ Node2 := New_Op_Node (P_Multiplying_Operator, Tokptr);
Scan; -- past operator
Set_Left_Opnd (Node2, Node1);
Set_Right_Opnd (Node2, P_Factor);
- Set_Op_Name (Node2);
Node1 := Node2;
end loop;
@@ -2239,7 +2182,7 @@ package body Ch4 is
begin
if Token = Tok_Abs then
- Node1 := New_Node (N_Op_Abs, Token_Ptr);
+ Node1 := New_Op_Node (N_Op_Abs, Token_Ptr);
if Style_Check then
Style.Check_Abs_Not;
@@ -2247,11 +2190,10 @@ package body Ch4 is
Scan; -- past ABS
Set_Right_Opnd (Node1, P_Primary);
- Set_Op_Name (Node1);
return Node1;
elsif Token = Tok_Not then
- Node1 := New_Node (N_Op_Not, Token_Ptr);
+ Node1 := New_Op_Node (N_Op_Not, Token_Ptr);
if Style_Check then
Style.Check_Abs_Not;
@@ -2259,18 +2201,16 @@ package body Ch4 is
Scan; -- past NOT
Set_Right_Opnd (Node1, P_Primary);
- Set_Op_Name (Node1);
return Node1;
else
Node1 := P_Primary;
if Token = Tok_Double_Asterisk then
- Node2 := New_Node (N_Op_Expon, Token_Ptr);
+ Node2 := New_Op_Node (N_Op_Expon, Token_Ptr);
Scan; -- past **
Set_Left_Opnd (Node2, Node1);
Set_Right_Opnd (Node2, P_Primary);
- Set_Op_Name (Node2);
return Node2;
else
return Node1;
diff --git a/gcc/ada/prj-err.adb b/gcc/ada/prj-err.adb
index 8e0d5627a67..3728c9e44b0 100644
--- a/gcc/ada/prj-err.adb
+++ b/gcc/ada/prj-err.adb
@@ -23,8 +23,9 @@
-- --
------------------------------------------------------------------------------
-with Output; use Output;
-with Stringt; use Stringt;
+with Err_Vars;
+with Output; use Output;
+with Stringt; use Stringt;
package body Prj.Err is
@@ -117,7 +118,13 @@ package body Prj.Err is
if Flags.Report_Error /= null then
Flags.Report_Error
(Project,
- Is_Warning => Msg (Msg'First) = '?' or else Msg (Msg'First) = '<');
+ Is_Warning =>
+ Msg (Msg'First) = '?'
+ or else (Msg (Msg'First) = '<'
+ and then Err_Vars.Error_Msg_Warn)
+ or else (Msg (Msg'First) = '\'
+ and then Msg (Msg'First + 1) = '<'
+ and then Err_Vars.Error_Msg_Warn));
end if;
end Error_Msg;
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index cec5e6b0a59..5e76bce58ac 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -4707,121 +4707,82 @@ package body Prj.Nmsc is
Removed : Boolean := False)
is
Directory : constant String := Get_Name_String (From);
- Element : String_Element;
+
+ procedure Add_To_Or_Remove_From_List
+ (Path_Id : Name_Id;
+ Display_Path_Id : Name_Id);
+ -- When Removed = False, the directory Path_Id to the list of
+ -- source_dirs if not already in the list. When Removed = True,
+ -- removed directory Path_Id if in the list.
procedure Recursive_Find_Dirs (Path : Name_Id);
-- Find all the subdirectories (recursively) of Path and add them
-- to the list of source directories of the project.
- -------------------------
- -- Recursive_Find_Dirs --
- -------------------------
-
- procedure Recursive_Find_Dirs (Path : Name_Id) is
- Dir : Dir_Type;
- Name : String (1 .. 250);
- Last : Natural;
- List : String_List_Id;
- Prev : String_List_Id;
- Rank_List : Number_List_Index;
- Prev_Rank : Number_List_Index;
- Element : String_Element;
- Found : Boolean := False;
-
- Non_Canonical_Path : Name_Id := No_Name;
- Canonical_Path : Name_Id := No_Name;
-
- The_Path : constant String :=
- Normalize_Pathname
- (Get_Name_String (Path),
- Directory =>
- Get_Name_String (Project.Directory.Display_Name),
- Resolve_Links => Opt.Follow_Links_For_Dirs) &
- Directory_Separator;
-
- The_Path_Last : constant Natural :=
- Compute_Directory_Last (The_Path);
+ --------------------------------
+ -- Add_To_Or_Remove_From_List --
+ --------------------------------
+
+ procedure Add_To_Or_Remove_From_List
+ (Path_Id : Name_Id;
+ Display_Path_Id : Name_Id)
+ is
+ List : String_List_Id;
+ Prev : String_List_Id;
+ Rank_List : Number_List_Index;
+ Prev_Rank : Number_List_Index;
+ Element : String_Element;
begin
- Name_Len := The_Path_Last - The_Path'First + 1;
- Name_Buffer (1 .. Name_Len) :=
- The_Path (The_Path'First .. The_Path_Last);
- Non_Canonical_Path := Name_Find;
- Canonical_Path :=
- Name_Id (Canonical_Case_File_Name (Non_Canonical_Path));
-
- -- To avoid processing the same directory several times, check
- -- if the directory is already in Recursive_Dirs. If it is, then
- -- there is nothing to do, just return. If it is not, put it there
- -- and continue recursive processing.
-
- if not Removed then
- if Recursive_Dirs.Get (Visited, Canonical_Path) then
- return;
- else
- Recursive_Dirs.Set (Visited, Canonical_Path, True);
- end if;
- end if;
-
- -- Check if directory is already in list
-
- List := Project.Source_Dirs;
- Prev := Nil_String;
- Rank_List := Project.Source_Dir_Ranks;
+ Prev := Nil_String;
Prev_Rank := No_Number_List;
+ List := Project.Source_Dirs;
+ Rank_List := Project.Source_Dir_Ranks;
while List /= Nil_String loop
Element := Data.Tree.String_Elements.Table (List);
-
- if Element.Value /= No_Name then
- Found := Element.Value = Canonical_Path;
- exit when Found;
- end if;
-
+ exit when Element.Value = Path_Id;
Prev := List;
List := Element.Next;
Prev_Rank := Rank_List;
- Rank_List := Data.Tree.Number_Lists.Table (Rank_List).Next;
+ Rank_List := Data.Tree.Number_Lists.Table (Prev_Rank).Next;
end loop;
- -- If directory is not already in list, put it there
+ -- The directory is in the list if List is not Nil_String
- if (not Removed) and (not Found) then
+ if not Removed and then List = Nil_String then
if Current_Verbosity = High then
- Write_Str (" ");
- Write_Line (The_Path (The_Path'First .. The_Path_Last));
+ Write_Str (" Adding Source Dir=");
+ Write_Line (Get_Name_String (Path_Id));
end if;
String_Element_Table.Increment_Last (Data.Tree.String_Elements);
Element :=
- (Value => Canonical_Path,
- Display_Value => Non_Canonical_Path,
+ (Value => Path_Id,
+ Index => 0,
+ Display_Value => Display_Path_Id,
Location => No_Location,
Flag => False,
- Next => Nil_String,
- Index => 0);
+ Next => Nil_String);
Number_List_Table.Increment_Last (Data.Tree.Number_Lists);
- -- Case of first source directory
-
if Last_Source_Dir = Nil_String then
+
+ -- This is the first source directory
+
Project.Source_Dirs :=
String_Element_Table.Last (Data.Tree.String_Elements);
Project.Source_Dir_Ranks :=
Number_List_Table.Last (Data.Tree.Number_Lists);
- -- Here we already have source directories
-
else
- -- Link the previous last to the new one
+ -- We already have source directories, link the previous
+ -- last to the new one.
- Data.Tree.String_Elements.Table
- (Last_Source_Dir).Next :=
+ Data.Tree.String_Elements.Table (Last_Source_Dir).Next :=
String_Element_Table.Last (Data.Tree.String_Elements);
- Data.Tree.Number_Lists.Table
- (Last_Src_Dir_Rank).Next :=
+ Data.Tree.Number_Lists.Table (Last_Src_Dir_Rank).Next :=
Number_List_Table.Last (Data.Tree.Number_Lists);
-
end if;
-- And register this source directory as the new last
@@ -4834,12 +4795,16 @@ package body Prj.Nmsc is
Data.Tree.Number_Lists.Table (Last_Src_Dir_Rank) :=
(Number => Rank, Next => No_Number_List);
- elsif Removed and Found then
+ elsif Removed and then List /= Nil_String then
+
+ -- Remove source dir, if present
+
if Prev = Nil_String then
Project.Source_Dirs :=
Data.Tree.String_Elements.Table (List).Next;
Project.Source_Dir_Ranks :=
Data.Tree.Number_Lists.Table (Rank_List).Next;
+
else
Data.Tree.String_Elements.Table (Prev).Next :=
Data.Tree.String_Elements.Table (List).Next;
@@ -4847,10 +4812,59 @@ package body Prj.Nmsc is
Data.Tree.Number_Lists.Table (Rank_List).Next;
end if;
end if;
+ end Add_To_Or_Remove_From_List;
+
+ -------------------------
+ -- Recursive_Find_Dirs --
+ -------------------------
+
+ procedure Recursive_Find_Dirs (Path : Name_Id) is
+ Dir : Dir_Type;
+ Name : String (1 .. 250);
+ Last : Natural;
- -- Now look for subdirectories. We do that even when this
- -- directory is already in the list, because some of its
- -- subdirectories may not be in the list yet.
+ Non_Canonical_Path : Name_Id := No_Name;
+ Canonical_Path : Name_Id := No_Name;
+
+ The_Path : constant String :=
+ Normalize_Pathname
+ (Get_Name_String (Path),
+ Directory =>
+ Get_Name_String (Project.Directory.Display_Name),
+ Resolve_Links => Opt.Follow_Links_For_Dirs) &
+ Directory_Separator;
+
+ The_Path_Last : constant Natural :=
+ Compute_Directory_Last (The_Path);
+
+ begin
+ Name_Len := The_Path_Last - The_Path'First + 1;
+ Name_Buffer (1 .. Name_Len) :=
+ The_Path (The_Path'First .. The_Path_Last);
+ Non_Canonical_Path := Name_Find;
+ Canonical_Path :=
+ Name_Id (Canonical_Case_File_Name (Non_Canonical_Path));
+
+ -- To avoid processing the same directory several times, check
+ -- if the directory is already in Recursive_Dirs. If it is, then
+ -- there is nothing to do, just return. If it is not, put it there
+ -- and continue recursive processing.
+
+ if not Removed then
+ if Recursive_Dirs.Get (Visited, Canonical_Path) then
+ return;
+ else
+ Recursive_Dirs.Set (Visited, Canonical_Path, True);
+ end if;
+ end if;
+
+ Add_To_Or_Remove_From_List
+ (Path_Id => Canonical_Path,
+ Display_Path_Id => Non_Canonical_Path);
+
+ -- Now look for subdirectories. Do that even when this directory
+ -- is already in the list, because some of its subdirectories may
+ -- not be in the list yet.
Open (Dir, The_Path (The_Path'First .. The_Path_Last));
@@ -4870,12 +4884,14 @@ package body Prj.Nmsc is
declare
Path_Name : constant String :=
- Normalize_Pathname
- (Name => Name (1 .. Last),
- Directory =>
- The_Path (The_Path'First .. The_Path_Last),
- Resolve_Links => Opt.Follow_Links_For_Dirs,
- Case_Sensitive => True);
+ Normalize_Pathname
+ (Name => Name (1 .. Last),
+ Directory =>
+ The_Path
+ (The_Path'First .. The_Path_Last),
+ Resolve_Links =>
+ Opt.Follow_Links_For_Dirs,
+ Case_Sensitive => True);
begin
if Is_Directory (Path_Name) then
@@ -4945,7 +4961,8 @@ package body Prj.Nmsc is
Directory =>
Get_Name_String
(Project.Directory.Display_Name),
- Resolve_Links => False,
+ Resolve_Links =>
+ Opt.Follow_Links_For_Dirs,
Case_Sensitive => True);
begin
@@ -4987,10 +5004,6 @@ package body Prj.Nmsc is
else
declare
Path_Name : Path_Information;
- List : String_List_Id;
- Prev : String_List_Id;
- Rank_List : Number_List_Index;
- Prev_Rank : Number_List_Index;
Dir_Exists : Boolean;
begin
@@ -5019,8 +5032,16 @@ package body Prj.Nmsc is
else
declare
- Path : constant String :=
- Get_Name_String (Path_Name.Name);
+ Path : constant String :=
+ Normalize_Pathname
+ (Name =>
+ Get_Name_String (Path_Name.Name),
+ Directory =>
+ Get_Name_String (Project.Directory.Name),
+ Resolve_Links => Opt.Follow_Links_For_Dirs,
+ Case_Sensitive => True) &
+ Directory_Separator;
+
Last_Path : constant Natural :=
Compute_Directory_Last (Path);
Path_Id : Name_Id;
@@ -5036,113 +5057,16 @@ package body Prj.Nmsc is
Name_Len := 0;
Add_Str_To_Name_Buffer (Path (Path'First .. Last_Path));
Path_Id := Name_Find;
+
Name_Len := 0;
Add_Str_To_Name_Buffer
(Display_Path
(Display_Path'First .. Last_Display_Path));
Display_Path_Id := Name_Find;
- -- Check if the directory is already in the list
-
- Prev := Nil_String;
- Prev_Rank := No_Number_List;
-
- -- Look for source dir in current list
-
- List := Project.Source_Dirs;
- Rank_List := Project.Source_Dir_Ranks;
- while List /= Nil_String loop
- Element := Data.Tree.String_Elements.Table (List);
- exit when Element.Value = Path_Id;
- Prev := List;
- List := Element.Next;
- Prev_Rank := Rank_List;
- Rank_List :=
- Data.Tree.Number_Lists.Table (Prev_Rank).Next;
- end loop;
-
- -- The directory is in the list if List is not Nil_String
-
- if not Removed then
-
- -- As it is an existing directory, we add it to the
- -- list of directories, if not already in the list.
-
- if List = Nil_String then
- String_Element_Table.Increment_Last
- (Data.Tree.String_Elements);
- Element :=
- (Value => Path_Id,
- Index => 0,
- Display_Value => Display_Path_Id,
- Location => No_Location,
- Flag => False,
- Next => Nil_String);
- Number_List_Table.Increment_Last
- (Data.Tree.Number_Lists);
-
- if Last_Source_Dir = Nil_String then
-
- -- This is the first source directory
-
- Project.Source_Dirs :=
- String_Element_Table.Last
- (Data.Tree.String_Elements);
- Project.Source_Dir_Ranks :=
- Number_List_Table.Last
- (Data.Tree.Number_Lists);
-
- else
- -- We already have source directories, link the
- -- previous last to the new one.
-
- Data.Tree.String_Elements.Table
- (Last_Source_Dir).Next :=
- String_Element_Table.Last
- (Data.Tree.String_Elements);
- Data.Tree.Number_Lists.Table
- (Last_Src_Dir_Rank).Next :=
- Number_List_Table.Last
- (Data.Tree.Number_Lists);
-
- end if;
-
- -- And register this source directory as the new
- -- last.
-
- Last_Source_Dir :=
- String_Element_Table.Last
- (Data.Tree.String_Elements);
- Data.Tree.String_Elements.Table
- (Last_Source_Dir) := Element;
- Last_Src_Dir_Rank :=
- Number_List_Table.Last
- (Data.Tree.Number_Lists);
- Data.Tree.Number_Lists.Table
- (Last_Src_Dir_Rank) :=
- (Number => Rank, Next => No_Number_List);
- end if;
-
- else
- -- Remove source dir, if present
-
- if List /= Nil_String then
- -- Source dir was found, remove it from the list
-
- if Prev = Nil_String then
- Project.Source_Dirs :=
- Data.Tree.String_Elements.Table (List).Next;
- Project.Source_Dir_Ranks :=
- Data.Tree.Number_Lists.Table (Rank_List).Next;
-
- else
- Data.Tree.String_Elements.Table (Prev).Next :=
- Data.Tree.String_Elements.Table (List).Next;
- Data.Tree.Number_Lists.Table (Prev_Rank).Next :=
- Data.Tree.Number_Lists.Table (Rank_List).Next;
- end if;
- end if;
- end if;
+ Add_To_Or_Remove_From_List
+ (Path_Id => Path_Id,
+ Display_Path_Id => Display_Path_Id);
end;
end if;
end;
diff --git a/gcc/ada/prj-part.adb b/gcc/ada/prj-part.adb
index 1ed78ab227b..7702f540930 100644
--- a/gcc/ada/prj-part.adb
+++ b/gcc/ada/prj-part.adb
@@ -485,19 +485,27 @@ package body Prj.Part is
return;
end if;
- Parse_Single_Project
- (In_Tree => In_Tree,
- Project => Project,
- Extends_All => Dummy,
- Path_Name => Path_Name,
- Extended => False,
- From_Extended => None,
- In_Limited => False,
- Packages_To_Check => Packages_To_Check,
- Depth => 0,
- Current_Dir => Current_Directory,
- Is_Config_File => Is_Config_File,
- Flags => Flags);
+ begin
+ Parse_Single_Project
+ (In_Tree => In_Tree,
+ Project => Project,
+ Extends_All => Dummy,
+ Path_Name => Path_Name,
+ Extended => False,
+ From_Extended => None,
+ In_Limited => False,
+ Packages_To_Check => Packages_To_Check,
+ Depth => 0,
+ Current_Dir => Current_Directory,
+ Is_Config_File => Is_Config_File,
+ Flags => Flags);
+
+ exception
+ when Types.Unrecoverable_Error =>
+ -- Unrecoverable_Error is raised when a line is too long.
+ -- A meaningful error message will be displayed later.
+ Project := Empty_Node;
+ end;
-- If Project is an extending-all project, create the eventual
-- virtual extending projects and check that there are no illegally
diff --git a/gcc/ada/prj-tree.adb b/gcc/ada/prj-tree.adb
index 4823a988d6c..df6e5acb6cf 100644
--- a/gcc/ada/prj-tree.adb
+++ b/gcc/ada/prj-tree.adb
@@ -23,10 +23,11 @@
-- --
------------------------------------------------------------------------------
-with Ada.Unchecked_Deallocation;
with Osint; use Osint;
with Prj.Err;
+with Ada.Unchecked_Deallocation;
+
package body Prj.Tree is
Node_With_Comments : constant array (Project_Node_Kind) of Boolean :=
@@ -1000,6 +1001,8 @@ package body Prj.Tree is
if Proj /= null then
Project_Node_Table.Free (Proj.Project_Nodes);
Projects_Htable.Reset (Proj.Projects_HT);
+ Name_To_Name_HTable.Reset (Proj.External_References);
+ Free (Proj.Project_Path);
Unchecked_Free (Proj);
end if;
end Free;
diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c
index 1d9efb93b7f..3589bc5dfd1 100644
--- a/gcc/ada/raise-gcc.c
+++ b/gcc/ada/raise-gcc.c
@@ -56,6 +56,14 @@ typedef char bool;
#include "adaint.h"
#include "raise.h"
+#ifdef __APPLE__
+/* On MacOS X, versions older than 10.5 don't export _Unwind_GetIPInfo. */
+#undef HAVE_GETIPINFO
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+#define HAVE_GETIPINFO 1
+#endif
+#endif
+
/* The names of a couple of "standard" routines for unwinding/propagation
actually vary depending on the underlying GCC scheme for exception handling
(SJLJ or DWARF). We need a consistently named interface to import from
@@ -501,7 +509,14 @@ typedef struct
static void
db_region_for (region_descriptor *region, _Unwind_Context *uw_context)
{
- _Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1;
+ int ip_before_insn = 0;
+#ifdef HAVE_GETIPINFO
+ _Unwind_Ptr ip = _Unwind_GetIPInfo (uw_context, &ip_before_insn);
+#else
+ _Unwind_Ptr ip = _Unwind_GetIP (uw_context);
+#endif
+ if (!ip_before_insn)
+ ip--;
if (! (db_accepted_codes () & DB_REGIONS))
return;
@@ -631,7 +646,14 @@ typedef struct
static void
db_action_for (action_descriptor *action, _Unwind_Context *uw_context)
{
- _Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1;
+ int ip_before_insn = 0;
+#ifdef HAVE_GETIPINFO
+ _Unwind_Ptr ip = _Unwind_GetIPInfo (uw_context, &ip_before_insn);
+#else
+ _Unwind_Ptr ip = _Unwind_GetIP (uw_context);
+#endif
+ if (!ip_before_insn)
+ ip--;
db (DB_ACTIONS, "For ip @ 0x%08x => ", ip);
@@ -670,14 +692,6 @@ db_action_for (action_descriptor *action, _Unwind_Context *uw_context)
There are two variants of this routine, depending on the underlying
mechanism (DWARF/SJLJ), which account for differences in the tables. */
-#ifdef __APPLE__
-/* On MacOS X, versions older than 10.5 don't export _Unwind_GetIPInfo. */
-#undef HAVE_GETIPINFO
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
-#define HAVE_GETIPINFO 1
-#endif
-#endif
-
#ifdef __USING_SJLJ_EXCEPTIONS__
#define __builtin_eh_return_data_regno(x) x
diff --git a/gcc/ada/s-crtl.ads b/gcc/ada/s-crtl.ads
index 5a9902dd657..f013a418fcb 100644
--- a/gcc/ada/s-crtl.ads
+++ b/gcc/ada/s-crtl.ads
@@ -202,4 +202,7 @@ package System.CRTL is
function write (fd : int; buffer : chars; nbytes : int) return int;
pragma Import (C, write, "write");
+ function strerror (errno : int) return chars;
+ pragma Import (C, strerror, "strerror");
+
end System.CRTL;
diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb
index df45003cd1a..d6cd2ad0386 100644
--- a/gcc/ada/s-fileio.adb
+++ b/gcc/ada/s-fileio.adb
@@ -31,7 +31,10 @@
with Ada.Finalization; use Ada.Finalization;
with Ada.IO_Exceptions; use Ada.IO_Exceptions;
+with Ada.Unchecked_Conversion;
+
with Interfaces.C;
+with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System.CRTL;
@@ -48,7 +51,7 @@ package body System.File_IO is
package SSL renames System.Soft_Links;
use type Interfaces.C.int;
- use type System.CRTL.size_t;
+ use type CRTL.size_t;
----------------------
-- Global Variables --
@@ -126,6 +129,23 @@ package body System.File_IO is
-- call to fopen or freopen. Amethod is the character designating
-- the access method from the Access_Method field of the FCB.
+ function Errno_Message
+ (Errno : Integer := OS_Lib.Errno) return String;
+ function Errno_Message
+ (Name : String;
+ Errno : Integer := OS_Lib.Errno) return String;
+ -- Return a message suitable for "raise ... with Errno_Message (...)".
+ -- Errno defaults to the current errno, but should be passed explicitly if
+ -- there is significant code in between the call that sets errno and the
+ -- call to Errno_Message, in case that code also sets errno. The version
+ -- with Name includes that file name in the message.
+
+ procedure Raise_Device_Error
+ (File : AFCB_Ptr; Errno : Integer := OS_Lib.Errno);
+ pragma No_Return (Raise_Device_Error);
+ -- Clear error indication on File and raise Device_Error with an exception
+ -- message providing errno information.
+
----------------
-- Append_Set --
----------------
@@ -134,7 +154,7 @@ package body System.File_IO is
begin
if File.Mode = Append_File then
if fseek (File.Stream, 0, SEEK_END) /= 0 then
- raise Device_Error;
+ Raise_Device_Error (File);
end if;
end if;
end Append_Set;
@@ -174,7 +194,7 @@ package body System.File_IO is
procedure Check_File_Open (File : AFCB_Ptr) is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "file not open";
end if;
end Check_File_Open;
@@ -185,9 +205,9 @@ package body System.File_IO is
procedure Check_Read_Status (File : AFCB_Ptr) is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "file not open";
elsif File.Mode > Inout_File then
- raise Mode_Error;
+ raise Mode_Error with "file not readable";
end if;
end Check_Read_Status;
@@ -198,9 +218,9 @@ package body System.File_IO is
procedure Check_Write_Status (File : AFCB_Ptr) is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "file not open";
elsif File.Mode = In_File then
- raise Mode_Error;
+ raise Mode_Error with "file not writable";
end if;
end Check_Write_Status;
@@ -212,6 +232,7 @@ package body System.File_IO is
Close_Status : int := 0;
Dup_Strm : Boolean := False;
File : AFCB_Ptr renames File_Ptr.all;
+ Errno : Integer;
begin
-- Take a task lock, to protect the global data value Open_Files
@@ -223,15 +244,14 @@ package body System.File_IO is
-- Sever the association between the given file and its associated
-- external file. The given file is left closed. Do not perform system
- -- closes on the standard input, output and error files and also do
- -- not attempt to close a stream that does not exist (signalled by a
- -- null stream value -- happens in some error situations).
+ -- closes on the standard input, output and error files and also do not
+ -- attempt to close a stream that does not exist (signalled by a null
+ -- stream value -- happens in some error situations).
- if not File.Is_System_File
- and then File.Stream /= NULL_Stream
- then
- -- Do not do an fclose if this is a shared file and there is
- -- at least one other instance of the stream that is open.
+ if not File.Is_System_File and then File.Stream /= NULL_Stream then
+
+ -- Do not do an fclose if this is a shared file and there is at least
+ -- one other instance of the stream that is open.
if File.Shared_Status = Yes then
declare
@@ -240,9 +260,7 @@ package body System.File_IO is
begin
P := Open_Files;
while P /= null loop
- if P /= File
- and then File.Stream = P.Stream
- then
+ if P /= File and then File.Stream = P.Stream then
Dup_Strm := True;
exit;
end if;
@@ -256,6 +274,10 @@ package body System.File_IO is
if not Dup_Strm then
Close_Status := fclose (File.Stream);
+
+ if Close_Status /= 0 then
+ Errno := OS_Lib.Errno;
+ end if;
end if;
end if;
@@ -284,7 +306,7 @@ package body System.File_IO is
File := null;
if Close_Status /= 0 then
- raise Device_Error;
+ Raise_Device_Error (null, Errno);
end if;
SSL.Unlock_Task.all;
@@ -301,11 +323,12 @@ package body System.File_IO is
procedure Delete (File_Ptr : access AFCB_Ptr) is
File : AFCB_Ptr renames File_Ptr.all;
+
begin
Check_File_Open (File);
if not File.Is_Regular_File then
- raise Use_Error;
+ raise Use_Error with "cannot delete non-regular file";
end if;
declare
@@ -314,12 +337,12 @@ package body System.File_IO is
begin
Close (File_Ptr);
- -- Now unlink the external file. Note that we use the full name
- -- in this unlink, because the working directory may have changed
- -- since we did the open, and we want to unlink the right file!
+ -- Now unlink the external file. Note that we use the full name in
+ -- this unlink, because the working directory may have changed since
+ -- we did the open, and we want to unlink the right file!
if unlink (Filename'Address) = -1 then
- raise Use_Error;
+ raise Use_Error with Errno_Message;
end if;
end;
end Delete;
@@ -347,13 +370,40 @@ package body System.File_IO is
end if;
end End_Of_File;
+ -------------------
+ -- Errno_Message --
+ -------------------
+
+ function Errno_Message (Errno : Integer := OS_Lib.Errno) return String is
+ function To_Chars_Ptr is
+ new Ada.Unchecked_Conversion (System.Address, chars_ptr);
+
+ Message : constant chars_ptr :=
+ To_Chars_Ptr (CRTL.strerror (Errno));
+
+ begin
+ if Message = Null_Ptr then
+ return "errno =" & Errno'Img;
+ else
+ return Value (Message);
+ end if;
+ end Errno_Message;
+
+ function Errno_Message
+ (Name : String;
+ Errno : Integer := OS_Lib.Errno) return String
+ is
+ begin
+ return Name & ": " & String'(Errno_Message (Errno));
+ end Errno_Message;
+
--------------
-- Finalize --
--------------
- -- Note: we do not need to worry about locking against multiple task
- -- access in this routine, since it is called only from the environment
- -- task just before terminating execution.
+ -- Note: we do not need to worry about locking against multiple task access
+ -- in this routine, since it is called only from the environment task just
+ -- before terminating execution.
procedure Finalize (V : in out File_IO_Clean_Up_Type) is
pragma Warnings (Off, V);
@@ -369,8 +419,8 @@ package body System.File_IO is
SSL.Lock_Task.all;
- -- First close all open files (the slightly complex form of this loop
- -- is required because Close as a side effect nulls out its argument)
+ -- First close all open files (the slightly complex form of this loop is
+ -- required because Close as a side effect nulls out its argument).
Fptr1 := Open_Files;
while Fptr1 /= null loop
@@ -379,9 +429,9 @@ package body System.File_IO is
Fptr1 := Fptr2;
end loop;
- -- Now unlink all temporary files. We do not bother to free the
- -- blocks because we are just about to terminate the program. We
- -- also ignore any errors while attempting these unlink operations.
+ -- Now unlink all temporary files. We do not bother to free the blocks
+ -- because we are just about to terminate the program. We also ignore
+ -- any errors while attempting these unlink operations.
while Temp_Files /= null loop
Discard := unlink (Temp_Files.Name'Address);
@@ -404,10 +454,8 @@ package body System.File_IO is
begin
Check_Write_Status (File);
- if fflush (File.Stream) = 0 then
- return;
- else
- raise Device_Error;
+ if fflush (File.Stream) /= 0 then
+ Raise_Device_Error (File);
end if;
end Flush;
@@ -429,20 +477,20 @@ package body System.File_IO is
-- you can reset to earlier points in the file. The caller must use the
-- Append_Set routine to deal with the necessary positioning.
- -- Note: in several cases, the fopen mode used allows reading and
- -- writing, but the setting of the Ada mode is more restrictive. For
- -- instance, Create in In_File mode uses "w+" which allows writing,
- -- but the Ada mode In_File will cause any write operations to be
- -- rejected with Mode_Error in any case.
+ -- Note: in several cases, the fopen mode used allows reading and writing,
+ -- but the setting of the Ada mode is more restrictive. For instance,
+ -- Create in In_File mode uses "w+" which allows writing, but the Ada mode
+ -- In_File will cause any write operations to be rejected with Mode_Error
+ -- in any case.
- -- Note: for the Out_File/Open cases for other than the Direct_IO case,
- -- an initial call will be made by the caller to first open the file in
- -- "r" mode to be sure that it exists. The real open, in "w" mode, will
- -- then destroy this file. This is peculiar, but that's what Ada semantics
- -- require and the ACVT tests insist on!
+ -- Note: for the Out_File/Open cases for other than the Direct_IO case, an
+ -- initial call will be made by the caller to first open the file in "r"
+ -- mode to be sure that it exists. The real open, in "w" mode, will then
+ -- destroy this file. This is peculiar, but that's what Ada semantics
+ -- require and the ACATS tests insist on!
- -- If text file translation is required, then either b or t is
- -- added to the mode, depending on the setting of Text.
+ -- If text file translation is required, then either "b" or "t" is appended
+ -- to the mode, depending on the setting of Text.
procedure Fopen_Mode
(Mode : File_Mode;
@@ -510,7 +558,7 @@ package body System.File_IO is
function Form (File : AFCB_Ptr) return String is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "Form: file not open";
else
return File.Form.all (1 .. File.Form'Length - 1);
end if;
@@ -523,8 +571,7 @@ package body System.File_IO is
function Form_Boolean
(Form : String;
Keyword : String;
- Default : Boolean)
- return Boolean
+ Default : Boolean) return Boolean
is
V1, V2 : Natural;
pragma Unreferenced (V2);
@@ -542,7 +589,7 @@ package body System.File_IO is
return False;
else
- raise Use_Error;
+ raise Use_Error with "invalid Form";
end if;
end Form_Boolean;
@@ -553,8 +600,7 @@ package body System.File_IO is
function Form_Integer
(Form : String;
Keyword : String;
- Default : Integer)
- return Integer
+ Default : Integer) return Integer
is
V1, V2 : Natural;
V : Integer;
@@ -570,13 +616,13 @@ package body System.File_IO is
for J in V1 .. V2 loop
if Form (J) not in '0' .. '9' then
- raise Use_Error;
+ raise Use_Error with "invalid Form";
else
V := V * 10 + Character'Pos (Form (J)) - Character'Pos ('0');
end if;
if V > 999_999 then
- raise Use_Error;
+ raise Use_Error with "invalid Form";
end if;
end loop;
@@ -593,11 +639,9 @@ package body System.File_IO is
Keyword : String;
Start : out Natural;
Stop : out Natural)
- is
+ is
Klen : constant Integer := Keyword'Length;
- -- Start of processing for Form_Parameter
-
begin
for J in Form'First + Klen .. Form'Last - 1 loop
if Form (J) = '='
@@ -663,6 +707,7 @@ package body System.File_IO is
begin
status := setvbuf (File.Stream, Null_Address, IOLBF, Line_Siz);
+ -- No error checking???
end Make_Line_Buffered;
---------------------
@@ -675,6 +720,7 @@ package body System.File_IO is
begin
status := setvbuf (File.Stream, Null_Address, IONBF, 0);
+ -- No error checking???
end Make_Unbuffered;
----------
@@ -684,7 +730,7 @@ package body System.File_IO is
function Mode (File : AFCB_Ptr) return File_Mode is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "Mode: file not open";
else
return File.Mode;
end if;
@@ -697,7 +743,7 @@ package body System.File_IO is
function Name (File : AFCB_Ptr) return String is
begin
if File = null then
- raise Status_Error;
+ raise Status_Error with "Name: file not open";
else
return File.Name.all (1 .. File.Name'Length - 1);
end if;
@@ -724,7 +770,7 @@ package body System.File_IO is
procedure Tmp_Name (Buffer : Address);
pragma Import (C, Tmp_Name, "__gnat_tmp_name");
- -- set buffer (a String address) with a temporary filename
+ -- Set buffer (a String address) with a temporary filename
Stream : FILEs := C_Stream;
-- Stream which we open in response to this request
@@ -744,9 +790,9 @@ package body System.File_IO is
-- Indicates temporary file case
Namelen : constant Integer := max_path_len;
- -- Length required for file name, not including final ASCII.NUL
- -- Note that we used to reference L_tmpnam here, which is not
- -- reliable since __gnat_tmp_name does not always use tmpnam.
+ -- Length required for file name, not including final ASCII.NUL.
+ -- Note that we used to reference L_tmpnam here, which is not reliable
+ -- since __gnat_tmp_name does not always use tmpnam.
Namestr : aliased String (1 .. Namelen + 1);
-- Name as given or temporary file name with ASCII.NUL appended
@@ -758,12 +804,12 @@ package body System.File_IO is
Full_Name_Len : Integer;
-- Length of name actually stored in Fullname
- Encoding : System.CRTL.Filename_Encoding;
+ Encoding : CRTL.Filename_Encoding;
-- Filename encoding specified into the form parameter
begin
if File_Ptr /= null then
- raise Status_Error;
+ raise Status_Error with "file already open";
end if;
-- Acquire form string, setting required NUL terminator
@@ -797,7 +843,7 @@ package body System.File_IO is
Shared := No;
else
- raise Use_Error;
+ raise Use_Error with "invalid Form";
end if;
end;
@@ -810,16 +856,16 @@ package body System.File_IO is
Form_Parameter (Formstr, "encoding", V1, V2);
if V1 = 0 then
- Encoding := System.CRTL.Unspecified;
+ Encoding := CRTL.Unspecified;
elsif Formstr (V1 .. V2) = "utf8" then
- Encoding := System.CRTL.UTF8;
+ Encoding := CRTL.UTF8;
elsif Formstr (V1 .. V2) = "8bits" then
- Encoding := System.CRTL.ASCII_8bits;
+ Encoding := CRTL.ASCII_8bits;
else
- raise Use_Error;
+ raise Use_Error with "invalid Form";
end if;
end;
@@ -851,13 +897,13 @@ package body System.File_IO is
if Tempfile then
if not Creat then
- raise Name_Error;
+ raise Name_Error with "opening temp file without creating it";
end if;
Tmp_Name (Namestr'Address);
if Namestr (1) = ASCII.NUL then
- raise Use_Error;
+ raise Use_Error with "invalid temp file name";
end if;
-- Chain to temp file list, ensuring thread safety with a lock
@@ -878,7 +924,7 @@ package body System.File_IO is
else
if Name'Length > Namelen then
- raise Name_Error;
+ raise Name_Error with "file name too long";
end if;
Namestr (1 .. Name'Length) := Name;
@@ -890,7 +936,7 @@ package body System.File_IO is
full_name (Namestr'Address, Fullname'Address);
if Fullname (1) = ASCII.NUL then
- raise Use_Error;
+ raise Use_Error with Errno_Message (Name);
end if;
Full_Name_Len := 1;
@@ -902,7 +948,7 @@ package body System.File_IO is
-- Fullname is generated by calling system's full_name. The problem
-- is, full_name does nothing about the casing, so a file name
- -- comparison may generally speaking not be valid on non-case
+ -- comparison may generally speaking not be valid on non-case-
-- sensitive systems, and in particular we get unexpected failures
-- on Windows/Vista because of this. So we use s-casuti to force
-- the name to lower case.
@@ -911,8 +957,8 @@ package body System.File_IO is
To_Lower (Fullname (1 .. Full_Name_Len));
end if;
- -- If Shared=None or Shared=Yes, then check for the existence
- -- of another file with exactly the same full name.
+ -- If Shared=None or Shared=Yes, then check for the existence of
+ -- another file with exactly the same full name.
if Shared /= No then
declare
@@ -937,7 +983,7 @@ package body System.File_IO is
if Shared = None
or else P.Shared_Status = None
then
- raise Use_Error;
+ raise Use_Error with "reopening shared file";
-- If both files have Shared=Yes, then we acquire the
-- stream from the located file to use as our stream.
@@ -983,7 +1029,7 @@ package body System.File_IO is
if not Creat and then Fopstr (1) /= 'r' then
if file_exists (Namestr'Address) = 0 then
- raise Name_Error;
+ raise Name_Error with Errno_Message (Name);
end if;
end if;
@@ -1007,10 +1053,8 @@ package body System.File_IO is
-- Should we raise Device_Error for ENOSPC???
declare
- subtype Cint is Interfaces.C.int;
-
function Is_File_Not_Found_Error
- (Errno_Value : Cint) return Cint;
+ (Errno_Value : Integer) return Integer;
-- Non-zero when the given errno value indicates a non-
-- existing file.
@@ -1018,13 +1062,13 @@ package body System.File_IO is
(C, Is_File_Not_Found_Error,
"__gnat_is_file_not_found_error");
+ Errno : constant Integer := OS_Lib.Errno;
+ Message : constant String := Errno_Message (Name, Errno);
begin
- if
- Is_File_Not_Found_Error (Cint (System.OS_Lib.Errno)) /= 0
- then
- raise Name_Error;
+ if Is_File_Not_Found_Error (Errno) /= 0 then
+ raise Name_Error with Message;
else
- raise Use_Error;
+ raise Use_Error with Message;
end if;
end;
end if;
@@ -1032,8 +1076,8 @@ package body System.File_IO is
end if;
-- Stream has been successfully located or opened, so now we are
- -- committed to completing the opening of the file. Allocate block
- -- on heap and fill in its fields.
+ -- committed to completing the opening of the file. Allocate block on
+ -- heap and fill in its fields.
File_Ptr := AFCB_Allocate (Dummy_FCB);
@@ -1053,6 +1097,23 @@ package body System.File_IO is
Append_Set (File_Ptr);
end Open;
+ ------------------------
+ -- Raise_Device_Error --
+ ------------------------
+
+ procedure Raise_Device_Error
+ (File : AFCB_Ptr; Errno : Integer := OS_Lib.Errno)
+ is
+ begin
+ -- Clear error status so that the same error is not reported twice
+
+ if File /= null then
+ clearerr (File.Stream);
+ end if;
+
+ raise Device_Error with Errno_Message (Errno);
+ end Raise_Device_Error;
+
--------------
-- Read_Buf --
--------------
@@ -1067,13 +1128,13 @@ package body System.File_IO is
return;
elsif ferror (File.Stream) /= 0 then
- raise Device_Error;
+ Raise_Device_Error (File);
elsif Nread = 0 then
raise End_Error;
else -- 0 < Nread < Siz
- raise Data_Error;
+ raise Data_Error with "not enough data read";
end if;
end Read_Buf;
@@ -1088,7 +1149,7 @@ package body System.File_IO is
Count := fread (Buf, 1, Siz, File.Stream);
if Count = 0 and then ferror (File.Stream) /= 0 then
- raise Device_Error;
+ Raise_Device_Error (File);
end if;
end Read_Buf;
@@ -1105,9 +1166,9 @@ package body System.File_IO is
Reset (File_Ptr, File.Mode);
end Reset;
- -- The reset with a change in mode is done using freopen, and is
- -- not permitted except for regular files (since otherwise there
- -- is no name for the freopen, and in any case it seems meaningless)
+ -- The reset with a change in mode is done using freopen, and is not
+ -- permitted except for regular files (since otherwise there is no name for
+ -- the freopen, and in any case it seems meaningless).
procedure Reset (File_Ptr : access AFCB_Ptr; Mode : File_Mode) is
File : AFCB_Ptr renames File_Ptr.all;
@@ -1120,25 +1181,29 @@ package body System.File_IO is
-- file that is not a regular file, or for a system file. Note that we
-- allow the "change" of mode if it is not in fact doing a change.
- if Mode /= File.Mode
- and then (File.Shared_Status = Yes
- or else File.Name'Length <= 1
- or else File.Is_System_File
- or else not File.Is_Regular_File)
- then
- raise Use_Error;
+ if Mode /= File.Mode then
+ if File.Shared_Status = Yes then
+ raise Use_Error with "cannot change mode of shared file";
+ elsif File.Name'Length <= 1 then
+ raise Use_Error with "cannot change mode of temp file";
+ elsif File.Is_System_File then
+ raise Use_Error with "cannot change mode of system file";
+ elsif not File.Is_Regular_File then
+ raise Use_Error with "cannot change mode of non-regular file";
+ end if;
+ end if;
- -- For In_File or Inout_File for a regular file, we can just do a
- -- rewind if the mode is unchanged, which is more efficient than
- -- doing a full reopen.
+ -- For In_File or Inout_File for a regular file, we can just do a rewind
+ -- if the mode is unchanged, which is more efficient than doing a full
+ -- reopen.
- elsif Mode = File.Mode
+ if Mode = File.Mode
and then Mode <= Inout_File
then
rewind (File.Stream);
- -- Here the change of mode is permitted, we do it by reopening the
- -- file in the new mode and replacing the stream with a new stream.
+ -- Here the change of mode is permitted, we do it by reopening the file
+ -- in the new mode and replacing the stream with a new stream.
else
Fopen_Mode
@@ -1164,17 +1229,17 @@ package body System.File_IO is
procedure Write_Buf (File : AFCB_Ptr; Buf : Address; Siz : size_t) is
begin
- -- Note: for most purposes, the Siz and 1 parameters in the fwrite
- -- call could be reversed, but on VMS, this is a better choice, since
- -- for some file formats, reversing the parameters results in records
- -- of one byte each.
+ -- Note: for most purposes, the Siz and 1 parameters in the fwrite call
+ -- could be reversed, but on VMS, this is a better choice, since for
+ -- some file formats, reversing the parameters results in records of one
+ -- byte each.
SSL.Abort_Defer.all;
if fwrite (Buf, Siz, 1, File.Stream) /= 1 then
if Siz /= 0 then
SSL.Abort_Undefer.all;
- raise Device_Error;
+ Raise_Device_Error (File);
end if;
end if;
diff --git a/gcc/ada/s-fileio.ads b/gcc/ada/s-fileio.ads
index e3a9abe0980..5ee0c5b99d9 100644
--- a/gcc/ada/s-fileio.ads
+++ b/gcc/ada/s-fileio.ads
@@ -125,8 +125,8 @@ package System.File_IO is
-- if used with temporary files or standard files.
function Form (File : FCB.AFCB_Ptr) return String;
- -- Returns the form as supplied by create, open or reset
- -- The string is normalized to all lower case letters.
+ -- Returns the form as supplied by create, open or reset The string is
+ -- normalized to all lower case letters.
function Is_Open (File : FCB.AFCB_Ptr) return Boolean;
-- Determines if file is open or not
@@ -145,25 +145,25 @@ package System.File_IO is
-- not opened in the normal manner. Note that the caller is responsible
-- for task lock out to protect the global data structures if this is
-- necessary (it is needed for the calls from within this unit itself,
- -- but not required for the calls from Text_IO and Wide_Text_IO that
- -- are made during elaboration of the environment task).
+ -- but not required for the calls from Text_IO and [Wide_]Wide_Text_IO
+ -- that are made during elaboration of the environment task).
procedure Check_File_Open (File : FCB.AFCB_Ptr);
- -- If the current file is not open, then Status_Error is raised.
- -- Otherwise control returns normally (with File pointing to the
- -- control block for the open file.
+ -- If the current file is not open, then Status_Error is raised. Otherwise
+ -- control returns normally (with File pointing to the control block for
+ -- the open file.
procedure Check_Read_Status (File : FCB.AFCB_Ptr);
- -- If the current file is not open, then Status_Error is raised. If
- -- the file is open, then the mode is checked to ensure that reading
- -- is permitted, and if not Mode_Error is raised, otherwise control
- -- returns normally.
+ -- If the current file is not open, then Status_Error is raised. If the
+ -- file is open, then the mode is checked to make sure that reading is
+ -- permitted, and if not Mode_Error is raised, otherwise control returns
+ -- normally.
procedure Check_Write_Status (File : FCB.AFCB_Ptr);
- -- If the current file is not open, then Status_Error is raised. If
- -- the file is open, then the mode is checked to ensure that writing
- -- is permitted, and if not Mode_Error is raised, otherwise control
- -- returns normally.
+ -- If the current file is not open, then Status_Error is raised. If the
+ -- file is open, then the mode is checked to ensure that writing is
+ -- permitted, and if not Mode_Error is raised, otherwise control returns
+ -- normally.
function End_Of_File (File : FCB.AFCB_Ptr) return Boolean;
-- File must be opened in read mode. True is returned if the stream is
@@ -171,30 +171,28 @@ package System.File_IO is
-- The position of the stream is not affected.
procedure Flush (File : FCB.AFCB_Ptr);
- -- Flushes the stream associated with the given file. The file must be
- -- open and in write mode (if not, an appropriate exception is raised)
+ -- Flushes the stream associated with the given file. The file must be open
+ -- and in write mode (if not, an appropriate exception is raised)
function Form_Boolean
(Form : String;
Keyword : String;
- Default : Boolean)
- return Boolean;
- -- Searches form string for an entry of the form Keyword=xx where xx is
- -- either Yes/No or y/n. Returns True if Yes or Y is found, False if No
- -- or N is found. If the keyword parameter is not found, returns the
- -- value given as Default. May raise Use_Error if a form string syntax
- -- error is detected. Keyword and Form must be in lower case.
+ Default : Boolean) return Boolean;
+ -- Searches form string for an entry of the form keyword=xx where xx is
+ -- either yes/no or y/n. Returns True if yes or y is found, False if no or
+ -- n is found. If the keyword parameter is not found, returns the value
+ -- given as Default. May raise Use_Error if a form string syntax error is
+ -- detected. Keyword and Form must be in lower case.
function Form_Integer
(Form : String;
Keyword : String;
- Default : Integer)
- return Integer;
- -- Searches form string for an entry of the form Keyword=xx where xx is
- -- an unsigned decimal integer in the range 0 to 999_999. Returns this
- -- integer value if it is found. If the keyword parameter is not found,
- -- returns the value given as Default. Raise Use_Error if a form string
- -- syntax error is detected. Keyword and Form must be in lower case.
+ Default : Integer) return Integer;
+ -- Searches form string for an entry of the form Keyword=xx where xx is an
+ -- unsigned decimal integer in the range 0 to 999_999. Returns this integer
+ -- value if it is found. If the keyword parameter is not found, returns the
+ -- value given as Default. Raise Use_Error if a form string syntax error is
+ -- detected. Keyword and Form must be in lower case.
procedure Form_Parameter
(Form : String;
@@ -221,22 +219,22 @@ package System.File_IO is
Buf : Address;
Siz : Interfaces.C_Streams.size_t;
Count : out Interfaces.C_Streams.size_t);
- -- Reads Siz bytes from File.Stream into Buf. The caller has checked
- -- that the file is open in read mode. Device Error is raised if an error
+ -- Reads Siz bytes from File.Stream into Buf. The caller has checked that
+ -- the file is open in read mode. Device Error is raised if an error
-- occurs. Count is the actual number of bytes read, which may be less
-- than Siz if the end of file is encountered.
procedure Append_Set (File : FCB.AFCB_Ptr);
- -- If the mode of the file is Append_File, then the file is positioned
- -- at the end of file using fseek, otherwise this call has no effect.
+ -- If the mode of the file is Append_File, then the file is positioned at
+ -- the end of file using fseek, otherwise this call has no effect.
procedure Write_Buf
(File : FCB.AFCB_Ptr;
Buf : Address;
Siz : Interfaces.C_Streams.size_t);
- -- Writes size_t bytes to File.Stream from Buf. The caller has checked
- -- that the file is open in write mode. Raises Device_Error if the
- -- complete buffer cannot be written.
+ -- Writes size_t bytes to File.Stream from Buf. The caller has checked that
+ -- the file is open in write mode. Raises Device_Error if the complete
+ -- buffer cannot be written.
procedure Make_Unbuffered (File : FCB.AFCB_Ptr);
diff --git a/gcc/ada/s-os_lib.adb b/gcc/ada/s-os_lib.adb
index 0f2081a0e87..f7341367688 100755
--- a/gcc/ada/s-os_lib.adb
+++ b/gcc/ada/s-os_lib.adb
@@ -77,8 +77,17 @@ package body System.OS_Lib is
-----------------------
function Args_Length (Args : Argument_List) return Natural;
- -- Returns total number of characters needed to create a string
- -- of all Args terminated by ASCII.NUL characters
+ -- Returns total number of characters needed to create a string of all Args
+ -- terminated by ASCII.NUL characters.
+
+ procedure Create_Temp_File_Internal
+ (FD : out File_Descriptor;
+ Name : out String_Access;
+ Stdout : Boolean);
+ -- Internal routine to implement two Create_Temp_File routines. If Stdout
+ -- is set to True the created descriptor is stdout-compatible, otherwise
+ -- it might not be depending on the OS (VMS is one example). The first two
+ -- parameters are as in Create_Temp_File.
function C_String_Length (S : Address) return Integer;
-- Returns the length of a C string. Does check for null address
@@ -749,10 +758,57 @@ package body System.OS_Lib is
(FD : out File_Descriptor;
Name : out String_Access)
is
+ begin
+ Create_Temp_File_Internal (FD, Name, Stdout => False);
+ end Create_Temp_File;
+
+ procedure Create_Temp_Output_File
+ (FD : out File_Descriptor;
+ Name : out String_Access)
+ is
+ begin
+ Create_Temp_File_Internal (FD, Name, Stdout => True);
+ end Create_Temp_Output_File;
+
+ -------------------------------
+ -- Create_Temp_File_Internal --
+ -------------------------------
+
+ procedure Create_Temp_File_Internal
+ (FD : out File_Descriptor;
+ Name : out String_Access;
+ Stdout : Boolean)
+ is
Pos : Positive;
Attempts : Natural := 0;
Current : String (Current_Temp_File_Name'Range);
+ ---------------------------------
+ -- Create_New_Output_Text_File --
+ ---------------------------------
+
+ function Create_New_Output_Text_File
+ (Name : String) return File_Descriptor;
+ -- Similar to Create_Output_Text_File, except it fails if the file
+ -- already exists. We need this behavior to ensure we don't accidentally
+ -- open a temp file that has just been created by a concurrently running
+ -- process. There is no point exposing this function, as it's generally
+ -- not particularly useful.
+
+ function Create_New_Output_Text_File
+ (Name : String) return File_Descriptor is
+ function C_Create_File
+ (Name : C_File_Name) return File_Descriptor;
+ pragma Import (C, C_Create_File, "__gnat_create_output_file_new");
+
+ C_Name : String (1 .. Name'Length + 1);
+
+ begin
+ C_Name (1 .. Name'Length) := Name;
+ C_Name (C_Name'Last) := ASCII.NUL;
+ return C_Create_File (C_Name (C_Name'First)'Address);
+ end Create_New_Output_Text_File;
+
begin
-- Loop until a new temp file can be created
@@ -814,7 +870,11 @@ package body System.OS_Lib is
-- Attempt to create the file
- FD := Create_New_File (Current, Binary);
+ if Stdout then
+ FD := Create_New_Output_Text_File (Current);
+ else
+ FD := Create_New_File (Current, Binary);
+ end if;
if FD /= Invalid_FD then
Name := new String'(Current);
@@ -836,7 +896,7 @@ package body System.OS_Lib is
end if;
end if;
end loop File_Loop;
- end Create_Temp_File;
+ end Create_Temp_File_Internal;
-----------------
-- Delete_File --
diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads
index b77b3f01266..341a27953ab 100755
--- a/gcc/ada/s-os_lib.ads
+++ b/gcc/ada/s-os_lib.ads
@@ -245,9 +245,26 @@ package System.OS_Lib is
Name : out String_Access);
-- Create and open for writing a temporary file in the current working
-- directory. The name of the file and the File Descriptor are returned.
- -- No mode parameter is provided. Since this is a temporary file, there is
- -- no point in doing text translation on it. It is the responsibility of
- -- the caller to deallocate the access value returned in Name.
+ -- It is the responsibility of the caller to deallocate the access value
+ -- returned in Name.
+ --
+ -- The file is opened in binary mode (no text translation).
+ --
+ -- This procedure will always succeed if the current working directory is
+ -- writable. If the current working directory is not writable, then
+ -- Invalid_FD is returned for the file descriptor and null for the Name.
+ -- There is no race condition problem between processes trying to create
+ -- temp files at the same time in the same directory.
+
+ procedure Create_Temp_Output_File
+ (FD : out File_Descriptor;
+ Name : out String_Access);
+ -- Create and open for writing a temporary file in the current working
+ -- directory suitable to redirect standard output. The name of the file and
+ -- the File Descriptor are returned. It is the responsibility of the caller
+ -- to deallocate the access value returned in Name.
+ --
+ -- The file is opened in text mode
--
-- This procedure will always succeed if the current working directory is
-- writable. If the current working directory is not writable, then
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index af29d9a3fdc..ad01bd18117 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -509,9 +509,8 @@ package body Sem_Aggr is
------------------------
function Array_Aggr_Subtype
- (N : Node_Id;
- Typ : Entity_Id)
- return Entity_Id
+ (N : Node_Id;
+ Typ : Entity_Id) return Entity_Id
is
Aggr_Dimension : constant Pos := Number_Dimensions (Typ);
-- Number of aggregate index dimensions
@@ -618,7 +617,7 @@ package body Sem_Aggr is
-- Array_Aggr_Subtype variables
Itype : Entity_Id;
- -- the final itype of the overall aggregate
+ -- The final itype of the overall aggregate
Index_Constraints : constant List_Id := New_List;
-- The list of index constraints of the aggregate itype
@@ -626,8 +625,8 @@ package body Sem_Aggr is
-- Start of processing for Array_Aggr_Subtype
begin
- -- Make sure that the list of index constraints is properly attached
- -- to the tree, and then collect the aggregate bounds.
+ -- Make sure that the list of index constraints is properly attached to
+ -- the tree, and then collect the aggregate bounds.
Set_Parent (Index_Constraints, N);
Collect_Aggr_Bounds (N, 1);
@@ -672,13 +671,13 @@ package body Sem_Aggr is
Itype := Create_Itype (E_Array_Subtype, N);
- Set_First_Rep_Item (Itype, First_Rep_Item (Typ));
- Set_Convention (Itype, Convention (Typ));
- Set_Depends_On_Private (Itype, Has_Private_Component (Typ));
- Set_Etype (Itype, Base_Type (Typ));
- Set_Has_Alignment_Clause (Itype, Has_Alignment_Clause (Typ));
- Set_Is_Aliased (Itype, Is_Aliased (Typ));
- Set_Depends_On_Private (Itype, Depends_On_Private (Typ));
+ Set_First_Rep_Item (Itype, First_Rep_Item (Typ));
+ Set_Convention (Itype, Convention (Typ));
+ Set_Depends_On_Private (Itype, Has_Private_Component (Typ));
+ Set_Etype (Itype, Base_Type (Typ));
+ Set_Has_Alignment_Clause (Itype, Has_Alignment_Clause (Typ));
+ Set_Is_Aliased (Itype, Is_Aliased (Typ));
+ Set_Depends_On_Private (Itype, Depends_On_Private (Typ));
Copy_Suppress_Status (Index_Check, Typ, Itype);
Copy_Suppress_Status (Length_Check, Typ, Itype);
@@ -688,22 +687,23 @@ package body Sem_Aggr is
Set_Is_Internal (Itype, True);
-- A simple optimization: purely positional aggregates of static
- -- components should be passed to gigi unexpanded whenever possible,
- -- and regardless of the staticness of the bounds themselves. Subse-
- -- quent checks in exp_aggr verify that type is not packed, etc.
+ -- components should be passed to gigi unexpanded whenever possible, and
+ -- regardless of the staticness of the bounds themselves. Subsequent
+ -- checks in exp_aggr verify that type is not packed, etc.
Set_Size_Known_At_Compile_Time (Itype,
Is_Fully_Positional
and then Comes_From_Source (N)
and then Size_Known_At_Compile_Time (Component_Type (Typ)));
- -- We always need a freeze node for a packed array subtype, so that
- -- we can build the Packed_Array_Type corresponding to the subtype.
- -- If expansion is disabled, the packed array subtype is not built,
- -- and we must not generate a freeze node for the type, or else it
- -- will appear incomplete to gigi.
+ -- We always need a freeze node for a packed array subtype, so that we
+ -- can build the Packed_Array_Type corresponding to the subtype. If
+ -- expansion is disabled, the packed array subtype is not built, and we
+ -- must not generate a freeze node for the type, or else it will appear
+ -- incomplete to gigi.
- if Is_Packed (Itype) and then not In_Spec_Expression
+ if Is_Packed (Itype)
+ and then not In_Spec_Expression
and then Expander_Active
then
Freeze_Itype (Itype, N);
@@ -728,11 +728,10 @@ package body Sem_Aggr is
Component_Elmt : Elmt_Id;
begin
- -- All the components of List are matched against Component and
- -- a count is maintained of possible misspellings. When at the
- -- end of the analysis there are one or two (not more!) possible
- -- misspellings, these misspellings will be suggested as
- -- possible correction.
+ -- All the components of List are matched against Component and a count
+ -- is maintained of possible misspellings. When at the end of the
+ -- the analysis there are one or two (not more!) possible misspellings,
+ -- these misspellings will be suggested as possible correction.
Component_Elmt := First_Elmt (Elements);
while Nr_Of_Suggestions <= Max_Suggestions
@@ -872,7 +871,7 @@ package body Sem_Aggr is
Append_To (Exprs, C_Node);
P := P + 1;
- -- something special for wide strings ???
+ -- Something special for wide strings???
end loop;
New_N := Make_Aggregate (Loc, Expressions => Exprs);
@@ -904,9 +903,9 @@ package body Sem_Aggr is
end if;
-- Check for aggregates not allowed in configurable run-time mode.
- -- We allow all cases of aggregates that do not come from source,
- -- since these are all assumed to be small (e.g. bounds of a string
- -- literal). We also allow aggregates of types we know to be small.
+ -- We allow all cases of aggregates that do not come from source, since
+ -- these are all assumed to be small (e.g. bounds of a string literal).
+ -- We also allow aggregates of types we know to be small.
if not Support_Aggregates_On_Target
and then Comes_From_Source (N)
@@ -941,10 +940,10 @@ package body Sem_Aggr is
-- First a special test, for the case of a positional aggregate
-- of characters which can be replaced by a string literal.
- -- Do not perform this transformation if this was a string literal
- -- to start with, whose components needed constraint checks, or if
- -- the component type is non-static, because it will require those
- -- checks and be transformed back into an aggregate.
+ -- Do not perform this transformation if this was a string literal to
+ -- start with, whose components needed constraint checks, or if the
+ -- component type is non-static, because it will require those checks
+ -- and be transformed back into an aggregate.
if Number_Dimensions (Typ) = 1
and then Is_Standard_Character_Type (Component_Type (Typ))
@@ -989,10 +988,10 @@ package body Sem_Aggr is
Aggr_Resolved : Boolean;
Aggr_Typ : constant Entity_Id := Etype (Typ);
- -- This is the unconstrained array type, which is the type
- -- against which the aggregate is to be resolved. Typ itself
- -- is the array type of the context which may not be the same
- -- subtype as the subtype for the final aggregate.
+ -- This is the unconstrained array type, which is the type against
+ -- which the aggregate is to be resolved. Typ itself is the array
+ -- type of the context which may not be the same subtype as the
+ -- subtype for the final aggregate.
begin
-- In the following we determine whether an others choice is
@@ -1002,11 +1001,11 @@ package body Sem_Aggr is
-- choice is not allowed.
-- If expansion is disabled (generic context, or semantics-only
- -- mode) actual subtypes cannot be constructed, and the type of
- -- an object may be its unconstrained nominal type. However, if
- -- the context is an assignment, we assume that "others" is
- -- allowed, because the target of the assignment will have a
- -- constrained subtype when fully compiled.
+ -- mode) actual subtypes cannot be constructed, and the type of an
+ -- object may be its unconstrained nominal type. However, if the
+ -- context is an assignment, we assume that "others" is allowed,
+ -- because the target of the assignment will have a constrained
+ -- subtype when fully compiled.
-- Note that there is no node for Explicit_Actual_Parameter.
-- To test for this context we therefore have to test for node
@@ -1014,7 +1013,7 @@ package body Sem_Aggr is
-- formal parameter. Consequently we also need to test for
-- N_Procedure_Call_Statement or N_Function_Call.
- Set_Etype (N, Aggr_Typ); -- may be overridden later on
+ Set_Etype (N, Aggr_Typ); -- May be overridden later on
if Is_Constrained (Typ) and then
(Pkind = N_Assignment_Statement or else
@@ -1080,10 +1079,10 @@ package body Sem_Aggr is
Error_Msg_N ("illegal context for aggregate", N);
end if;
- -- If we can determine statically that the evaluation of the
- -- aggregate raises Constraint_Error, then replace the
- -- aggregate with an N_Raise_Constraint_Error node, but set the
- -- Etype to the right aggregate subtype. Gigi needs this.
+ -- If we can determine statically that the evaluation of the aggregate
+ -- raises Constraint_Error, then replace the aggregate with an
+ -- N_Raise_Constraint_Error node, but set the Etype to the right
+ -- aggregate subtype. Gigi needs this.
if Raises_Constraint_Error (N) then
Aggr_Subtyp := Etype (N);
@@ -1115,13 +1114,13 @@ package body Sem_Aggr is
Index_Typ : constant Entity_Id := Etype (Index);
Index_Typ_Low : constant Node_Id := Type_Low_Bound (Index_Typ);
Index_Typ_High : constant Node_Id := Type_High_Bound (Index_Typ);
- -- The type of the index corresponding to the array sub-aggregate
- -- along with its low and upper bounds
+ -- The type of the index corresponding to the array sub-aggregate along
+ -- with its low and upper bounds.
Index_Base : constant Entity_Id := Base_Type (Index_Typ);
Index_Base_Low : constant Node_Id := Type_Low_Bound (Index_Base);
Index_Base_High : constant Node_Id := Type_High_Bound (Index_Base);
- -- ditto for the base type
+ -- Ditto for the base type
function Add (Val : Uint; To : Node_Id) return Node_Id;
-- Creates a new expression node where Val is added to expression To.
@@ -1131,16 +1130,16 @@ package body Sem_Aggr is
procedure Check_Bound (BH : Node_Id; AH : in out Node_Id);
-- Checks that AH (the upper bound of an array aggregate) is <= BH
-- (the upper bound of the index base type). If the check fails a
- -- warning is emitted, the Raises_Constraint_Error Flag of N is set,
+ -- warning is emitted, the Raises_Constraint_Error flag of N is set,
-- and AH is replaced with a duplicate of BH.
procedure Check_Bounds (L, H : Node_Id; AL, AH : Node_Id);
-- Checks that range AL .. AH is compatible with range L .. H. Emits a
- -- warning if not and sets the Raises_Constraint_Error Flag in N.
+ -- warning if not and sets the Raises_Constraint_Error flag in N.
procedure Check_Length (L, H : Node_Id; Len : Uint);
-- Checks that range L .. H contains at least Len elements. Emits a
- -- warning if not and sets the Raises_Constraint_Error Flag in N.
+ -- warning if not and sets the Raises_Constraint_Error flag in N.
function Dynamic_Or_Null_Range (L, H : Node_Id) return Boolean;
-- Returns True if range L .. H is dynamic or null
@@ -1155,11 +1154,10 @@ package body Sem_Aggr is
Single_Elmt : Boolean) return Boolean;
-- Resolves aggregate expression Expr. Returns False if resolution
-- fails. If Single_Elmt is set to False, the expression Expr may be
- -- used to initialize several array aggregate elements (this can
- -- happen for discrete choices such as "L .. H => Expr" or the others
- -- choice). In this event we do not resolve Expr unless expansion is
- -- disabled. To know why, see the DELAYED COMPONENT RESOLUTION
- -- note above.
+ -- used to initialize several array aggregate elements (this can happen
+ -- for discrete choices such as "L .. H => Expr" or the others choice).
+ -- In this event we do not resolve Expr unless expansion is disabled.
+ -- To know why, see the DELAYED COMPONENT RESOLUTION note above.
---------
-- Add --
@@ -1642,8 +1640,8 @@ package body Sem_Aggr is
-- discrete association
Prev_Nb_Discrete_Choices : Nat;
- -- Used to keep track of the number of discrete choices
- -- in the current association.
+ -- Used to keep track of the number of discrete choices in the
+ -- current association.
begin
-- STEP 2 (A): Check discrete choices validity
@@ -1690,9 +1688,8 @@ package body Sem_Aggr is
Check_Non_Static_Context (Choice);
-- Do not range check a choice. This check is redundant
- -- since this test is already performed when we check
- -- that the bounds of the array aggregate are within
- -- range.
+ -- since this test is already done when we check that the
+ -- bounds of the array aggregate are within range.
Set_Do_Range_Check (Choice, False);
end if;
@@ -1754,13 +1751,13 @@ package body Sem_Aggr is
end if;
-- Ada 2005 (AI-287): In case of default initialized component
- -- we delay the resolution to the expansion phase
+ -- we delay the resolution to the expansion phase.
if Box_Present (Assoc) then
- -- Ada 2005 (AI-287): In case of default initialization
- -- of a component the expander will generate calls to
- -- the corresponding initialization subprogram.
+ -- Ada 2005 (AI-287): In case of default initialization of a
+ -- component the expander will generate calls to the
+ -- corresponding initialization subprogram.
null;
@@ -1773,8 +1770,8 @@ package body Sem_Aggr is
-- We differentiate here two cases because the expression may
-- not be decorated. For example, the analysis and resolution
- -- of the expression associated with the others choice will
- -- be done later with the full aggregate. In such case we
+ -- of the expression associated with the others choice will be
+ -- done later with the full aggregate. In such case we
-- duplicate the expression tree to analyze the copy and
-- perform the required check.
@@ -1810,7 +1807,7 @@ package body Sem_Aggr is
end loop;
-- If aggregate contains more than one choice then these must be
- -- static. Sort them and check that they are contiguous
+ -- static. Sort them and check that they are contiguous.
if Nb_Discrete_Choices > 1 then
Sort_Case_Table (Table);
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index d4f4f51dc33..e37b216ca45 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -667,8 +667,8 @@ package body Sem_Attr is
end loop;
if Present (Q) then
- Set_Has_Per_Object_Constraint (
- Defining_Identifier (Q), True);
+ Set_Has_Per_Object_Constraint
+ (Defining_Identifier (Q), True);
end if;
end;
@@ -1991,9 +1991,10 @@ package body Sem_Attr is
-- entry wrappers, the attributes Count, Caller and AST_Entry require
-- a context check
- if Aname = Name_Count
- or else Aname = Name_Caller
- or else Aname = Name_AST_Entry
+ if Ada_Version >= Ada_05
+ and then (Aname = Name_Count
+ or else Aname = Name_Caller
+ or else Aname = Name_AST_Entry)
then
declare
Count : Natural := 0;
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 75b24952200..174811bb81a 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -540,12 +540,9 @@ package body Sem_Ch12 is
-- initialized before call to Check_Generic_Child_Unit.
procedure Install_Formal_Packages (Par : Entity_Id);
- -- If any of the formals of the parent are formal packages with box,
- -- their formal parts are visible in the parent and thus in the child
- -- unit as well. Analogous to what is done in Check_Generic_Actuals
- -- for the unit itself. This procedure is also used in an instance, to
- -- make visible the proper entities of the actual for a formal package
- -- declared with a box.
+ -- Install the visible part of any formal of the parent that is a formal
+ -- package. Note that for the case of a formal package with a box, this
+ -- includes the formal part of the formal package (12.7(10/2)).
procedure Install_Parent (P : Entity_Id; In_Body : Boolean := False);
-- When compiling an instance of a child unit the parent (which is
@@ -1701,18 +1698,18 @@ package body Sem_Ch12 is
Lo :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_First,
- Prefix => New_Reference_To (T, Loc));
+ Prefix => New_Reference_To (T, Loc));
Set_Etype (Lo, T);
Hi :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Last,
- Prefix => New_Reference_To (T, Loc));
+ Prefix => New_Reference_To (T, Loc));
Set_Etype (Hi, T);
Set_Scalar_Range (T,
Make_Range (Loc,
- Low_Bound => Lo,
+ Low_Bound => Lo,
High_Bound => Hi));
Set_Ekind (Base, E_Enumeration_Type);
@@ -5217,11 +5214,10 @@ package body Sem_Ch12 is
elsif In_Open_Scopes (Inst_Par) then
- -- If the parent is already installed verify that the
- -- actuals for its formal packages declared with a box
- -- are already installed. This is necessary when the
- -- child instance is a child of the parent instance.
- -- In this case the parent is placed on the scope stack
+ -- If the parent is already installed, install the actuals
+ -- for its formal packages. This is necessary when the
+ -- child instance is a child of the parent instance:
+ -- in this case, the parent is placed on the scope stack
-- but the formal packages are not made visible.
Install_Formal_Packages (Inst_Par);
@@ -7191,24 +7187,20 @@ package body Sem_Ch12 is
if Renamed_Object (E) = Par then
exit;
- -- The visibility of a formal of an enclosing generic is
- -- already correct.
+ -- The visibility of a formal of an enclosing generic is already
+ -- correct.
elsif Denotes_Formal_Package (E) then
null;
- elsif Present (Associated_Formal_Package (E))
- and then Box_Present (Parent (Associated_Formal_Package (E)))
- then
+ elsif Present (Associated_Formal_Package (E)) then
Check_Generic_Actuals (Renamed_Object (E), True);
Set_Is_Hidden (E, False);
-- Find formal package in generic unit that corresponds to
-- (instance of) formal package in instance.
- while Present (Gen_E)
- and then Chars (Gen_E) /= Chars (E)
- loop
+ while Present (Gen_E) and then Chars (Gen_E) /= Chars (E) loop
Next_Entity (Gen_E);
end loop;
@@ -8365,7 +8357,7 @@ package body Sem_Ch12 is
"with volatile actual", Actual);
end if;
- -- formal in-parameter
+ -- Formal in-parameter
else
-- The instantiation of a generic formal in-parameter is constant
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index c514206c00d..7dd9629da6a 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -784,7 +784,7 @@ package body Sem_Ch3 is
Anon_Type :=
Create_Itype
- (E_Anonymous_Access_Type, Related_Nod, Scope_Id => Anon_Scope);
+ (E_Anonymous_Access_Type, Related_Nod, Scope_Id => Anon_Scope);
if All_Present (N)
and then Ada_Version >= Ada_05
@@ -825,8 +825,7 @@ package body Sem_Ch3 is
Find_Type (Subtype_Mark (N));
Desig_Type := Entity (Subtype_Mark (N));
- Set_Directly_Designated_Type
- (Anon_Type, Desig_Type);
+ Set_Directly_Designated_Type (Anon_Type, Desig_Type);
Set_Etype (Anon_Type, Anon_Type);
-- Make sure the anonymous access type has size and alignment fields
@@ -2883,12 +2882,11 @@ package body Sem_Ch3 is
Apply_Length_Check (E, T);
end if;
- -- If the type is limited unconstrained with defaulted discriminants
- -- and there is no expression, then the object is constrained by the
+ -- If the type is limited unconstrained with defaulted discriminants and
+ -- there is no expression, then the object is constrained by the
-- defaults, so it is worthwhile building the corresponding subtype.
- elsif (Is_Limited_Record (T)
- or else Is_Concurrent_Type (T))
+ elsif (Is_Limited_Record (T) or else Is_Concurrent_Type (T))
and then not Is_Constrained (T)
and then Has_Discriminants (T)
then
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index c6a5a5ace59..75e98c08bc4 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -2935,10 +2935,8 @@ package body Sem_Res is
-- anomalies: the subtype was first built in the subprogram
-- declaration, and the current call may be nested.
- if Nkind (Actval) = N_Aggregate
- and then Has_Discriminants (Etype (Actval))
- then
- Analyze_And_Resolve (Actval, Base_Type (Etype (Actval)));
+ if Nkind (Actval) = N_Aggregate then
+ Analyze_And_Resolve (Actval, Etype (F));
else
Analyze_And_Resolve (Actval, Etype (Actval));
end if;
@@ -5390,6 +5388,7 @@ package body Sem_Res is
Eval_Call (N);
Check_Elab_Call (N);
+ Warn_On_Overlapping_Actuals (Nam, N);
end Resolve_Call;
-------------------------------
diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb
index 931112c472d..5b3a4f3ecfe 100644
--- a/gcc/ada/sem_type.adb
+++ b/gcc/ada/sem_type.adb
@@ -791,7 +791,7 @@ package body Sem_Type is
or else Scope (T1) /= Scope (T2));
end if;
- -- Literals are compatible with types in a given "class"
+ -- Literals are compatible with types in a given "class"
elsif (T2 = Universal_Integer and then Is_Integer_Type (T1))
or else (T2 = Universal_Real and then Is_Real_Type (T1))
@@ -970,6 +970,18 @@ package body Sem_Type is
then
return Covers (Corresponding_Remote_Type (T2), T1);
+ elsif Is_Record_Type (T1)
+ and then Is_Concurrent_Type (T2)
+ and then Present (Corresponding_Record_Type (T2))
+ then
+ return Covers (T1, Corresponding_Record_Type (T2));
+
+ elsif Is_Concurrent_Type (T1)
+ and then Present (Corresponding_Record_Type (T1))
+ and then Is_Record_Type (T2)
+ then
+ return Covers (Corresponding_Record_Type (T1), T2);
+
elsif Ekind (T2) = E_Access_Attribute_Type
and then (Ekind (BT1) = E_General_Access_Type
or else Ekind (BT1) = E_Access_Type)
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 37965afb69a..5baf60c8dea 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -2137,6 +2137,181 @@ package body Sem_Util is
end Denotes_Discriminant;
+ -------------------------
+ -- Denotes_Same_Object --
+ -------------------------
+
+ function Denotes_Same_Object (A1, A2 : Node_Id) return Boolean is
+ begin
+ -- If we have entity names, then must be same entity
+
+ if Is_Entity_Name (A1) then
+ if Is_Entity_Name (A2) then
+ return Entity (A1) = Entity (A2);
+ else
+ return False;
+ end if;
+
+ -- No match if not same node kind
+
+ elsif Nkind (A1) /= Nkind (A2) then
+ return False;
+
+ -- For selected components, must have same prefix and selector
+
+ elsif Nkind (A1) = N_Selected_Component then
+ return Denotes_Same_Object (Prefix (A1), Prefix (A2))
+ and then
+ Entity (Selector_Name (A1)) = Entity (Selector_Name (A2));
+
+ -- For explicit dereferences, prefixes must be same
+
+ elsif Nkind (A1) = N_Explicit_Dereference then
+ return Denotes_Same_Object (Prefix (A1), Prefix (A2));
+
+ -- For indexed components, prefixes and all subscripts must be the same
+
+ elsif Nkind (A1) = N_Indexed_Component then
+ if Denotes_Same_Object (Prefix (A1), Prefix (A2)) then
+ declare
+ Indx1 : Node_Id;
+ Indx2 : Node_Id;
+
+ begin
+ Indx1 := First (Expressions (A1));
+ Indx2 := First (Expressions (A2));
+ while Present (Indx1) loop
+
+ -- Shouldn't we be checking that values are the same???
+
+ if not Denotes_Same_Object (Indx1, Indx2) then
+ return False;
+ end if;
+
+ Next (Indx1);
+ Next (Indx2);
+ end loop;
+
+ return True;
+ end;
+ else
+ return False;
+ end if;
+
+ -- For slices, prefixes must match and bounds must match
+
+ elsif Nkind (A1) = N_Slice
+ and then Denotes_Same_Object (Prefix (A1), Prefix (A2))
+ then
+ declare
+ Lo1, Lo2, Hi1, Hi2 : Node_Id;
+
+ begin
+ Get_Index_Bounds (Etype (A1), Lo1, Hi1);
+ Get_Index_Bounds (Etype (A2), Lo2, Hi2);
+
+ -- Check whether bounds are statically identical. There is no
+ -- attempt to detect partial overlap of slices.
+
+ -- What about an array and a slice of an array???
+
+ return Denotes_Same_Object (Lo1, Lo2)
+ and then Denotes_Same_Object (Hi1, Hi2);
+ end;
+
+ -- Literals will appear as indices. Isn't this where we should check
+ -- Known_At_Compile_Time at least if we are generating warnings ???
+
+ elsif Nkind (A1) = N_Integer_Literal then
+ return Intval (A1) = Intval (A2);
+
+ else
+ return False;
+ end if;
+ end Denotes_Same_Object;
+
+ -------------------------
+ -- Denotes_Same_Prefix --
+ -------------------------
+
+ function Denotes_Same_Prefix (A1, A2 : Node_Id) return Boolean is
+
+ begin
+ if Is_Entity_Name (A1) then
+ if Nkind_In (A2, N_Selected_Component, N_Indexed_Component) then
+ return Denotes_Same_Object (A1, Prefix (A2))
+ or else Denotes_Same_Prefix (A1, Prefix (A2));
+ else
+ return False;
+ end if;
+
+ elsif Is_Entity_Name (A2) then
+ return Denotes_Same_Prefix (A2, A1);
+
+ elsif Nkind_In (A1, N_Selected_Component, N_Indexed_Component, N_Slice)
+ and then
+ Nkind_In (A2, N_Selected_Component, N_Indexed_Component, N_Slice)
+ then
+ declare
+ Root1, Root2 : Node_Id;
+ Depth1, Depth2 : Int := 0;
+
+ begin
+ Root1 := Prefix (A1);
+ while not Is_Entity_Name (Root1) loop
+ if not Nkind_In
+ (Root1, N_Selected_Component, N_Indexed_Component)
+ then
+ return False;
+ else
+ Root1 := Prefix (Root1);
+ end if;
+
+ Depth1 := Depth1 + 1;
+ end loop;
+
+ Root2 := Prefix (A2);
+ while not Is_Entity_Name (Root2) loop
+ if not Nkind_In
+ (Root2, N_Selected_Component, N_Indexed_Component)
+ then
+ return False;
+ else
+ Root2 := Prefix (Root2);
+ end if;
+
+ Depth2 := Depth2 + 1;
+ end loop;
+
+ -- If both have the same depth and they do not denote the same
+ -- object, they are disjoint and not warning is needed.
+
+ if Depth1 = Depth2 then
+ return False;
+
+ elsif Depth1 > Depth2 then
+ Root1 := Prefix (A1);
+ for I in 1 .. Depth1 - Depth2 - 1 loop
+ Root1 := Prefix (Root1);
+ end loop;
+
+ return Denotes_Same_Object (Root1, A2);
+
+ else
+ Root2 := Prefix (A2);
+ for I in 1 .. Depth2 - Depth1 - 1 loop
+ Root2 := Prefix (Root2);
+ end loop;
+
+ return Denotes_Same_Object (A1, Root2);
+ end if;
+ end;
+
+ else
+ return False;
+ end if;
+ end Denotes_Same_Prefix;
+
----------------------
-- Denotes_Variable --
----------------------
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 0e3dde668e6..623a72b2782 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -251,6 +251,15 @@ package Sem_Util is
-- components of protected types, and constraint checks on entry
-- families constrained by discriminants.
+ function Denotes_Same_Object (A1, A2 : Node_Id) return Boolean;
+ function Denotes_Same_Prefix (A1, A2 : Node_Id) return Boolean;
+ -- Functions to detect suspicious overlapping between actuals in a call,
+ -- when one of them is writable. The predicates are those proposed in
+ -- AI05-0144, to detect dangerous order dependence in complex calls.
+ -- I would add a parameter Warn which enables more extensive testing of
+ -- cases as we find appropriate when we are only warning ??? Or perhaps
+ -- return an indication of (Error, Warn, OK) ???
+
function Denotes_Variable (N : Node_Id) return Boolean;
-- Returns True if node N denotes a single variable without parentheses
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 407171f1d7b..12143c8e792 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -3535,6 +3535,143 @@ package body Sem_Warn is
or else Warn_On_All_Unread_Out_Parameters;
end Warn_On_Modified_As_Out_Parameter;
+ ---------------------------------
+ -- Warn_On_Overlapping_Actuals --
+ ---------------------------------
+
+ procedure Warn_On_Overlapping_Actuals (Subp : Entity_Id; N : Node_Id) is
+ Act1, Act2 : Node_Id;
+ Form1, Form2 : Entity_Id;
+
+ begin
+ -- For now, treat this warning as an extension
+ -- Why not just define a new warning switch, you really don't want to
+ -- force this warning when using conditional expressions for example???
+
+ if not Extensions_Allowed then
+ return;
+ end if;
+
+ -- Exclude calls rewritten as enumeration literals
+
+ if not Nkind_In (N, N_Function_Call, N_Procedure_Call_Statement) then
+ return;
+ end if;
+
+ -- Exclude calls to library subprograms. Container operations specify
+ -- safe behavior when source and target coincide.
+
+ if Is_Predefined_File_Name
+ (Unit_File_Name (Get_Source_Unit (Sloc (Subp))))
+ then
+ return;
+ end if;
+
+ Form1 := First_Formal (Subp);
+ Act1 := First_Actual (N);
+ while Present (Form1) and then Present (Act1) loop
+ if Ekind (Form1) = E_In_Out_Parameter then
+ Form2 := First_Formal (Subp);
+ Act2 := First_Actual (N);
+ while Present (Form2) and then Present (Act2) loop
+ if Form1 /= Form2
+ and then Ekind (Form2) /= E_Out_Parameter
+ and then
+ (Denotes_Same_Object (Act1, Act2)
+ or else
+ Denotes_Same_Prefix (Act1, Act2))
+ then
+ -- Exclude generic types and guard against previous errors.
+ -- If either type is elementary the aliasing is harmless.
+
+ -- I can't relate the comment about elementary to the
+ -- actual code below, which seems to be testing generic???
+
+ if Error_Posted (N)
+ or else No (Etype (Act1))
+ or else No (Etype (Act2))
+ then
+ null;
+
+ elsif Is_Generic_Type (Etype (Act1))
+ or else
+ Is_Generic_Type (Etype (Act2))
+ then
+ null;
+
+ -- If the actual is a function call in prefix notation,
+ -- there is no real overlap.
+
+ elsif Nkind (Act2) = N_Function_Call then
+ null;
+
+ elsif Is_Elementary_Type (Underlying_Type (Etype (Form1)))
+ or else
+ Is_Elementary_Type (Underlying_Type (Etype (Form2)))
+ then
+ null;
+
+ else
+ declare
+ Act : Node_Id;
+ Form : Entity_Id;
+
+ begin
+ -- Find matching actual
+
+ Act := First_Actual (N);
+ Form := First_Formal (Subp);
+ while Act /= Act2 loop
+ Next_Formal (Form);
+ Next_Actual (Act);
+ end loop;
+
+ -- If the call was written in prefix notation, count
+ -- only the visible actuals in the call.
+
+ -- Why original_node calls below ???
+
+ if Is_Entity_Name (First_Actual (N))
+ and then Nkind (Original_Node (N)) = Nkind (N)
+ and then Nkind (Name (Original_Node (N))) =
+ N_Selected_Component
+ and then
+ Is_Entity_Name (Prefix (Name (Original_Node (N))))
+ and then
+ Entity (Prefix (Name (Original_Node (N)))) =
+ Entity (First_Actual (N))
+ then
+ if Act1 = First_Actual (N) then
+ Error_Msg_FE
+ ("`IN OUT` prefix overlaps with actual for&?",
+ Act1, Form);
+ else
+ Error_Msg_FE
+ ("writable actual overlaps with actual for&?",
+ Act1, Form);
+ end if;
+
+ else
+ Error_Msg_FE
+ ("writable actual overlaps with actual for&?",
+ Act1, Form);
+ end if;
+ end;
+ end if;
+
+ return;
+ end if;
+
+ Next_Formal (Form2);
+ Next_Actual (Act2);
+ end loop;
+ end if;
+
+ Next_Formal (Form1);
+ Next_Actual (Act1);
+ end loop;
+ end Warn_On_Overlapping_Actuals;
+
------------------------------
-- Warn_On_Suspicious_Index --
------------------------------
diff --git a/gcc/ada/sem_warn.ads b/gcc/ada/sem_warn.ads
index 4ab97be7d67..365ad397d1b 100644
--- a/gcc/ada/sem_warn.ads
+++ b/gcc/ada/sem_warn.ads
@@ -210,6 +210,11 @@ package Sem_Warn is
-- as an out parameter. True if either Warn_On_Modified_Unread is set for
-- an only OUT parameter, or if Warn_On_All_Unread_Out_Parameters is set.
+ procedure Warn_On_Overlapping_Actuals (Subp : Entity_Id; N : Node_Id);
+ -- Called on a subprogram call. Checks whether an IN OUT actual that is
+ -- not by-copy may overlap with another actual, thus leading to aliasing
+ -- in the body of the called subprogram.
+
procedure Warn_On_Suspicious_Index (Name : Entity_Id; X : Node_Id);
-- This is called after resolving an indexed component or a slice. Name
-- is the entity for the name of the indexed array, and X is the subscript
diff --git a/gcc/ada/styleg.adb b/gcc/ada/styleg.adb
index 8bd9f2ee2bd..bf72722cc88 100644
--- a/gcc/ada/styleg.adb
+++ b/gcc/ada/styleg.adb
@@ -813,12 +813,17 @@ package body Styleg is
-- Check_Right_Paren --
-----------------------
- -- In check tokens mode (-gnatyt), right paren must never be preceded by
+ -- In check tokens mode (-gnatyt), right paren must not be immediately
+ -- followed by an identifier character, and must never be preceded by
-- a space unless it is the initial non-blank character on the line.
procedure Check_Right_Paren is
begin
if Style_Check_Tokens then
+ if Identifier_Char (Source (Token_Ptr + 1)) then
+ Error_Space_Required (Token_Ptr + 1);
+ end if;
+
Check_No_Space_Before;
end if;
end Check_Right_Paren;
diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb
index 7273fde6703..3da3c611198 100644
--- a/gcc/ada/tbuild.adb
+++ b/gcc/ada/tbuild.adb
@@ -33,7 +33,6 @@ with Opt; use Opt;
with Restrict; use Restrict;
with Rident; use Rident;
with Sem_Aux; use Sem_Aux;
-with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Stringt; use Stringt;
@@ -626,6 +625,58 @@ package body Tbuild is
return Occurrence;
end New_Occurrence_Of;
+ -----------------
+ -- New_Op_Node --
+ -----------------
+
+ function New_Op_Node
+ (New_Node_Kind : Node_Kind;
+ New_Sloc : Source_Ptr) return Node_Id
+ is
+ type Name_Of_Type is array (N_Op) of Name_Id;
+ Name_Of : constant Name_Of_Type := Name_Of_Type'(
+ N_Op_And => Name_Op_And,
+ N_Op_Or => Name_Op_Or,
+ N_Op_Xor => Name_Op_Xor,
+ N_Op_Eq => Name_Op_Eq,
+ N_Op_Ne => Name_Op_Ne,
+ N_Op_Lt => Name_Op_Lt,
+ N_Op_Le => Name_Op_Le,
+ N_Op_Gt => Name_Op_Gt,
+ N_Op_Ge => Name_Op_Ge,
+ N_Op_Add => Name_Op_Add,
+ N_Op_Subtract => Name_Op_Subtract,
+ N_Op_Concat => Name_Op_Concat,
+ N_Op_Multiply => Name_Op_Multiply,
+ N_Op_Divide => Name_Op_Divide,
+ N_Op_Mod => Name_Op_Mod,
+ N_Op_Rem => Name_Op_Rem,
+ N_Op_Expon => Name_Op_Expon,
+ N_Op_Plus => Name_Op_Add,
+ N_Op_Minus => Name_Op_Subtract,
+ N_Op_Abs => Name_Op_Abs,
+ N_Op_Not => Name_Op_Not,
+
+ -- We don't really need these shift operators, since they never
+ -- appear as operators in the source, but the path of least
+ -- resistance is to put them in (the aggregate must be complete)
+
+ N_Op_Rotate_Left => Name_Rotate_Left,
+ N_Op_Rotate_Right => Name_Rotate_Right,
+ N_Op_Shift_Left => Name_Shift_Left,
+ N_Op_Shift_Right => Name_Shift_Right,
+ N_Op_Shift_Right_Arithmetic => Name_Shift_Right_Arithmetic);
+
+ Nod : constant Node_Id := New_Node (New_Node_Kind, New_Sloc);
+
+ begin
+ if New_Node_Kind in Name_Of'Range then
+ Set_Chars (Nod, Name_Of (New_Node_Kind));
+ end if;
+
+ return Nod;
+ end New_Op_Node;
+
----------------------
-- New_Reference_To --
----------------------
diff --git a/gcc/ada/tbuild.ads b/gcc/ada/tbuild.ads
index 261776df78f..0b73a53d220 100644
--- a/gcc/ada/tbuild.ads
+++ b/gcc/ada/tbuild.ads
@@ -27,6 +27,7 @@
-- building specific types of tree nodes.
with Namet; use Namet;
+with Sinfo; use Sinfo;
with Types; use Types;
package Tbuild is
@@ -196,6 +197,12 @@ package Tbuild is
-- "raise Constraint_Error" and returns the root of this tree,
-- the N_Raise_Statement node.
+ function New_Op_Node
+ (New_Node_Kind : Node_Kind;
+ New_Sloc : Source_Ptr) return Node_Id;
+ -- Create node using New_Node and, if its kind is in N_Op, set its Chars
+ -- field accordingly.
+
function New_External_Name
(Related_Id : Name_Id;
Suffix : Character := ' ';
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads
index 7340f64129e..cc3603aafa0 100644
--- a/gcc/ada/types.ads
+++ b/gcc/ada/types.ads
@@ -31,7 +31,7 @@
-- This package contains host independent type definitions which are used
-- in more than one unit in the compiler. They are gathered here for easy
--- reference, though in some cases the full description is found in the
+-- reference, although in some cases the full description is found in the
-- relevant module which implements the definition. The main reason that they
-- are not in their "natural" specs is that this would cause a lot of inter-
-- spec dependencies, and in particular some awkward circular dependencies
diff --git a/gcc/alias.c b/gcc/alias.c
index 40226f26b17..1d4290f7848 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2200,6 +2200,13 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y)
if (! DECL_P (exprx) || ! DECL_P (expry))
return 0;
+ /* With invalid code we can end up storing into the constant pool.
+ Bail out to avoid ICEing when creating RTL for this.
+ See gfortran.dg/lto/20091028-2_0.f90. */
+ if (TREE_CODE (exprx) == CONST_DECL
+ || TREE_CODE (expry) == CONST_DECL)
+ return 1;
+
rtlx = DECL_RTL (exprx);
rtly = DECL_RTL (expry);
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 35b4f1724e4..47828bf28c1 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -86,10 +86,6 @@
#include "tree-pass.h"
#include "df.h"
-#ifndef HAVE_conditional_execution
-#define HAVE_conditional_execution 0
-#endif
-
/* The number of rounds. In most cases there will only be 4 rounds, but
when partitioning hot and cold basic blocks into separate sections of
the .o file there will be an extra round.*/
@@ -2297,5 +2293,3 @@ struct rtl_opt_pass pass_partition_blocks =
TODO_dump_func | TODO_verify_rtl_sharing/* todo_flags_finish */
}
};
-
-
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 1243d72048b..0cb2bd7fb4e 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5656,7 +5656,8 @@ get_builtin_sync_mem (tree loc, enum machine_mode mode)
{
rtx addr, mem;
- addr = expand_expr (loc, NULL_RTX, Pmode, EXPAND_SUM);
+ addr = expand_expr (loc, NULL_RTX, ptr_mode, EXPAND_SUM);
+ addr = convert_memory_address (Pmode, addr);
/* Note that we explicitly do not want any alias information for this
memory, so that we kill all other live memories. Otherwise we don't
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index c7d2bc8da22..9b1f09c4593 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -2739,6 +2739,7 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
{
tree typetail, val;
unsigned int parmnum;
+ bool error_args = false;
const bool type_generic = fundecl
&& lookup_attribute ("type generic", TYPE_ATTRIBUTES(TREE_TYPE (fundecl)));
bool type_generic_remove_excess_precision = false;
@@ -3008,6 +3009,8 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
parmval = default_conversion (val);
VEC_replace (tree, values, parmnum, parmval);
+ if (parmval == error_mark_node)
+ error_args = true;
if (typetail)
typetail = TREE_CHAIN (typetail);
@@ -3021,7 +3024,7 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
return -1;
}
- return parmnum;
+ return error_args ? -1 : (int) parmnum;
}
/* This is the entry point used by the parser to build unary operators
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 7b8b738ed1f..7105e59c5ec 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1422,7 +1422,10 @@ cgraph_optimize (void)
/* Do nothing else if any IPA pass found errors. */
if (errorcount || sorrycount)
- return;
+ {
+ timevar_pop (TV_CGRAPHOPT);
+ return;
+ }
/* This pass remove bodies of extern inline functions we never inlined.
Do this later so other IPA passes see what is really going on. */
diff --git a/gcc/combine.c b/gcc/combine.c
index 2311755691c..80c538ec490 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -11467,6 +11467,22 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
{
int zero_extended;
+ /* If this is a test for negative, we can make an explicit
+ test of the sign bit. Test this first so we can use
+ a paradoxical subreg to extend OP0. */
+
+ if (op1 == const0_rtx && (code == LT || code == GE)
+ && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
+ {
+ op0 = simplify_gen_binary (AND, tmode,
+ gen_lowpart (tmode, op0),
+ GEN_INT ((HOST_WIDE_INT) 1
+ << (GET_MODE_BITSIZE (mode)
+ - 1)));
+ code = (code == LT) ? NE : EQ;
+ break;
+ }
+
/* If the only nonzero bits in OP0 and OP1 are those in the
narrower mode and this is an equality or unsigned comparison,
we can use the wider mode. Similarly for sign-extended
@@ -11497,27 +11513,20 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
XEXP (op0, 0)),
gen_lowpart (tmode,
XEXP (op0, 1)));
-
- op0 = gen_lowpart (tmode, op0);
- if (zero_extended && CONST_INT_P (op1))
- op1 = GEN_INT (INTVAL (op1) & GET_MODE_MASK (mode));
- op1 = gen_lowpart (tmode, op1);
- break;
- }
-
- /* If this is a test for negative, we can make an explicit
- test of the sign bit. */
-
- if (op1 == const0_rtx && (code == LT || code == GE)
- && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
- {
- op0 = simplify_gen_binary (AND, tmode,
- gen_lowpart (tmode, op0),
- GEN_INT ((HOST_WIDE_INT) 1
- << (GET_MODE_BITSIZE (mode)
- - 1)));
- code = (code == LT) ? NE : EQ;
- break;
+ else
+ {
+ if (zero_extended)
+ {
+ op0 = simplify_gen_unary (ZERO_EXTEND, tmode, op0, mode);
+ op1 = simplify_gen_unary (ZERO_EXTEND, tmode, op1, mode);
+ }
+ else
+ {
+ op0 = simplify_gen_unary (SIGN_EXTEND, tmode, op0, mode);
+ op1 = simplify_gen_unary (SIGN_EXTEND, tmode, op1, mode);
+ }
+ break;
+ }
}
}
diff --git a/gcc/common.opt b/gcc/common.opt
index 3b7f48cdbad..ac71d36e309 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1462,6 +1462,9 @@ funwind-tables
Common Report Var(flag_unwind_tables) Optimization
Just generate unwind tables for exception handling
+fuse-linker-plugin
+Common Undocumented
+
fvar-tracking
Common Report Var(flag_var_tracking) VarExists Optimization
Perform variable tracking
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 93c35901116..c22cfec3216 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -138,6 +138,7 @@ static rtx arm_libcall_value (enum machine_mode, const_rtx);
static void arm_internal_label (FILE *, const char *, unsigned long);
static void arm_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT,
tree);
+static bool arm_have_conditional_execution (void);
static bool arm_rtx_costs_1 (rtx, enum rtx_code, int*, bool);
static bool arm_size_rtx_costs (rtx, enum rtx_code, enum rtx_code, int *);
static bool arm_slowmul_rtx_costs (rtx, enum rtx_code, enum rtx_code, int *, bool);
@@ -445,6 +446,9 @@ static const struct attribute_spec arm_attribute_table[] =
#define TARGET_HAVE_TLS true
#endif
+#undef TARGET_HAVE_CONDITIONAL_EXECUTION
+#define TARGET_HAVE_CONDITIONAL_EXECUTION arm_have_conditional_execution
+
#undef TARGET_CANNOT_FORCE_CONST_MEM
#define TARGET_CANNOT_FORCE_CONST_MEM arm_cannot_force_const_mem
@@ -6211,7 +6215,7 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
else if ((outer == PLUS || outer == COMPARE)
&& INTVAL (x) < 256 && INTVAL (x) > -256)
return 0;
- else if (outer == AND
+ else if ((outer == IOR || outer == XOR || outer == AND)
&& INTVAL (x) < 256 && INTVAL (x) >= -256)
return COSTS_N_INSNS (1);
else if (outer == ASHIFT || outer == ASHIFTRT
@@ -21183,4 +21187,12 @@ arm_frame_pointer_required (void)
|| (TARGET_ARM && TARGET_APCS_FRAME && ! leaf_function_p ()));
}
+/* Only thumb1 can't support conditional execution, so return true if
+ the target is not thumb1. */
+static bool
+arm_have_conditional_execution (void)
+{
+ return !TARGET_THUMB1;
+}
+
#include "gt-arm.h"
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index e180c2f08f1..d718c590434 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -1914,7 +1914,16 @@
else /* TARGET_THUMB1 */
{
if (GET_CODE (operands[2]) != CONST_INT)
- operands[2] = force_reg (SImode, operands[2]);
+ {
+ rtx tmp = force_reg (SImode, operands[2]);
+ if (rtx_equal_p (operands[0], operands[1]))
+ operands[2] = tmp;
+ else
+ {
+ operands[2] = operands[1];
+ operands[1] = tmp;
+ }
+ }
else
{
int i;
@@ -2623,7 +2632,16 @@
DONE;
}
else /* TARGET_THUMB1 */
- operands [2] = force_reg (SImode, operands [2]);
+ {
+ rtx tmp = force_reg (SImode, operands[2]);
+ if (rtx_equal_p (operands[0], operands[1]))
+ operands[2] = tmp;
+ else
+ {
+ operands[2] = operands[1];
+ operands[1] = tmp;
+ }
+ }
}
"
)
@@ -2731,12 +2749,29 @@
(define_expand "xorsi3"
[(set (match_operand:SI 0 "s_register_operand" "")
(xor:SI (match_operand:SI 1 "s_register_operand" "")
- (match_operand:SI 2 "arm_rhs_operand" "")))]
+ (match_operand:SI 2 "reg_or_int_operand" "")))]
"TARGET_EITHER"
- "if (TARGET_THUMB1)
- if (GET_CODE (operands[2]) == CONST_INT)
- operands[2] = force_reg (SImode, operands[2]);
- "
+ "if (GET_CODE (operands[2]) == CONST_INT)
+ {
+ if (TARGET_32BIT)
+ {
+ arm_split_constant (XOR, SImode, NULL_RTX,
+ INTVAL (operands[2]), operands[0], operands[1],
+ optimize && can_create_pseudo_p ());
+ DONE;
+ }
+ else /* TARGET_THUMB1 */
+ {
+ rtx tmp = force_reg (SImode, operands[2]);
+ if (rtx_equal_p (operands[0], operands[1]))
+ operands[2] = tmp;
+ else
+ {
+ operands[2] = operands[1];
+ operands[1] = tmp;
+ }
+ }
+ }"
)
(define_insn "*arm_xorsi3"
@@ -8033,15 +8068,13 @@
if (!thumb1_cmp_operand (op3, SImode))
op3 = force_reg (SImode, op3);
scratch = gen_reg_rtx (SImode);
- emit_insn (gen_cstoresi_nltu_thumb1 (scratch, operands[2], op3));
- emit_insn (gen_negsi2 (operands[0], scratch));
+ emit_insn (gen_cstoresi_ltu_thumb1 (operands[0], operands[2], op3));
break;
case GTU:
op3 = force_reg (SImode, operands[3]);
scratch = gen_reg_rtx (SImode);
- emit_insn (gen_cstoresi_nltu_thumb1 (scratch, op3, operands[2]));
- emit_insn (gen_negsi2 (operands[0], scratch));
+ emit_insn (gen_cstoresi_ltu_thumb1 (operands[0], op3, operands[2]));
break;
/* No good sequences for GT, LT. */
@@ -8125,6 +8158,7 @@
[(set_attr "length" "4")]
)
+;; Used as part of the expansion of thumb ltu and gtu sequences
(define_insn "cstoresi_nltu_thumb1"
[(set (match_operand:SI 0 "s_register_operand" "=l,l")
(neg:SI (ltu:SI (match_operand:SI 1 "s_register_operand" "l,*h")
@@ -8134,6 +8168,20 @@
[(set_attr "length" "4")]
)
+(define_insn_and_split "cstoresi_ltu_thumb1"
+ [(set (match_operand:SI 0 "s_register_operand" "=l,l")
+ (ltu:SI (match_operand:SI 1 "s_register_operand" "l,*h")
+ (match_operand:SI 2 "thumb1_cmp_operand" "lI*h,*r")))]
+ "TARGET_THUMB1"
+ "#"
+ "TARGET_THUMB1"
+ [(set (match_dup 3)
+ (neg:SI (ltu:SI (match_dup 1) (match_dup 2))))
+ (set (match_dup 0) (neg:SI (match_dup 3)))]
+ "operands[3] = gen_reg_rtx (SImode);"
+ [(set_attr "length" "4")]
+)
+
;; Used as part of the expansion of thumb les sequence.
(define_insn "thumb1_addsi3_addgeu"
[(set (match_operand:SI 0 "s_register_operand" "=l")
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 6065f49a042..fd1dad6c408 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -10794,7 +10794,7 @@ i386_output_dwarf_dtprel (FILE *file, int size, rtx x)
static bool
ix86_pic_register_p (rtx x)
{
- if (GET_CODE (x) == VALUE)
+ if (GET_CODE (x) == VALUE && CSELIB_VAL_PTR (x))
return (pic_offset_table_rtx
&& rtx_equal_for_cselib_p (x, pic_offset_table_rtx));
else
@@ -20042,6 +20042,9 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
}
#ifdef ENABLE_EXECUTE_STACK
+#ifdef CHECK_EXECUTE_STACK_ENABLED
+ if (CHECK_EXECUTE_STACK_ENABLED)
+#endif
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
#endif
diff --git a/gcc/config/i386/mingw.opt b/gcc/config/i386/mingw.opt
index 6be904e968a..bd9a4b63035 100644
--- a/gcc/config/i386/mingw.opt
+++ b/gcc/config/i386/mingw.opt
@@ -21,3 +21,7 @@
Wpedantic-ms-format
C ObjC C++ ObjC++ Var(warn_pedantic_ms_format) Init(1) Warning
Warn about none ISO msvcrt scanf/printf width extensions
+
+fset-stack-executable
+Common Report Var(flag_setstackexecutable) Init(1) Optimization
+For nested functions on stack executable permission is set.
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 9dcc5ba1f67..4f8b101a7ba 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -202,6 +202,8 @@ __enable_execute_stack (void *addr) \
#undef ENABLE_EXECUTE_STACK
#define ENABLE_EXECUTE_STACK MINGW_ENABLE_EXECUTE_STACK
+#undef CHECK_EXECUTE_STACK_ENABLED
+#define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable
#ifdef IN_LIBGCC2
#include <windows.h>
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index f82091a7f36..6af8d03cb32 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -2444,6 +2444,28 @@ mips_emit_move (rtx dest, rtx src)
: emit_move_insn_1 (dest, src));
}
+/* Emit an instruction of the form (set TARGET (CODE OP0)). */
+
+static void
+mips_emit_unary (enum rtx_code code, rtx target, rtx op0)
+{
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_fmt_e (code, GET_MODE (op0), op0)));
+}
+
+/* Compute (CODE OP0) and store the result in a new register of mode MODE.
+ Return that new register. */
+
+static rtx
+mips_force_unary (enum machine_mode mode, enum rtx_code code, rtx op0)
+{
+ rtx reg;
+
+ reg = gen_reg_rtx (mode);
+ mips_emit_unary (code, reg, op0);
+ return reg;
+}
+
/* Emit an instruction of the form (set TARGET (CODE OP0 OP1)). */
static void
@@ -6689,7 +6711,14 @@ mips_expand_block_move (rtx dest, rtx src, rtx length)
void
mips_expand_synci_loop (rtx begin, rtx end)
{
- rtx inc, label, cmp, cmp_result;
+ rtx inc, label, end_label, cmp_result, mask, length;
+
+ /* Create end_label. */
+ end_label = gen_label_rtx ();
+
+ /* Check if begin equals end. */
+ cmp_result = gen_rtx_EQ (VOIDmode, begin, end);
+ emit_jump_insn (gen_condjump (cmp_result, end_label));
/* Load INC with the cache line size (rdhwr INC,$1). */
inc = gen_reg_rtx (Pmode);
@@ -6697,18 +6726,36 @@ mips_expand_synci_loop (rtx begin, rtx end)
? gen_rdhwr_synci_step_si (inc)
: gen_rdhwr_synci_step_di (inc));
+ /* Check if inc is 0. */
+ cmp_result = gen_rtx_EQ (VOIDmode, inc, const0_rtx);
+ emit_jump_insn (gen_condjump (cmp_result, end_label));
+
+ /* Calculate mask. */
+ mask = mips_force_unary (Pmode, NEG, inc);
+
+ /* Mask out begin by mask. */
+ begin = mips_force_binary (Pmode, AND, begin, mask);
+
+ /* Calculate length. */
+ length = mips_force_binary (Pmode, MINUS, end, begin);
+
/* Loop back to here. */
label = gen_label_rtx ();
emit_label (label);
emit_insn (gen_synci (begin));
- cmp = mips_force_binary (Pmode, GTU, begin, end);
+ /* Update length. */
+ mips_emit_binary (MINUS, length, length, inc);
+ /* Update begin. */
mips_emit_binary (PLUS, begin, begin, inc);
- cmp_result = gen_rtx_EQ (VOIDmode, cmp, const0_rtx);
+ /* Check if length is greater than 0. */
+ cmp_result = gen_rtx_GT (VOIDmode, length, const0_rtx);
emit_jump_insn (gen_condjump (cmp_result, label));
+
+ emit_label (end_label);
}
/* Expand a QI or HI mode atomic memory operation.
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 9638e8d265d..7fa634777b3 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -6824,8 +6824,8 @@ label:
;; jump around the unconditional jump because it was out of range.
(define_insn "stuff_delay_slot"
[(set (pc)
- (unspec [(match_operand:SI 0 "const_int_operand" "") (pc)] UNSPEC_BBR))
- (match_operand:SI 1 "const_int_operand" "")]
+ (unspec [(match_operand:SI 0 "const_int_operand" "") (pc)
+ (match_operand:SI 1 "const_int_operand" "")] UNSPEC_BBR))]
"TARGET_SH1"
""
[(set_attr "length" "0")
@@ -6889,8 +6889,6 @@ label:
"TARGET_SHMEDIA"
"
{
- /* hack to generate same code. */
- rtx tmp_di = GET_CODE (operands[0]) == UNORDERED ? NULL : gen_reg_rtx (DImode);
rtx tmp = gen_reg_rtx (SImode);
rtx cmp;
if (GET_CODE (operands[0]) == NE)
@@ -6900,13 +6898,12 @@ label:
operands[1], operands[2]);
emit_insn (gen_cstore4_media (tmp, cmp, operands[1], operands[2]));
- if (tmp_di) emit_insn (gen_extendsidi2 (tmp_di, tmp)); else tmp_di = tmp;
if (GET_CODE (cmp) == GET_CODE (operands[0]))
- operands[0] = gen_rtx_NE (VOIDmode, tmp_di, const0_rtx);
+ operands[0] = gen_rtx_NE (VOIDmode, tmp, const0_rtx);
else
- operands[0] = gen_rtx_EQ (VOIDmode, tmp_di, const0_rtx);
- operands[1] = tmp_di;
+ operands[0] = gen_rtx_EQ (VOIDmode, tmp, const0_rtx);
+ operands[1] = tmp;
operands[2] = const0_rtx;
operands[3] = gen_rtx_LABEL_REF (Pmode, operands[3]);
}")
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e7229587878..83fdfe3b181 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,28 @@
+2009-10-28 Jason Merrill <jason@redhat.com>
+
+ Core issue 812, 861
+ * name-lookup.c (set_decl_namespace): Deal properly with inline
+ namespaces.
+ (qualified_lookup_using_namespace): Overhaul.
+ * pt.c (print_candidates): Handle getting an OVERLOAD.
+
+2009-10-28 Jason Merrill <jason@redhat.com>
+
+ * decl.c (cp_fname_init): Correct build_string argument.
+
+2009-10-27 Jason Merrill <jason@redhat.com>
+
+ Allow no-capture lambdas to convert to function pointer.
+ * semantics.c (maybe_add_lambda_conv_op): New.
+ * parser.c (cp_parser_lambda_expression): Call it.
+ (cp_parser_lambda_declarator_opt): Make op() static if
+ no captures.
+ * mangle.c (write_closure_type_name): Adjust.
+ * semantics.c (finish_this_expr): Adjust.
+ * decl.c (grok_op_properties): Allow it.
+ * call.c (build_user_type_conversion_1): Handle static conversion op.
+ (build_op_call): And op().
+
2009-10-26 Jakub Jelinek <jakub@redhat.com>
PR debug/41828
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 45428045b84..d4bdcbae66e 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -2953,11 +2953,16 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags)
for (fns = TREE_VALUE (conv_fns); fns; fns = OVL_NEXT (fns))
{
tree fn = OVL_CURRENT (fns);
+ tree first = first_arg;
if (DECL_NONCONVERTING_P (fn)
&& (flags & LOOKUP_ONLYCONVERTING))
continue;
+ /* Lambdas have a static conversion op. */
+ if (DECL_STATIC_FUNCTION_P (fn))
+ first = NULL_TREE;
+
/* [over.match.funcs] For conversion functions, the function
is considered to be a member of the class of the implicit
object argument for the purpose of defining the type of
@@ -2968,14 +2973,14 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags)
if (TREE_CODE (fn) == TEMPLATE_DECL)
cand = add_template_candidate (&candidates, fn, fromtype,
NULL_TREE,
- first_arg, NULL, totype,
+ first, NULL, totype,
TYPE_BINFO (fromtype),
conversion_path,
flags,
DEDUCE_CONV);
else
cand = add_function_candidate (&candidates, fn, fromtype,
- first_arg, NULL,
+ first, NULL,
TYPE_BINFO (fromtype),
conversion_path,
flags);
@@ -3382,20 +3387,30 @@ build_op_call (tree obj, VEC(tree,gc) **args, tsubst_flags_t complain)
for (fns = BASELINK_FUNCTIONS (fns); fns; fns = OVL_NEXT (fns))
{
tree fn = OVL_CURRENT (fns);
+
+ tree lfirst = first_mem_arg;
+ if (DECL_STATIC_FUNCTION_P (fn))
+ lfirst = NULL_TREE;
+
if (TREE_CODE (fn) == TEMPLATE_DECL)
add_template_candidate (&candidates, fn, base, NULL_TREE,
- first_mem_arg, *args, NULL_TREE,
+ lfirst, *args, NULL_TREE,
TYPE_BINFO (type),
TYPE_BINFO (type),
LOOKUP_NORMAL, DEDUCE_CALL);
else
add_function_candidate
- (&candidates, fn, base, first_mem_arg, *args, TYPE_BINFO (type),
+ (&candidates, fn, base, lfirst, *args, TYPE_BINFO (type),
TYPE_BINFO (type), LOOKUP_NORMAL);
}
}
- convs = lookup_conversions (type);
+ /* Rather than mess with handling static conversion ops here, just don't
+ look at conversions in lambdas. */
+ if (LAMBDA_TYPE_P (type))
+ convs = NULL_TREE;
+ else
+ convs = lookup_conversions (type);
for (; convs; convs = TREE_CHAIN (convs))
{
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index d737bdf7055..dc4c6b39c9a 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2677,7 +2677,8 @@ add_implicitly_declared_members (tree t,
CLASSTYPE_LAZY_COPY_CTOR (t) = 1;
}
- /* Currently only lambdas get a lazy move ctor. */
+ /* Currently only lambdas get a lazy move ctor, but N2987 adds them for
+ other classes. */
if (LAMBDA_TYPE_P (t))
CLASSTYPE_LAZY_MOVE_CTOR (t) = 1;
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index ea28e9fadaa..5c51a6fd7b6 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -5073,6 +5073,7 @@ extern void apply_lambda_return_type (tree, tree);
extern tree add_capture (tree, tree, tree, bool, bool);
extern tree add_default_capture (tree, tree, tree);
extern tree lambda_expr_this_capture (tree);
+extern void maybe_add_lambda_conv_op (tree);
/* in tree.c */
void cp_free_lang_data (tree t);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index ead3f335c8a..349d3b3d63e 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3512,7 +3512,7 @@ cp_fname_init (const char* name, tree *type_p)
{
length = strlen (name);
domain = build_index_type (size_int (length));
- init = build_string (length + 1, name);
+ init = build_string (length, name);
}
type = build_qualified_type (char_type_node, TYPE_QUAL_CONST);
@@ -10209,8 +10209,13 @@ grok_op_properties (tree decl, bool complain)
|| operator_code == ARRAY_REF
|| operator_code == NOP_EXPR)
{
- error ("%qD must be a nonstatic member function", decl);
- return false;
+ if (class_type && LAMBDA_TYPE_P (class_type))
+ /* Lambdas can have static op() and conv ops. */;
+ else
+ {
+ error ("%qD must be a nonstatic member function", decl);
+ return false;
+ }
}
else
{
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index d4bcbace727..874df748f81 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1309,7 +1309,7 @@ write_closure_type_name (const tree type)
MANGLE_TRACE_TREE ("closure-type-name", type);
write_string ("Ul");
- write_method_parms (parms, /*method_p=*/1, fn);
+ write_method_parms (parms, DECL_NONSTATIC_MEMBER_FUNCTION_P (fn), fn);
write_char ('E');
write_compact_number (LAMBDA_EXPR_DISCRIMINATOR (lambda));
}
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 6e31f8a058a..9a6991269f8 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3062,7 +3062,7 @@ set_namespace_binding (tree name, tree scope, tree val)
void
set_decl_namespace (tree decl, tree scope, bool friendp)
{
- tree old, fn;
+ tree old;
/* Get rid of namespace aliases. */
scope = ORIGINAL_NAMESPACE (scope);
@@ -3087,17 +3087,25 @@ set_decl_namespace (tree decl, tree scope, bool friendp)
if (old == error_mark_node)
/* No old declaration at all. */
goto complain;
+ /* If it's a TREE_LIST, the result of the lookup was ambiguous. */
+ if (TREE_CODE (old) == TREE_LIST)
+ {
+ error ("reference to %qD is ambiguous", decl);
+ print_candidates (old);
+ return;
+ }
if (!is_overloaded_fn (decl))
- /* Don't compare non-function decls with decls_match here, since
- it can't check for the correct constness at this
- point. pushdecl will find those errors later. */
- return;
+ {
+ /* We might have found OLD in an inline namespace inside SCOPE. */
+ DECL_CONTEXT (decl) = DECL_CONTEXT (old);
+ /* Don't compare non-function decls with decls_match here, since
+ it can't check for the correct constness at this
+ point. pushdecl will find those errors later. */
+ return;
+ }
/* Since decl is a function, old should contain a function decl. */
if (!is_overloaded_fn (old))
goto complain;
- fn = OVL_CURRENT (old);
- if (!is_associated_namespace (scope, CP_DECL_CONTEXT (fn)))
- goto complain;
/* A template can be explicitly specialized in any namespace. */
if (processing_explicit_instantiation)
return;
@@ -3113,12 +3121,43 @@ set_decl_namespace (tree decl, tree scope, bool friendp)
return;
if (is_overloaded_fn (old))
{
- for (; old; old = OVL_NEXT (old))
- if (decls_match (decl, OVL_CURRENT (old)))
+ tree found = NULL_TREE;
+ tree elt = old;
+ for (; elt; elt = OVL_NEXT (elt))
+ {
+ tree ofn = OVL_CURRENT (elt);
+ /* Adjust DECL_CONTEXT first so decls_match will return true
+ if DECL will match a declaration in an inline namespace. */
+ DECL_CONTEXT (decl) = DECL_CONTEXT (ofn);
+ if (decls_match (decl, ofn))
+ {
+ if (found && !decls_match (found, ofn))
+ {
+ DECL_CONTEXT (decl) = FROB_CONTEXT (scope);
+ error ("reference to %qD is ambiguous", decl);
+ print_candidates (old);
+ return;
+ }
+ found = ofn;
+ }
+ }
+ if (found)
+ {
+ if (!is_associated_namespace (scope, CP_DECL_CONTEXT (found)))
+ goto complain;
+ DECL_CONTEXT (decl) = DECL_CONTEXT (found);
return;
+ }
}
- else if (decls_match (decl, old))
- return;
+ else
+ {
+ DECL_CONTEXT (decl) = DECL_CONTEXT (old);
+ if (decls_match (decl, old))
+ return;
+ }
+
+ /* It didn't work, go back to the explicit scope. */
+ DECL_CONTEXT (decl) = FROB_CONTEXT (scope);
complain:
error ("%qD should have been declared inside %qD", decl, scope);
}
@@ -3925,6 +3964,19 @@ lookup_using_namespace (tree name, struct scope_binding *val,
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, val->value != error_mark_node);
}
+/* Returns true iff VEC contains TARGET. */
+
+static bool
+tree_vec_contains (VEC(tree,gc)* vec, tree target)
+{
+ unsigned int i;
+ tree elt;
+ for (i = 0; VEC_iterate(tree,vec,i,elt); ++i)
+ if (elt == target)
+ return true;
+ return false;
+}
+
/* [namespace.qual]
Accepts the NAME to lookup and its qualifying SCOPE.
Returns the name/type pair found into the cxx_binding *RESULT,
@@ -3935,62 +3987,72 @@ qualified_lookup_using_namespace (tree name, tree scope,
struct scope_binding *result, int flags)
{
/* Maintain a list of namespaces visited... */
- tree seen = NULL_TREE;
+ VEC(tree,gc) *seen = NULL;
+ VEC(tree,gc) *seen_inline = NULL;
/* ... and a list of namespace yet to see. */
- tree todo = NULL_TREE;
- tree todo_maybe = NULL_TREE;
- tree *todo_weak = &todo_maybe;
+ VEC(tree,gc) *todo = NULL;
+ VEC(tree,gc) *todo_maybe = NULL;
+ VEC(tree,gc) *todo_inline = NULL;
tree usings;
timevar_push (TV_NAME_LOOKUP);
/* Look through namespace aliases. */
scope = ORIGINAL_NAMESPACE (scope);
- while (scope && result->value != error_mark_node)
+
+ /* Algorithm: Starting with SCOPE, walk through the the set of used
+ namespaces. For each used namespace, look through its inline
+ namespace set for any bindings and usings. If no bindings are found,
+ add any usings seen to the set of used namespaces. */
+ VEC_safe_push (tree, gc, todo, scope);
+
+ while (VEC_length (tree, todo))
{
- cxx_binding *binding =
- cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
- seen = tree_cons (scope, NULL_TREE, seen);
- if (binding)
- ambiguous_decl (result, binding, flags);
-
- /* Consider strong using directives always, and non-strong ones
- if we haven't found a binding yet. */
- for (usings = DECL_NAMESPACE_USING (scope); usings;
- usings = TREE_CHAIN (usings))
- /* If this was a real directive, and we have not seen it. */
- if (!TREE_INDIRECT_USING (usings))
- {
- /* Try to avoid queuing the same namespace more than once,
- the exception being when a namespace was already
- enqueued for todo_maybe and then a strong using is
- found for it. We could try to remove it from
- todo_maybe, but it's probably not worth the effort. */
- if (is_associated_namespace (scope, TREE_PURPOSE (usings))
- && !purpose_member (TREE_PURPOSE (usings), seen)
- && !purpose_member (TREE_PURPOSE (usings), todo))
- todo = tree_cons (TREE_PURPOSE (usings), NULL_TREE, todo);
- else if (!binding
- && !purpose_member (TREE_PURPOSE (usings), seen)
- && !purpose_member (TREE_PURPOSE (usings), todo)
- && !purpose_member (TREE_PURPOSE (usings), todo_maybe))
- *todo_weak = tree_cons (TREE_PURPOSE (usings), NULL_TREE,
- *todo_weak);
- }
- if (todo)
+ bool found_here;
+ scope = VEC_pop (tree, todo);
+ if (tree_vec_contains (seen, scope))
+ continue;
+ VEC_safe_push (tree, gc, seen, scope);
+ VEC_safe_push (tree, gc, todo_inline, scope);
+
+ found_here = false;
+ while (VEC_length (tree, todo_inline))
{
- scope = TREE_PURPOSE (todo);
- todo = TREE_CHAIN (todo);
- }
- else if (todo_maybe
- && (!result->value && !result->type))
- {
- scope = TREE_PURPOSE (todo_maybe);
- todo = TREE_CHAIN (todo_maybe);
- todo_maybe = NULL_TREE;
- todo_weak = &todo;
+ cxx_binding *binding;
+
+ scope = VEC_pop (tree, todo_inline);
+ if (tree_vec_contains (seen_inline, scope))
+ continue;
+ VEC_safe_push (tree, gc, seen_inline, scope);
+
+ binding =
+ cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
+ if (binding)
+ {
+ found_here = true;
+ ambiguous_decl (result, binding, flags);
+ }
+
+ for (usings = DECL_NAMESPACE_USING (scope); usings;
+ usings = TREE_CHAIN (usings))
+ if (!TREE_INDIRECT_USING (usings))
+ {
+ if (is_associated_namespace (scope, TREE_PURPOSE (usings)))
+ VEC_safe_push (tree, gc, todo_inline, TREE_PURPOSE (usings));
+ else
+ VEC_safe_push (tree, gc, todo_maybe, TREE_PURPOSE (usings));
+ }
}
+
+ if (found_here)
+ VEC_truncate (tree, todo_maybe, 0);
else
- scope = NULL_TREE; /* If there never was a todo list. */
+ while (VEC_length (tree, todo_maybe))
+ VEC_safe_push (tree, gc, todo, VEC_pop (tree, todo_maybe));
}
+ VEC_free (tree,gc,todo);
+ VEC_free (tree,gc,todo_maybe);
+ VEC_free (tree,gc,todo_inline);
+ VEC_free (tree,gc,seen);
+ VEC_free (tree,gc,seen_inline);
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, result->value != error_mark_node);
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 7fd995f9e83..2a0cc37d877 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -7090,6 +7090,8 @@ cp_parser_lambda_expression (cp_parser* parser)
LAMBDA_EXPR_CAPTURE_LIST (lambda_expr) = newlist;
}
+ maybe_add_lambda_conv_op (type);
+
type = finish_struct (type, /*attributes=*/NULL_TREE);
parser->num_template_parameter_lists = saved_num_template_parameter_lists;
@@ -7347,15 +7349,25 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
declarator = make_id_declarator (NULL_TREE, ansi_opname (CALL_EXPR),
sfk_none);
- quals = (LAMBDA_EXPR_MUTABLE_P (lambda_expr)
- ? TYPE_UNQUALIFIED : TYPE_QUAL_CONST);
+ quals = TYPE_UNQUALIFIED;
+ if (LAMBDA_EXPR_CAPTURE_LIST (lambda_expr) == NULL_TREE
+ && LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (lambda_expr) == CPLD_NONE)
+ {
+ /* A lambda with no captures has a static op() and a conversion op
+ to function type. */
+ if (LAMBDA_EXPR_MUTABLE_P (lambda_expr))
+ error ("lambda expression with no captures declared mutable");
+ return_type_specs.storage_class = sc_static;
+ }
+ else if (!LAMBDA_EXPR_MUTABLE_P (lambda_expr))
+ quals = TYPE_QUAL_CONST;
declarator = make_call_declarator (declarator, param_list, quals,
exception_spec,
/*late_return_type=*/NULL_TREE);
fco = grokmethod (&return_type_specs,
- declarator,
- attributes);
+ declarator,
+ attributes);
DECL_INITIALIZED_IN_CLASS_P (fco) = 1;
DECL_ARTIFICIAL (fco) = 1;
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f4806828cc4..ace340eeb3f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1640,13 +1640,20 @@ void
print_candidates (tree fns)
{
tree fn;
+ tree f;
const char *str = "candidates are:";
- for (fn = fns; fn != NULL_TREE; fn = TREE_CHAIN (fn))
+ if (is_overloaded_fn (fns))
+ {
+ for (f = fns; f; f = OVL_NEXT (f))
+ {
+ error ("%s %+#D", str, OVL_CURRENT (f));
+ str = " ";
+ }
+ }
+ else for (fn = fns; fn != NULL_TREE; fn = TREE_CHAIN (fn))
{
- tree f;
-
for (f = TREE_VALUE (fn); f; f = OVL_NEXT (f))
error ("%s %+#D", str, OVL_CURRENT (f));
str = " ";
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 417c15f428e..e270a734fa0 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2063,17 +2063,13 @@ finish_this_expr (void)
{
tree result;
- if (current_class_ptr)
- {
- tree type = TREE_TYPE (current_class_ref);
-
- /* In a lambda expression, 'this' refers to the captured 'this'. */
- if (LAMBDA_TYPE_P (type))
- result = lambda_expr_this_capture (CLASSTYPE_LAMBDA_EXPR (type));
- else
- result = current_class_ptr;
-
- }
+ /* In a lambda expression, 'this' refers to the captured 'this'. */
+ if (current_function_decl
+ && LAMBDA_FUNCTION_P (current_function_decl))
+ result = (lambda_expr_this_capture
+ (CLASSTYPE_LAMBDA_EXPR (current_class_type)));
+ else if (current_class_ptr)
+ result = current_class_ptr;
else if (current_function_decl
&& DECL_STATIC_FUNCTION_P (current_function_decl))
{
@@ -5759,4 +5755,55 @@ lambda_expr_this_capture (tree lambda)
return result;
}
+/* If the closure TYPE has a static op(), also add a conversion to function
+ pointer. */
+
+void
+maybe_add_lambda_conv_op (tree type)
+{
+ bool nested = (current_function_decl != NULL_TREE);
+ tree callop = lambda_function (type);
+ tree rettype, name, fntype, fn, body, compound_stmt;
+
+ if (!DECL_STATIC_FUNCTION_P (callop))
+ return;
+
+ rettype = build_pointer_type (TREE_TYPE (callop));
+ name = mangle_conv_op_name_for_type (rettype);
+ fntype = build_function_type (rettype, void_list_node);
+ fn = build_lang_decl (FUNCTION_DECL, name, fntype);
+ DECL_SOURCE_LOCATION (fn) = DECL_SOURCE_LOCATION (callop);
+
+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
+ && DECL_ALIGN (fn) < 2 * BITS_PER_UNIT)
+ DECL_ALIGN (fn) = 2 * BITS_PER_UNIT;
+
+ SET_OVERLOADED_OPERATOR_CODE (fn, TYPE_EXPR);
+ grokclassfn (type, fn, NO_SPECIAL);
+ set_linkage_according_to_type (type, fn);
+ rest_of_decl_compilation (fn, toplevel_bindings_p (), at_eof);
+ DECL_IN_AGGR_P (fn) = 1;
+ DECL_ARTIFICIAL (fn) = 1;
+ DECL_NOT_REALLY_EXTERN (fn) = 1;
+ DECL_DECLARED_INLINE_P (fn) = 1;
+ DECL_STATIC_FUNCTION_P (fn) = 1;
+
+ add_method (type, fn, NULL_TREE);
+
+ if (nested)
+ push_function_context ();
+ start_preparsed_function (fn, NULL_TREE,
+ SF_PRE_PARSED | SF_INCLASS_INLINE);
+ body = begin_function_body ();
+ compound_stmt = begin_compound_stmt (0);
+
+ finish_return_stmt (decay_conversion (callop));
+
+ finish_compound_stmt (compound_stmt);
+ finish_function_body (body);
+
+ expand_or_defer_fn (finish_function (2));
+ if (nested)
+ pop_function_context ();
+}
#include "gt-cp-semantics.h"
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index b5688d98cf1..0bf5e3cec2e 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -3189,7 +3189,7 @@ dbxout_common_check (tree decl, int *value)
rtx sym_addr;
const char *name = NULL;
- /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if
+ /* If the decl isn't a VAR_DECL, or if it isn't static, or if
it does not have a value (the offset into the common area), or if it
is thread local (as opposed to global) then it isn't common, and shouldn't
be handled as such.
@@ -3198,7 +3198,6 @@ dbxout_common_check (tree decl, int *value)
for thread-local symbols. Can be handled via same mechanism as used
in dwarf2out.c. */
if (TREE_CODE (decl) != VAR_DECL
- || !TREE_PUBLIC(decl)
|| !TREE_STATIC(decl)
|| !DECL_HAS_VALUE_EXPR_P(decl)
|| DECL_THREAD_LOCAL_P (decl)
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index cdbc8a19d9d..e9896e311d1 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -4026,10 +4026,6 @@ df_simulate_finalize_forwards (basic_block bb, bitmap live)
propagating the information to BB3's successors.
---------------------------------------------------------------------------*/
-/* Scratch var used by transfer functions. This is used to do md analysis
- only for live registers. */
-static bitmap df_md_scratch;
-
/* Set basic block info. */
static void
@@ -4073,7 +4069,6 @@ df_md_alloc (bitmap all_blocks)
sizeof (struct df_md_bb_info), 50);
df_grow_bb_info (df_md);
- df_md_scratch = BITMAP_ALLOC (NULL);
EXECUTE_IF_SET_IN_BITMAP (all_blocks, 0, bb_index, bi)
{
@@ -4249,10 +4244,8 @@ df_md_local_compute (bitmap all_blocks)
bitmap kill = df_md_get_bb_info (bb_index)->kill;
EXECUTE_IF_SET_IN_BITMAP (frontiers[bb_index], 0, df_bb_index, bi2)
{
- basic_block bb = BASIC_BLOCK (df_bb_index);
if (bitmap_bit_p (all_blocks, df_bb_index))
- bitmap_ior_and_into (df_md_get_bb_info (df_bb_index)->init, kill,
- df_get_live_in (bb));
+ bitmap_ior_into (df_md_get_bb_info (df_bb_index)->init, kill);
}
}
@@ -4282,24 +4275,13 @@ df_md_reset (bitmap all_blocks)
static bool
df_md_transfer_function (int bb_index)
{
- basic_block bb = BASIC_BLOCK (bb_index);
struct df_md_bb_info *bb_info = df_md_get_bb_info (bb_index);
bitmap in = bb_info->in;
bitmap out = bb_info->out;
bitmap gen = bb_info->gen;
bitmap kill = bb_info->kill;
- /* We need to use a scratch set here so that the value returned from
- this function invocation properly reflects if the sets changed in
- a significant way; i.e. not just because the live set was anded
- in. */
- bitmap_and (df_md_scratch, gen, df_get_live_out (bb));
-
- /* Multiple definitions of a register are not relevant if it is not
- used. Thus we trim the result to the places where it is live. */
- bitmap_and_into (in, df_get_live_in (bb));
-
- return bitmap_ior_and_compl (out, df_md_scratch, in, kill);
+ return bitmap_ior_and_compl (out, gen, in, kill);
}
/* Initialize the solution bit vectors for problem. */
@@ -4362,7 +4344,6 @@ df_md_free (void)
}
}
- BITMAP_FREE (df_md_scratch);
free_alloc_pool (df_md->block_pool);
df_md->block_info_size = 0;
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 39fee86ca80..dd3d2c54b4a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -391,7 +391,7 @@ Objective-C and Objective-C++ Dialects}.
-funit-at-a-time -funroll-all-loops -funroll-loops @gol
-funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
-fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
--fwhole-program -fwhopr -fwpa -use-linker-plugin @gol
+-fwhole-program -fwhopr -fwpa -fuse-linker-plugin @gol
--param @var{name}=@var{value}
-fmelt*
-O -O0 -O1 -O2 -O3 -Os}
@@ -878,7 +878,8 @@ See i386 and x86-64 Options.
@emph{i386 and x86-64 Windows Options}
@gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
--mnop-fun-dllimport -mthread -municode -mwin32 -mwindows}
+-mnop-fun-dllimport -mthread -municode -mwin32 -mwindows
+-fno-set-stack-executable}
@emph{Xstormy16 Options}
@gccoptlist{-msim}
@@ -7278,11 +7279,11 @@ If object files containing GIMPLE bytecode are stored in a library
archive, say @file{libfoo.a}, it is possible to extract and use them
in an LTO link if you are using @command{gold} as the linker (which,
in turn requires GCC to be configured with @option{--enable-gold}).
-To enable this feature, use the flag @option{-use-linker-plugin} at
+To enable this feature, use the flag @option{-fuse-linker-plugin} at
link-time:
@smallexample
-gcc -o myprog -O2 -flto -use-linker-plugin a.o b.o -lfoo
+gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
@end smallexample
With the linker plugin enabled, @command{gold} will extract the needed
@@ -7290,7 +7291,7 @@ GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
to make them part of the aggregated GIMPLE image to be optimized.
If you are not using @command{gold} and/or do not specify
-@option{-use-linker-plugin} then the objects inside @file{libfoo.a}
+@option{-fuse-linker-plugin} then the objects inside @file{libfoo.a}
will be extracted and linked as usual, but they will not participate
in the LTO optimization process.
@@ -7375,7 +7376,7 @@ files in LTO mode (via @option{-fwhopr} or @option{-flto}).
Disabled by default.
-@item -use-linker-plugin
+@item -fuse-linker-plugin
Enables the extraction of objects with GIMPLE bytecode information
from library archives. This option relies on features available only
in @command{gold}, so to use this you must configure GCC with
@@ -16709,6 +16710,14 @@ specifies that a GUI application is to be generated by
instructing the linker to set the PE header subsystem type
appropriately.
+@item -fno-set-stack-executable
+@opindex fno-set-stack-executable
+This option is available for MinGW targets. It specifies that
+the executable flag for stack used by nested functions isn't
+set. This is necessary for binaries running in kernel mode of
+Windows, as there the user32 API, which is used to set executable
+privileges, isn't available.
+
@item -mpe-aligned-commons
@opindex mpe-aligned-commons
This option is available for Cygwin and MinGW targets. It
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 8df014dad99..0f33d3d1a8d 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -10842,6 +10842,12 @@ to have to make special provisions in @code{INITIAL_ELIMINATION_OFFSET}
to reserve space for caller-saved target registers.
@end deftypefn
+@deftypefn {Target Hook} bool TARGET_HAVE_CONDITIONAL_EXECUTION (void)
+This target hook returns true if the target supports conditional execution.
+This target hook is required only when the target has several different
+modes and they have different conditional execution capability, such as ARM.
+@end deftypefn
+
@defmac POWI_MAX_MULTS
If defined, this macro is interpreted as a signed integer C expression
that specifies the maximum number of floating point multiplications
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 129ba7de927..732b6a6694b 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -15621,12 +15621,11 @@ fortran_common (tree decl, HOST_WIDE_INT *value)
tree offset;
int volatilep = 0, unsignedp = 0;
- /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if
+ /* If the decl isn't a VAR_DECL, or if it isn't static, or if
it does not have a value (the offset into the common area), or if it
is thread local (as opposed to global) then it isn't common, and shouldn't
be handled as such. */
if (TREE_CODE (decl) != VAR_DECL
- || !TREE_PUBLIC (decl)
|| !TREE_STATIC (decl)
|| !DECL_HAS_VALUE_EXPR_P (decl)
|| !is_fortran ())
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 12370d07333..8a5cf5054e7 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -5498,9 +5498,13 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
|| (! HONOR_NANS (mode) && (code == LTGT || code == UNEQ))
|| (! HONOR_SNANS (mode) && (code == EQ || code == NE))))
{
+ int want_add = ((STORE_FLAG_VALUE == 1 && normalizep == -1)
+ || (STORE_FLAG_VALUE == -1 && normalizep == 1));
+
/* For the reverse comparison, use either an addition or a XOR. */
- if ((STORE_FLAG_VALUE == 1 && normalizep == -1)
- || (STORE_FLAG_VALUE == -1 && normalizep == 1))
+ if (want_add
+ && rtx_cost (GEN_INT (normalizep), PLUS,
+ optimize_insn_for_speed_p ()) == 0)
{
tem = emit_store_flag_1 (subtarget, rcode, op0, op1, mode, 0,
STORE_FLAG_VALUE, target_mode);
@@ -5509,7 +5513,9 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
GEN_INT (normalizep),
target, 0, OPTAB_WIDEN);
}
- else
+ else if (!want_add
+ && rtx_cost (trueval, XOR,
+ optimize_insn_for_speed_p ()) == 0)
{
tem = emit_store_flag_1 (subtarget, rcode, op0, op1, mode, 0,
normalizep, target_mode);
@@ -5596,9 +5602,13 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
&& GET_MODE_SIZE (mode) < UNITS_PER_WORD
&& op1 == const0_rtx))
{
+ int want_add = ((STORE_FLAG_VALUE == 1 && normalizep == -1)
+ || (STORE_FLAG_VALUE == -1 && normalizep == 1));
+
/* Again, for the reverse comparison, use either an addition or a XOR. */
- if ((STORE_FLAG_VALUE == 1 && normalizep == -1)
- || (STORE_FLAG_VALUE == -1 && normalizep == 1))
+ if (want_add
+ && rtx_cost (GEN_INT (normalizep), PLUS,
+ optimize_insn_for_speed_p ()) == 0)
{
tem = emit_store_flag_1 (subtarget, rcode, op0, op1, mode, 0,
STORE_FLAG_VALUE, target_mode);
@@ -5606,7 +5616,9 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
tem = expand_binop (target_mode, add_optab, tem,
GEN_INT (normalizep), target, 0, OPTAB_WIDEN);
}
- else
+ else if (!want_add
+ && rtx_cost (trueval, XOR,
+ optimize_insn_for_speed_p ()) == 0)
{
tem = emit_store_flag_1 (subtarget, rcode, op0, op1, mode, 0,
normalizep, target_mode);
diff --git a/gcc/final.c b/gcc/final.c
index b8f5e513817..ef450d2fe3e 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -204,10 +204,8 @@ rtx final_sequence;
static int dialect_number;
#endif
-#ifdef HAVE_conditional_execution
/* Nonnull if the insn currently being emitted was a COND_EXEC pattern. */
rtx current_insn_predicate;
-#endif
#ifdef HAVE_ATTR_length
static int asm_insn_count (rtx);
@@ -2102,10 +2100,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
const char *templ;
bool is_stmt;
-#ifdef HAVE_conditional_execution
/* Reset this early so it is correct for ASM statements. */
current_insn_predicate = NULL_RTX;
-#endif
+
/* An INSN, JUMP_INSN or CALL_INSN.
First check for special kinds that recog doesn't recognize. */
@@ -2590,10 +2587,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
FINAL_PRESCAN_INSN (insn, recog_data.operand, recog_data.n_operands);
#endif
-#ifdef HAVE_conditional_execution
- if (GET_CODE (PATTERN (insn)) == COND_EXEC)
+ if (targetm.have_conditional_execution ()
+ && GET_CODE (PATTERN (insn)) == COND_EXEC)
current_insn_predicate = COND_EXEC_TEST (PATTERN (insn));
-#endif
#ifdef HAVE_cc0
cc_prev_status = cc_status;
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 102929d1e20..3403938edc3 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -10147,7 +10147,6 @@ fold_binary_loc (location_t loc,
tem = fold_build2_loc (loc, code, type,
fold_convert_loc (loc, TREE_TYPE (op0),
TREE_OPERAND (arg0, 1)), op1);
- protected_set_expr_location (tem, loc);
tem = build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0), tem);
goto fold_binary_exit;
}
@@ -10157,7 +10156,6 @@ fold_binary_loc (location_t loc,
tem = fold_build2_loc (loc, code, type, op0,
fold_convert_loc (loc, TREE_TYPE (op1),
TREE_OPERAND (arg1, 1)));
- protected_set_expr_location (tem, loc);
tem = build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0), tem);
goto fold_binary_exit;
}
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8c333d8ca18..68747bcb52e 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-29 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/41860
+ * resolve.c (apply_default_init_local): Treat -fno-automatic as if
+ var was saved.
+
+2009-10-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * trans-common.c (create_common): Set TREE_PUBLIC to false on
+ fake variables.
+
2009-10-26 Janus Weil <janus@gcc.gnu.org>
PR fortran/41714
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index b17e8fef182..5a5fcccc1f8 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -8630,7 +8630,8 @@ apply_default_init_local (gfc_symbol *sym)
/* For saved variables, we don't want to add an initializer at
function entry, so we just add a static initializer. */
- if (sym->attr.save || sym->ns->save_all)
+ if (sym->attr.save || sym->ns->save_all
+ || gfc_option.flag_max_stack_var_size == 0)
{
/* Don't clobber an existing initializer! */
gcc_assert (sym->value == NULL);
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index 5b1952aee4a..1fb3c40f113 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
var_decl = build_decl (s->sym->declared_at.lb->location,
VAR_DECL, DECL_NAME (s->field),
TREE_TYPE (s->field));
- TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl);
TREE_STATIC (var_decl) = TREE_STATIC (decl);
TREE_USED (var_decl) = TREE_USED (decl);
if (s->sym->attr.use_assoc)
@@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
TREE_ADDRESSABLE (var_decl) = 1;
/* This is a fake variable just for debugging purposes. */
TREE_ASM_WRITTEN (var_decl) = 1;
-
+ /* Fake variables are not visible from other translation units. */
+ TREE_PUBLIC (var_decl) = 0;
+
/* To preserve identifier names in COMMON, chain to procedure
scope unless at top level in a module definition. */
if (com
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 78e0ce8d87e..b033d62ff13 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -770,7 +770,7 @@ proper position among the other output files. */
#define LINK_COMMAND_SPEC "\
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%(linker) \
- %{use-linker-plugin: \
+ %{fuse-linker-plugin: \
-plugin %(linker_plugin_file) \
-plugin-opt=%(lto_wrapper) \
-plugin-opt=%(lto_gcc) \
@@ -7513,7 +7513,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
if (num_linker_inputs > 0 && error_count == 0 && print_subprocess_help < 2)
{
int tmp = execution_count;
- const char *use_linker_plugin = "use-linker-plugin";
+ const char *fuse_linker_plugin = "fuse-linker-plugin";
/* We'll use ld if we can't find collect2. */
if (! strcmp (linker_name_spec, "collect2"))
@@ -7523,14 +7523,14 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
linker_name_spec = "ld";
}
- if (switch_matches (use_linker_plugin,
- use_linker_plugin + strlen (use_linker_plugin), 0))
+ if (switch_matches (fuse_linker_plugin,
+ fuse_linker_plugin + strlen (fuse_linker_plugin), 0))
{
linker_plugin_file_spec = find_a_file (&exec_prefixes,
"liblto_plugin.so", X_OK,
false);
if (!linker_plugin_file_spec)
- fatal ("-use-linker-plugin, but liblto_plugin.so not found");
+ fatal ("-fuse-linker-plugin, but liblto_plugin.so not found");
lto_libgcc_spec = find_a_file (&startfile_prefixes, "libgcc.a",
R_OK, true);
diff --git a/gcc/gimple.c b/gcc/gimple.c
index f725a347bac..676e3fd4678 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3198,7 +3198,8 @@ gimple_types_compatible_p (tree t1, tree t2)
|| SCALAR_FLOAT_TYPE_P (t1)
|| FIXED_POINT_TYPE_P (t1)
|| TREE_CODE (t1) == VECTOR_TYPE
- || TREE_CODE (t1) == COMPLEX_TYPE)
+ || TREE_CODE (t1) == COMPLEX_TYPE
+ || TREE_CODE (t1) == OFFSET_TYPE)
{
/* Can't be the same type if they have different alignment,
sign, precision or mode. */
@@ -3343,6 +3344,16 @@ gimple_types_compatible_p (tree t1, tree t2)
}
}
+ case OFFSET_TYPE:
+ {
+ if (!gimple_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2))
+ || !gimple_types_compatible_p (TYPE_OFFSET_BASETYPE (t1),
+ TYPE_OFFSET_BASETYPE (t2)))
+ goto different_types;
+
+ goto same_types;
+ }
+
case POINTER_TYPE:
case REFERENCE_TYPE:
{
@@ -3357,7 +3368,8 @@ gimple_types_compatible_p (tree t1, tree t2)
&& RECORD_OR_UNION_TYPE_P (TREE_TYPE (t1))
&& (!COMPLETE_TYPE_P (TREE_TYPE (t1))
|| !COMPLETE_TYPE_P (TREE_TYPE (t2)))
- && compare_type_names_p (TREE_TYPE (t1), TREE_TYPE (t2), true))
+ && compare_type_names_p (TYPE_MAIN_VARIANT (TREE_TYPE (t1)),
+ TYPE_MAIN_VARIANT (TREE_TYPE (t2)), true))
{
/* Replace the pointed-to incomplete type with the
complete one. */
@@ -4120,7 +4132,6 @@ gimple_signed_type (tree type)
alias_set_type
gimple_get_alias_set (tree t)
{
- static bool recursing_p;
tree u;
/* Permit type-punning when accessing a union, provided the access
@@ -4160,15 +4171,9 @@ gimple_get_alias_set (tree t)
}
else if (POINTER_TYPE_P (t))
{
- tree t1;
+ /* From the common C and C++ langhook implementation:
- /* ??? We can end up creating cycles with TYPE_MAIN_VARIANT
- and TYPE_CANONICAL. Avoid recursing endlessly between
- this langhook and get_alias_set. */
- if (recursing_p)
- return -1;
-
- /* Unfortunately, there is no canonical form of a pointer type.
+ Unfortunately, there is no canonical form of a pointer type.
In particular, if we have `typedef int I', then `int *', and
`I *' are different types. So, we have to pick a canonical
representative. We do this below.
@@ -4190,15 +4195,36 @@ gimple_get_alias_set (tree t)
can dereference IPP and CIPP. So, we ignore cv-qualifiers on
the pointed-to types. This issue has been reported to the
C++ committee. */
- t1 = build_type_no_quals (t);
- if (t1 != t)
- {
- alias_set_type set;
- recursing_p = true;
- set = get_alias_set (t1);
- recursing_p = false;
- return set;
- }
+
+ /* In addition to the above canonicalization issue with LTO
+ we should also canonicalize `T (*)[]' to `T *' avoiding
+ alias issues with pointer-to element types and pointer-to
+ array types.
+
+ Likewise we need to deal with the situation of incomplete
+ pointed-to types and make `*(struct X **)&a' and
+ `*(struct X {} **)&a' alias. Otherwise we will have to
+ guarantee that all pointer-to incomplete type variants
+ will be replaced by pointer-to complete type variants if
+ they are available.
+
+ With LTO the convenient situation of using `void *' to
+ access and store any pointer type will also become
+ more apparent (and `void *' is just another pointer-to
+ incomplete type). Assigning alias-set zero to `void *'
+ and all pointer-to incomplete types is a not appealing
+ solution. Assigning an effective alias-set zero only
+ affecting pointers might be - by recording proper subset
+ relationships of all pointer alias-sets.
+
+ Pointer-to function types are another grey area which
+ needs caution. Globbing them all into one alias-set
+ or the above effective zero set would work. */
+
+ /* For now just assign the same alias-set to all pointers.
+ That's simple and avoids all the above problems. */
+ if (t != ptr_type_node)
+ return get_alias_set (ptr_type_node);
}
return -1;
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index d8d15a59be1..4417e6e6b87 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -47,9 +47,6 @@
#include "vecprim.h"
#include "dbgcnt.h"
-#ifndef HAVE_conditional_execution
-#define HAVE_conditional_execution 0
-#endif
#ifndef HAVE_conditional_move
#define HAVE_conditional_move 0
#endif
@@ -2426,7 +2423,7 @@ noce_process_if_block (struct noce_if_info *if_info)
if (HAVE_conditional_move
&& noce_try_cmove (if_info))
goto success;
- if (! HAVE_conditional_execution)
+ if (! targetm.have_conditional_execution ())
{
if (noce_try_store_flag_constants (if_info))
goto success;
@@ -3070,7 +3067,7 @@ find_if_header (basic_block test_bb, int pass)
&& noce_find_if_block (test_bb, then_edge, else_edge, pass))
goto success;
- if (HAVE_conditional_execution && reload_completed
+ if (targetm.have_conditional_execution () && reload_completed
&& cond_exec_find_if_block (&ce_info))
goto success;
@@ -3080,7 +3077,7 @@ find_if_header (basic_block test_bb, int pass)
goto success;
if (dom_info_state (CDI_POST_DOMINATORS) >= DOM_NO_FAST_QUERY
- && (! HAVE_conditional_execution || reload_completed))
+ && (! targetm.have_conditional_execution () || reload_completed))
{
if (find_if_case_1 (test_bb, then_edge, else_edge))
goto success;
@@ -3187,7 +3184,7 @@ cond_exec_find_if_block (struct ce_if_block * ce_info)
/* We only ever should get here after reload,
and only if we have conditional execution. */
- gcc_assert (HAVE_conditional_execution && reload_completed);
+ gcc_assert (targetm.have_conditional_execution () && reload_completed);
/* Discover if any fall through predecessors of the current test basic block
were && tests (which jump to the else block) or || tests (which jump to
@@ -3865,7 +3862,7 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
/* Disable handling dead code by conditional execution if the machine needs
to do anything funny with the tests, etc. */
#ifndef IFCVT_MODIFY_TESTS
- if (HAVE_conditional_execution)
+ if (targetm.have_conditional_execution ())
{
/* In the conditional execution case, we have things easy. We know
the condition is reversible. We don't have to check life info
diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c
index bc84eee372b..7b05bf64c0d 100644
--- a/gcc/ipa-struct-reorg.c
+++ b/gcc/ipa-struct-reorg.c
@@ -258,15 +258,21 @@ find_field_in_struct_1 (tree str_type, tree field)
{
tree str_field;
+ if (!DECL_NAME (field))
+ return NULL;
+
for (str_field = TYPE_FIELDS (str_type); str_field;
str_field = TREE_CHAIN (str_field))
{
- const char * str_field_name;
- const char * field_name;
+ const char *str_field_name;
+ const char *field_name;
+
+ if (!DECL_NAME (str_field))
+ continue;
str_field_name = IDENTIFIER_POINTER (DECL_NAME (str_field));
field_name = IDENTIFIER_POINTER (DECL_NAME (field));
-
+
gcc_assert (str_field_name);
gcc_assert (field_name);
@@ -274,7 +280,7 @@ find_field_in_struct_1 (tree str_type, tree field)
{
/* Check field types. */
if (is_equal_types (TREE_TYPE (str_field), TREE_TYPE (field)))
- return str_field;
+ return str_field;
}
}
diff --git a/gcc/opts.c b/gcc/opts.c
index 51a0cb95419..72411b662cc 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2102,6 +2102,10 @@ common_handle_option (size_t scode, const char *arg, int value,
/* These are no-ops, preserved for backward compatibility. */
break;
+ case OPT_fuse_linker_plugin:
+ /* No-op. Used by the driver and passed to us because it starts with f.*/
+ break;
+
default:
/* If the flag was handled in a standard way, assume the lack of
processing here is intentional. */
diff --git a/gcc/recog.c b/gcc/recog.c
index b03324146f1..4ad3be9dfaf 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -3279,40 +3279,44 @@ peephole2_optimize (void)
do_cleanup_cfg |= purge_dead_edges (bb);
}
-#ifdef HAVE_conditional_execution
- for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
- peep2_insn_data[i].insn = NULL_RTX;
- peep2_insn_data[peep2_current].insn = PEEP2_EOB;
- peep2_current_count = 0;
-#else
- /* Back up lifetime information past the end of the
- newly created sequence. */
- if (++i >= MAX_INSNS_PER_PEEP2 + 1)
- i = 0;
- bitmap_copy (live, peep2_insn_data[i].live_before);
-
- /* Update life information for the new sequence. */
- x = attempt;
- do
+ if (targetm.have_conditional_execution ())
{
- if (INSN_P (x))
+ for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
+ peep2_insn_data[i].insn = NULL_RTX;
+ peep2_insn_data[peep2_current].insn = PEEP2_EOB;
+ peep2_current_count = 0;
+ }
+ else
+ {
+ /* Back up lifetime information past the end of the
+ newly created sequence. */
+ if (++i >= MAX_INSNS_PER_PEEP2 + 1)
+ i = 0;
+ bitmap_copy (live, peep2_insn_data[i].live_before);
+
+ /* Update life information for the new sequence. */
+ x = attempt;
+ do
{
- if (--i < 0)
- i = MAX_INSNS_PER_PEEP2;
- if (peep2_current_count < MAX_INSNS_PER_PEEP2
- && peep2_insn_data[i].insn == NULL_RTX)
- peep2_current_count++;
- peep2_insn_data[i].insn = x;
- df_insn_rescan (x);
- df_simulate_one_insn_backwards (bb, x, live);
- bitmap_copy (peep2_insn_data[i].live_before, live);
+ if (INSN_P (x))
+ {
+ if (--i < 0)
+ i = MAX_INSNS_PER_PEEP2;
+ if (peep2_current_count < MAX_INSNS_PER_PEEP2
+ && peep2_insn_data[i].insn == NULL_RTX)
+ peep2_current_count++;
+ peep2_insn_data[i].insn = x;
+ df_insn_rescan (x);
+ df_simulate_one_insn_backwards (bb, x, live);
+ bitmap_copy (peep2_insn_data[i].live_before,
+ live);
+ }
+ x = PREV_INSN (x);
}
- x = PREV_INSN (x);
- }
- while (x != prev);
+ while (x != prev);
- peep2_current = i;
-#endif
+ peep2_current = i;
+ }
/* If we generated a jump instruction, it won't have
JUMP_LABEL set. Recompute after we're done. */
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index de2dd0acd1d..0acdc4a2a47 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -2508,7 +2508,9 @@ add_branch_dependences (rtx head, rtx tail)
add_dependence (last, insn, REG_DEP_ANTI);
}
-#ifdef HAVE_conditional_execution
+ if (!targetm.have_conditional_execution ())
+ return;
+
/* Finally, if the block ends in a jump, and we are doing intra-block
scheduling, make sure that the branch depends on any COND_EXEC insns
inside the block to avoid moving the COND_EXECs past the branch insn.
@@ -2557,7 +2559,6 @@ add_branch_dependences (rtx head, rtx tail)
if (INSN_P (insn) && GET_CODE (PATTERN (insn)) == COND_EXEC)
add_dependence (tail, insn, REG_DEP_ANTI);
}
-#endif
}
/* Data structures for the computation of data dependences in a regions. We
@@ -3588,4 +3589,3 @@ struct rtl_opt_pass pass_sched2 =
TODO_ggc_collect /* todo_flags_finish */
}
};
-
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 547a5fb89f8..c5a73216780 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -534,6 +534,7 @@
#define TARGET_BRANCH_TARGET_REGISTER_CLASS \
default_branch_target_register_class
#define TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED hook_bool_bool_false
+#define TARGET_HAVE_CONDITIONAL_EXECUTION default_have_conditional_execution
#define TARGET_CANNOT_FORCE_CONST_MEM hook_bool_rtx_false
#define TARGET_CANNOT_COPY_INSN_P NULL
#define TARGET_COMMUTATIVE_P hook_bool_const_rtx_commutative_p
@@ -934,6 +935,7 @@
TARGET_CANNOT_MODIFY_JUMPS_P, \
TARGET_BRANCH_TARGET_REGISTER_CLASS, \
TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED, \
+ TARGET_HAVE_CONDITIONAL_EXECUTION, \
TARGET_CANNOT_FORCE_CONST_MEM, \
TARGET_CANNOT_COPY_INSN_P, \
TARGET_COMMUTATIVE_P, \
diff --git a/gcc/target.h b/gcc/target.h
index a243bcd3bfb..31a54f321df 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -621,6 +621,9 @@ struct gcc_target
already been generated. */
bool (* branch_target_register_callee_saved) (bool after_pe_gen);
+ /* Return true if the target supports conditional execution. */
+ bool (* have_conditional_execution) (void);
+
/* True if the constant X cannot be placed in the constant pool. */
bool (* cannot_force_const_mem) (rtx);
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 35ed9eed4a6..dfc470c869e 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -998,4 +998,14 @@ unsigned int default_case_values_threshold (void)
return (HAVE_casesi ? 4 : 5);
}
+bool
+default_have_conditional_execution (void)
+{
+#ifdef HAVE_conditional_execution
+ return HAVE_conditional_execution;
+#else
+ return false;
+#endif
+}
+
#include "gt-targhooks.h"
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index cbbbee89d2e..365496b9825 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -131,3 +131,4 @@ extern rtx default_addr_space_legitimize_address (rtx, rtx, enum machine_mode,
extern bool default_addr_space_subset_p (addr_space_t, addr_space_t);
extern rtx default_addr_space_convert (rtx, tree, tree);
extern unsigned int default_case_values_threshold (void);
+extern bool default_have_conditional_execution (void);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9673d28c227..b1568461dc5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,136 @@
+2009-10-28 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/inline-ns1.C: New.
+ * g++.dg/cpp0x/inline-ns2.C: New.
+ * g++.dg/cpp0x/inline-ns3.C: New.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/39715
+ * gcc.target/arm/thumb-ltu.c: New.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ PR lto/41808
+ PR lto/41839
+ * gcc.dg/lto/20091027-1_0.c: New testcase.
+ * gcc.dg/lto/20091027-1_1.c: Likewise.
+ * g++.dg/lto/20091026-1_0.C: Likewise.
+ * g++.dg/lto/20091026-1_1.C: Likewise.
+ * g++.dg/lto/20091026-1_a.h: Likewise.
+
+2009-10-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/41837
+ * gcc.dg/pr41837.c: New test.
+
+ PR debug/41801
+ * g++.dg/ext/sync-3.C: New test.
+
+ PR target/41762
+ * gcc.dg/pr41762.c: New test.
+
+2009-10-28 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/41855
+ * gfortran.dg/lto/20091028-1_0.f90: New testcase.
+ * gfortran.dg/lto/20091028-1_1.c: Likewise.
+ * gfortran.dg/lto/20091028-2_0.f90: Likewise.
+ * gfortran.dg/lto/20091028-2_1.c: Likewise.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/39715
+ * gcc.target/arm/thumb-bitfld1.c: New.
+
+2009-10-28 Paolo Bonzini <bonzini@gnu.org>
+
+ PR rtl-optimization/40741
+ * gcc.target/arm/thumb-branch1.c: New.
+
+2009-10-27 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/lambda/lambda-conv.C: New.
+ * g++.dg/cpp0x/lambda/lambda-const-neg.C: Adjust.
+ * g++.dg/cpp0x/lambda/lambda-mangle.C: Adjust.
+ * g++.dg/cpp0x/lambda/lambda-non-const.C: Adjust.
+
+2009-10-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/null_pointer_deref1.adb: Accept Constraint_Error.
+ * gnat.dg/null_pointer_deref2.adb: Likewise.
+
+2009-10-27 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/torture/ipa-pta-1.c: Adjust testcase.
+
+2009-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/41842
+ * gcc.dg/pr41842.c: New test.
+
+2009-10-27 Revital Eres <eres@il.ibm.com>
+
+ PR tree-optimization/40648
+ * gcc.target/powerpc/vsx-vectorize-2.c: Adjust testcase following
+ change in decision of peeling for alignment.
+ * gcc.target/powerpc/vsx-vectorize-3.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-4.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-5.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-6.c: Likewise.
+ * gcc.target/powerpc/vsx-vectorize-7.c: Likewise.
+ * gcc.dg/vect/vect-50.c: Likewise.
+ * gcc.dg/vect/vect-33.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-69.c: Likewise.
+ * gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c:
+ Likewise.
+ * gcc.dg/vect/costmodel/i386/costmodel-vect-31.c: Likewise.
+ * gcc.dg/vect/costmodel/i386/costmodel-vect-33.c: Likewise.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c:
+ Likewise.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c: Likewise.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-6.c: Likewise.
+ * gcc.dg/vect/vect-60.c: Likewise.
+ * gcc.dg/vect/vect-26.c: Likewise.
+ * gcc.dg/vect/vect-52.c: Likewise.
+ * gcc.dg/vect/vect-44.c: Likewise.
+ * gcc.dg/vect/vect-27.c: Likewise.
+ * gcc.dg/vect/vect-70.c: Likewise.
+ * gcc.dg/vect/vect-28.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-31.c: Likewise.
+ * gcc.dg/vect/vect-109.c: Likewise.
+ * gcc.dg/vect/vect-54.c: Likewise.
+ * gcc.dg/vect/vect-29.c: Likewise.
+ * gcc.dg/vect/vect-72.c: Likewise.
+ * gcc.dg/vect/vect-56.c: Likewise.
+ * gcc.dg/vect/vect-48.c: Likewise.
+ * gcc.dg/vect/vect-91.c: Likewise.
+ * gcc.dg/vect/vect-92.c: Likewise.
+ * gcc.dg/vect/vect-58.c: Likewise.
+ * gcc.dg/vect/slp-25.c: Likewise.
+ * gcc.dg/vect/vect-93.c: Likewise.
+ * gcc.dg/vect/vect-95.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-64.c: Likewise.
+ * gcc.dg/vect/vect-87.c: Likewise.
+ * gcc.dg/vect/vect-96.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-1.c: Likewise.
+ * gcc.dg/vect/vect-88.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-66.c: Likewise.
+ * gcc.dg/vect/vect-89.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-3.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-68.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-4.c: Likewise.
+ * gfortran.dg/vect/vect-2.f90: Likewise.
+ * gfortran.dg/vect/vect-3.f90: Likewise.
+ * gfortran.dg/vect/vect-4.f90: Likewise.
+ * gfortran.dg/vect/vect-5.f90: Likewise.
+
+2009-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/41020
+ * g++.dg/lookup/extern-c-redecl5.C: Fix up regexp.
+
2009-10-26 Ben Elliston <bje@au.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com>
Ulrich Weigand <uweigand@de.ibm.com>
@@ -52,7 +185,7 @@
* gcc.target/rx/i272091.c: New test file.
* gcc.target/rx/packed-struct.c: New test file.
* gcc.target/rx/rx.exp: New file: Drives RX tests.
-
+
2009-10-26 Andrew Pinski <pinskia@gcc.gnu.org>
* gcc.dg/lto/20091014-1_0.c: Replace -shared with -r -nostlib.
@@ -182,6 +315,20 @@
PR lto/41730
* g++.dg/lto/20091022-1_0.C: New testcase.
+2009-10-22 Razya Ladelsky <razya@il.ibm.com>
+
+ * gcc.dg/autopar/outer-4.c: Adjust scan.
+ * gcc.dg/autopar/outer-5.c: Adjust scan.
+ * gcc.dg/autopar/outer-5.c: Add scan optimized.
+
+ * libgomp.graphite/force-parallel-2.c: Adjust scan.
+ * gcc.dg/autopar/outer-1.c: New testcase.
+ * gcc.dg/autopar/outer-2.c: New testcase.
+ * gcc.dg/autopar/outer-3.c: New testcase.
+ * gcc.dg/autopar/outer-4.c: New testcase.
+ * gcc.dg/autopar/outer-5.c: New testcase.
+ * gcc.dg/autopar/outer-6.c: New testcase.
+
2009-10-22 Jan Hubicka <jh@suse.cz>
* gcc.c-torture/compile/pr40556.c: New testcase.
@@ -626,7 +773,7 @@
PR libgfortran/38439
* gfortran.dg/fmt_error_9.f: New test.
* gfortran.dg/fmt_error_10.f: New test.
-
+
2009-10-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/41583
@@ -3169,6 +3316,11 @@
2009-08-06 Richard Earnshaw <rearnsha@arm.com>
+ * lib/target-supports.exp (check_effective_target_arm_hard_vfp_ok): New
+ hook.
+ (check_effective_target_arm_neon_ok): Improve test for neon
+ availability.
+ * gcc.target/arm/eabi1.c: Only run test in base variant.
* gcc.target/arm/abitest.h: Allow the test function to have a PCS
attribute.
* gcc.target/arm/vfp1[567].c: New tests.
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C
index f48c6c243d6..0e329e5e161 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C
@@ -3,11 +3,11 @@
#include <cassert>
template<typename F>
-void call(const F& f) { f(); } // { dg-error "discards qualifiers" }
+void call(const F& f) { f(); }
int main() {
call([] () -> void {});
- call([] () mutable -> void {}); // { dg-message "" "`f' does not have const `operator()'" }
+ call([] () mutable -> void {}); // { dg-message "" "declared mutable" }
int i = -1;
call([&i] () -> void { i = 0; });
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
index 9f7d5f3b2a9..aa7462b4fcf 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
@@ -9,8 +9,8 @@ inline void g(int n) {
// The closure type is encoded as Z1giEUlvE_.
// The call operator of that type is _ZZ1giENKUlvE_clEv.
-// { dg-final { scan-assembler "_ZZ1giENKUlvE_clEv" } }
-// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZ1giENKUlvE_clEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin } } } } }
+// { dg-final { scan-assembler "_ZZ1giENUlvE_clEv" } }
+// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZ1giENUlvE_clEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin } } } } }
algo([=]{return n+bef();});
// The captured entities do not participate in <lambda-sig>
@@ -31,17 +31,17 @@ struct S {
void f(int =
// Type: ZN1S1fEiiEd0_UlvE_
// Operator: _ZZN1S1fEiiEd0_NKUlvE_clEv
-// { dg-final { scan-assembler "_ZZN1S1fEiiEd0_NKUlvE_clEv" } }
-// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZN1S1fEiiEd0_NKUlvE_clEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin } } } } }
+// { dg-final { scan-assembler "_ZZN1S1fEiiEd0_NUlvE_clEv" } }
+// { dg-final { scan-assembler "weak\[ \t\]*_?_ZZN1S1fEiiEd0_NUlvE_clEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin } } } } }
[]{return 1;}()
// Type: ZN1S1fEiiEd0_UlvE0_
// Operator: _ZZN1S1fEiiEd0_NKUlvE0_clEv
-// { dg-final { scan-assembler "_ZZN1S1fEiiEd0_NKUlvE0_clEv" } }
+// { dg-final { scan-assembler "_ZZN1S1fEiiEd0_NUlvE0_clEv" } }
+ []{return 2;}(),
int =
// Type: ZN1S1fEiiEd_UlvE_
// Operator: _ZZN1S1fEiiEd_NKUlvE_clEv
-// { dg-final { scan-assembler "_ZZN1S1fEiiEd_NKUlvE_clEv" } }
+// { dg-final { scan-assembler "_ZZN1S1fEiiEd_NUlvE_clEv" } }
[]{return 3;}());
};
@@ -52,8 +52,8 @@ template<typename T> int R<T>::x = []{return 1;}();
template int R<int>::x;
// Type of lambda in intializer of R<int>::x: N1RIiE1xMUlvE_E
// Corresponding operator(): _ZNK1RIiE1xMUlvE_clEv
-// { dg-final { scan-assembler "_ZNK1RIiE1xMUlvE_clEv" } }
-// { dg-final { scan-assembler "weak\[ \t\]*_?_ZNK1RIiE1xMUlvE_clEv" { target { ! { *-*-mingw* *-*-cygwin } } } } }
+// { dg-final { scan-assembler "_ZN1RIiE1xMUlvE_clEv" } }
+// { dg-final { scan-assembler "weak\[ \t\]*_?_ZN1RIiE1xMUlvE_clEv" { target { ! { *-*-mingw* *-*-cygwin } } } } }
void bar()
{
@@ -63,7 +63,7 @@ void bar()
}
// lambdas used in non-template, non-class body initializers are internal.
-// { dg-final { scan-assembler-not "weak\[^\n\r\]*_ZNKUlv" } }
+// { dg-final { scan-assembler-not "weak\[^\n\r\]*_ZNUlv" } }
// { dg-final { scan-assembler-not "weak\[^\n\r\]*variable" } }
int variable = []{return 1;}();
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C
index 9c2b1195af3..9ff8c029d5c 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C
@@ -8,7 +8,6 @@ void call(F f) { f(); }
int main() {
call([] () -> void {});
- call([] () mutable -> void {});
int i = -1;
call([i] () mutable -> void { i = 0; });
diff --git a/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C b/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C
index 031059f7657..51a342d433c 100644
--- a/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C
+++ b/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C
@@ -6,7 +6,7 @@
class frok
{
int this_errno;
- friend int fork (void); // { dg-error "previous declaration .*?C++. linkage" }
+ friend int fork (void); // { dg-error "previous declaration .*?C\\+\\+. linkage" }
};
extern "C" int
diff --git a/gcc/testsuite/g++.dg/lookup/using16.C b/gcc/testsuite/g++.dg/lookup/using16.C
index ff6a80ee93f..a396afb973c 100644
--- a/gcc/testsuite/g++.dg/lookup/using16.C
+++ b/gcc/testsuite/g++.dg/lookup/using16.C
@@ -3,7 +3,7 @@
// { dg-do compile }
namespace M {
- struct S {}; // { dg-error "candidates are: struct M::S" "candidate 1" }
+ struct S {}; // { dg-error "struct M::S" "candidate 1" }
}
namespace N {
diff --git a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
index 10963973c3b..7df130a1f5b 100644
--- a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
+++ b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
@@ -4,31 +4,37 @@
struct X { char x; char y; };
-void bar (char *p);
+char *q;
-void test1 (char a, char b, char c, char d, char e, char f, char g, char h)
+static void __attribute__((noinline))
+bar (char *p)
{
- char *p = &a;
+ q = p;
+}
+
+void test1 (char a1, char b, char c, char d, char e, char f, char g, char h)
+{
+ char *p = &a1;
p++;
bar (p);
}
-void test2 (struct X a, char b, char c, char d, char e, char f, char g, char h)
+void test2 (struct X a2, char b, char c, char d, char e, char f, char g, char h)
{
- char *p = &a.x;
+ char *p = &a2.x;
p++;
bar (p);
}
-void test3 (struct X a, char b, char c, char d, char e, char f, char g, char h)
+void test3 (struct X a3, char b, char c, char d, char e, char f, char g, char h)
{
- char *p = &a.y;
+ char *p = &a3.y;
bar (p);
}
-void test4 (int a, char b, char c, char d, char e, char f, char g, char h)
+void test4 (int a4, char b, char c, char d, char e, char f, char g, char h)
{
- char *p = (char *)&a;
+ char *p = (char *)&a4;
p++;
p++;
p++;
@@ -36,5 +42,5 @@ void test4 (int a, char b, char c, char d, char e, char f, char g, char h)
bar (p);
}
-/* { dg-final { scan-ipa-dump "bar.arg0 = { test4.arg0 test3.arg0 test2.arg0 test1.arg0 }" "pta" } } */
+/* { dg-final { scan-ipa-dump "bar.arg0 = { a4 a3 a2 a1 }" "pta" } } */
/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
index 5627c265523..ffbd220c38b 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
@@ -35,6 +35,6 @@ int main()
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_hw_misalign } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
index da7b7c3b3f8..b109be23250 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
@@ -86,8 +86,6 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } }
- */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
index 8a14ededc25..5676b247069 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
@@ -36,5 +36,5 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c
index 5627c265523..a2ad28b14d8 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c
@@ -35,6 +35,6 @@ int main()
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_hw_misalign } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
index 4490cdc2182..b109be23250 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
@@ -86,7 +86,6 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target {! vect_hw_misalign} } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target {vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
index 8a14ededc25..5676b247069 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
@@ -36,5 +36,5 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
index 6060a418a3d..21b87a39677 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
@@ -87,7 +87,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
index 2b6f99787c1..1ce3fa7f23b 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
@@ -83,7 +83,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
index 78419fae851..49a9098f79f 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
@@ -78,7 +78,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
index 19bd4f12d05..de036e88ebf 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
@@ -87,7 +87,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
index 5f0aeaa9df1..cc4f26fa6c5 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
@@ -113,9 +113,8 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { {! vector_alignment_reachable} || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vector_alignment_reachable} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-25.c b/gcc/testsuite/gcc.dg/vect/slp-25.c
index d10720e7d84..b660508a79c 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-25.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-25.c
@@ -55,7 +55,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-109.c b/gcc/testsuite/gcc.dg/vect/vect-109.c
index 173b8c06970..dd9f8ea77a3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-109.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-109.c
@@ -74,6 +74,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" } } */
/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 2 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 10 "vect" { target vect_hw_misalign } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-26.c b/gcc/testsuite/gcc.dg/vect/vect-26.c
index 268ed05061f..bec111b69cf 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-26.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-26.c
@@ -35,7 +35,7 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail {! vect_hw_misalign} } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-27.c b/gcc/testsuite/gcc.dg/vect/vect-27.c
index 4a2da227e3c..e117196c1f5 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-27.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-27.c
@@ -46,5 +46,5 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail {! vect_hw_misalign} } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-28.c b/gcc/testsuite/gcc.dg/vect/vect-28.c
index ddf1ee3b0ed..794a7c8f438 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-28.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-28.c
@@ -39,7 +39,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! { vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable && { ! { vect_hw_misalign } } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-29.c b/gcc/testsuite/gcc.dg/vect/vect-29.c
index 0ad28488056..1645a2dfcca 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-29.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-29.c
@@ -51,6 +51,6 @@ int main (void)
/* The initialization induction loop (with aligned access) is also vectorized. */
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail vect_hw_misalign } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" {target vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-33.c b/gcc/testsuite/gcc.dg/vect/vect-33.c
index 9ee4aecb2ea..d35bce4d6f6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-33.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-33.c
@@ -38,7 +38,7 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! { vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target vector_alignment_reachable } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-44.c b/gcc/testsuite/gcc.dg/vect/vect-44.c
index 89d09b36535..5f2228fdd71 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-44.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-44.c
@@ -65,9 +65,8 @@ int main (void)
two loads to be aligned). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! {vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || {! vect_hw_misalign } } || {! vector_alignment_reachable} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {{! vect_no_align} && {! vect_hw_misalign} } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-48.c b/gcc/testsuite/gcc.dg/vect/vect-48.c
index e47ee00de91..f66a8622ec0 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-48.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-48.c
@@ -55,6 +55,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-50.c b/gcc/testsuite/gcc.dg/vect/vect-50.c
index 70b683e1a9d..74de0fb4fa8 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-50.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-50.c
@@ -61,9 +61,9 @@ int main (void)
align the store will not force the two loads to be aligned). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || {! vect_hw_misalign } } || {! vector_alignment_reachable} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && { {! vect_no_align } && {! vect_hw_misalign } } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-52.c b/gcc/testsuite/gcc.dg/vect/vect-52.c
index af485abbd14..426092e3915 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-52.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-52.c
@@ -56,6 +56,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-54.c b/gcc/testsuite/gcc.dg/vect/vect-54.c
index 85387fa6a34..629e82df59b 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-54.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-54.c
@@ -59,7 +59,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-56.c b/gcc/testsuite/gcc.dg/vect/vect-56.c
index e32d855d08d..945d7caa6c7 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-56.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-56.c
@@ -68,6 +68,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail {! vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-58.c b/gcc/testsuite/gcc.dg/vect/vect-58.c
index 5ceb15627fc..fa8c91b3071 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-58.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-58.c
@@ -58,7 +58,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-60.c b/gcc/testsuite/gcc.dg/vect/vect-60.c
index 3319e360710..90234dd0db4 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-60.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-60.c
@@ -69,6 +69,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail vect_hw_misalign } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-70.c b/gcc/testsuite/gcc.dg/vect/vect-70.c
index bf206874ecd..e3ebdcab8b5 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-70.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-70.c
@@ -63,8 +63,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable && { ! {vect_hw_misalign} } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target {{! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-72.c b/gcc/testsuite/gcc.dg/vect/vect-72.c
index 67a19751952..1a9f13ca869 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-72.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-72.c
@@ -47,5 +47,5 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail vect_hw_misalign } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-87.c b/gcc/testsuite/gcc.dg/vect/vect-87.c
index e7c5bbc7159..9912f19e724 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-87.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-87.c
@@ -50,8 +50,7 @@ int main (void)
/* Fails for targets that don't vectorize PLUS (e.g alpha). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable} } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-88.c b/gcc/testsuite/gcc.dg/vect/vect-88.c
index 3dc5588e92d..59385465228 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-88.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-88.c
@@ -50,8 +50,7 @@ int main (void)
/* Fails for targets that don't vectorize PLUS (e.g alpha). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-89.c b/gcc/testsuite/gcc.dg/vect/vect-89.c
index 4a6e7ae47f7..131efeab53a 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-89.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-89.c
@@ -45,7 +45,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-91.c b/gcc/testsuite/gcc.dg/vect/vect-91.c
index c5aee4403f2..632340b0fef 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-91.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-91.c
@@ -58,8 +58,7 @@ main3 ()
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { xfail vect_no_int_add } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" { target vect_hw_misalign } } } */
/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 3 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target { vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-92.c b/gcc/testsuite/gcc.dg/vect/vect-92.c
index 62aa97540f2..3a64e251cb2 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-92.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-92.c
@@ -91,7 +91,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 9 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-93.c b/gcc/testsuite/gcc.dg/vect/vect-93.c
index 4c41e60df0a..85666d9e699 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-93.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-93.c
@@ -71,9 +71,8 @@ int main (void)
/* main && main1 together: */
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 2 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { vect_no_align && {! vector_alignment_reachable} } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } } */
/* in main1: */
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target !powerpc*-*-* !i?86-*-* !x86_64-*-* } } } */
@@ -81,6 +80,6 @@ int main (void)
/* in main: */
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-95.c b/gcc/testsuite/gcc.dg/vect/vect-95.c
index 9f1a2c4b256..c1d5926e67d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-95.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-95.c
@@ -56,14 +56,13 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail {vect_hw_misalign} } } } */
/* For targets that support unaligned loads we version for the two unaligned
stores and generate misaligned accesses for the loads. For targets that
don't support unaligned loads we version for all four accesses. */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target vect_no_align } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-96.c b/gcc/testsuite/gcc.dg/vect/vect-96.c
index 219c82b0897..f392169f770 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-96.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-96.c
@@ -44,6 +44,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_no_align} && vector_alignment_reachable } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { vect_no_align || { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
index 1a0375266b0..e8fe027f5f3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
@@ -78,11 +78,11 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign }} } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail {! vect_hw_misalign} } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vect_hw_misalign} } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
index ba1f6604861..2cbc6216354 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
@@ -54,6 +54,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
index f1d62f7cd0e..274fb025319 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
@@ -87,9 +87,9 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 8 "vect" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
index 7d8f5afe3e4..522ed30ead3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
@@ -61,6 +61,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" {xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c
index e558f413c92..7bb7db0fa5f 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c
@@ -58,7 +58,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c
index b99bcca49f4..b7e1329a151 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c
@@ -54,7 +54,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {xfail {! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c
index a3bd7e69674..ad6f8f0fec5 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c
@@ -54,7 +54,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c
index 32d05b29829..a5449ffdd9e 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c
@@ -54,7 +54,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {xfail {! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c
index c46c8a74711..8e6e288b9bf 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c
@@ -58,7 +58,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c
index 3c57f937fc0..c09583535e1 100644
--- a/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c
@@ -58,7 +58,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" {xfail {! vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gfortran.dg/vect/vect-2.f90 b/gcc/testsuite/gfortran.dg/vect/vect-2.f90
index adc8d9c0b84..ed064d6cf25 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect-2.f90
+++ b/gcc/testsuite/gfortran.dg/vect/vect-2.f90
@@ -15,9 +15,8 @@ END
! support unaligned loads).
! { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { vect_no_align && { {! vector_alignment_reachable } && {! vect_hw_misalign } } } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign} } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 5 "vect" { target vect_hw_misalign } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align || {! vect_hw_misalign} } || {! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { vect_no_align && { {! vector_alignment_reachable } } } } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } }
! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" {target { vect_no_align || { {! vector_alignment_reachable } && {! vect_hw_misalign }} } } } }
! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gfortran.dg/vect/vect-3.f90 b/gcc/testsuite/gfortran.dg/vect/vect-3.f90
index c0d7f0001d5..5fc4fbf49e3 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect-3.f90
+++ b/gcc/testsuite/gfortran.dg/vect/vect-3.f90
@@ -7,11 +7,9 @@ Y = Y + A * X
END
! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target vect_no_align } } }
! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vect_no_align} && { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } }
! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { {! vect_no_align} && { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {target vect_hw_misalign} } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable}} } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || { ! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable}} } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align } || { ! vector_alignment_reachable} } } } }
! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gfortran.dg/vect/vect-4.f90 b/gcc/testsuite/gfortran.dg/vect/vect-4.f90
index 34047343692..592282fb09b 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect-4.f90
+++ b/gcc/testsuite/gfortran.dg/vect/vect-4.f90
@@ -10,9 +10,8 @@ Y = Y + A * X
END
! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } }
! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } }
! { dg-final { scan-tree-dump-times "accesses have the same alignment." 1 "vect" } }
! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gfortran.dg/vect/vect-5.f90 b/gcc/testsuite/gfortran.dg/vect/vect-5.f90
index c562a81bacc..25eb88e2cab 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect-5.f90
+++ b/gcc/testsuite/gfortran.dg/vect/vect-5.f90
@@ -36,9 +36,8 @@
end
! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } }
-! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } }
-! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { vect_hw_misalign } } } }
+! { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || {! vect_hw_misalign } } || {! vector_alignment_reachable} } } } }
+! { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } }
! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { vect_no_align } } } }
! { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } }
! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref1.adb b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb
index 817155dc1c9..6e7bf14e5df 100644
--- a/gcc/testsuite/gnat.dg/null_pointer_deref1.adb
+++ b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb
@@ -17,5 +17,5 @@ procedure Null_Pointer_Deref1 is
begin
Data.all := 1;
exception
- when Storage_Error => null;
+ when Constraint_Error | Storage_Error => null;
end;
diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref2.adb b/gcc/testsuite/gnat.dg/null_pointer_deref2.adb
index b1dd548f01b..63e2dd11f39 100644
--- a/gcc/testsuite/gnat.dg/null_pointer_deref2.adb
+++ b/gcc/testsuite/gnat.dg/null_pointer_deref2.adb
@@ -20,7 +20,7 @@ procedure Null_Pointer_Deref2 is
begin
Data.all := 1;
exception
- when Storage_Error => null;
+ when Constraint_Error | Storage_Error => null;
end T;
begin
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 199f1dcf54c..5108e07cd48 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -1114,12 +1114,12 @@ expand_complex_div_wide (gimple_stmt_iterator *gsi, tree inner_type,
t1 = gimplify_build1 (gsi, ABS_EXPR, inner_type, br);
t2 = gimplify_build1 (gsi, ABS_EXPR, inner_type, bi);
compare = fold_build2_loc (gimple_location (gsi_stmt (*gsi)),
- LT_EXPR, boolean_type_node, t1, t2);
+ LT_EXPR, boolean_type_node, t1, t2);
STRIP_NOPS (compare);
bb_cond = bb_true = bb_false = bb_join = NULL;
rr = ri = tr = ti = NULL;
- if (!TREE_CONSTANT (compare))
+ if (TREE_CODE (compare) != INTEGER_CST)
{
edge e;
gimple stmt;
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 56b1b941683..c5c7f7146c8 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -340,7 +340,7 @@ static gimple_seq eh_seq;
/* Record whether an EH region contains something that can throw,
indexed by EH region number. */
-static bitmap eh_region_may_contain_throw;
+static bitmap eh_region_may_contain_throw_map;
/* The GOTO_QUEUE is is an array of GIMPLE_GOTO and GIMPLE_RETURN
statements that are seen to escape this GIMPLE_TRY_FINALLY node.
@@ -863,15 +863,24 @@ emit_eh_dispatch (gimple_seq *seq, eh_region region)
static void
note_eh_region_may_contain_throw (eh_region region)
{
- while (!bitmap_bit_p (eh_region_may_contain_throw, region->index))
+ while (!bitmap_bit_p (eh_region_may_contain_throw_map, region->index))
{
- bitmap_set_bit (eh_region_may_contain_throw, region->index);
+ bitmap_set_bit (eh_region_may_contain_throw_map, region->index);
region = region->outer;
if (region == NULL)
break;
}
}
+/* Check if REGION has been marked as containing a throw. If REGION is
+ NULL, this predicate is false. */
+
+static inline bool
+eh_region_may_contain_throw (eh_region r)
+{
+ return r && bitmap_bit_p (eh_region_may_contain_throw_map, r->index);
+}
+
/* We want to transform
try { body; } catch { stuff; }
to
@@ -1559,8 +1568,7 @@ lower_try_finally (struct leh_state *state, gimple tp)
/* Determine if any exceptions are possible within the try block. */
if (using_eh_for_cleanups_p)
- this_tf.may_throw = bitmap_bit_p (eh_region_may_contain_throw,
- this_tf.region->index);
+ this_tf.may_throw = eh_region_may_contain_throw (this_tf.region);
if (this_tf.may_throw)
honor_protect_cleanup_actions (state, &this_state, &this_tf);
@@ -1618,22 +1626,23 @@ lower_try_finally (struct leh_state *state, gimple tp)
static gimple_seq
lower_catch (struct leh_state *state, gimple tp)
{
- eh_region try_region;
- struct leh_state this_state;
+ eh_region try_region = NULL;
+ struct leh_state this_state = *state;
gimple_stmt_iterator gsi;
tree out_label;
gimple_seq new_seq;
gimple x;
location_t try_catch_loc = gimple_location (tp);
- try_region = gen_eh_region_try (state->cur_region);
-
- this_state = *state;
- this_state.cur_region = try_region;
+ if (flag_exceptions)
+ {
+ try_region = gen_eh_region_try (state->cur_region);
+ this_state.cur_region = try_region;
+ }
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
- if (!bitmap_bit_p (eh_region_may_contain_throw, try_region->index))
+ if (!eh_region_may_contain_throw (try_region))
return gimple_try_eval (tp);
new_seq = NULL;
@@ -1686,21 +1695,23 @@ lower_catch (struct leh_state *state, gimple tp)
static gimple_seq
lower_eh_filter (struct leh_state *state, gimple tp)
{
- struct leh_state this_state;
- eh_region this_region;
+ struct leh_state this_state = *state;
+ eh_region this_region = NULL;
gimple inner, x;
gimple_seq new_seq;
inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
- this_region = gen_eh_region_allowed (state->cur_region,
- gimple_eh_filter_types (inner));
- this_state = *state;
- this_state.cur_region = this_region;
+ if (flag_exceptions)
+ {
+ this_region = gen_eh_region_allowed (state->cur_region,
+ gimple_eh_filter_types (inner));
+ this_state.cur_region = this_region;
+ }
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
- if (!bitmap_bit_p (eh_region_may_contain_throw, this_region->index))
+ if (!eh_region_may_contain_throw (this_region))
return gimple_try_eval (tp);
new_seq = NULL;
@@ -1729,24 +1740,25 @@ lower_eh_filter (struct leh_state *state, gimple tp)
static gimple_seq
lower_eh_must_not_throw (struct leh_state *state, gimple tp)
{
- struct leh_state this_state;
- eh_region this_region;
- gimple inner;
+ struct leh_state this_state = *state;
- inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
+ if (flag_exceptions)
+ {
+ gimple inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
+ eh_region this_region;
- this_region = gen_eh_region_must_not_throw (state->cur_region);
- this_region->u.must_not_throw.failure_decl
- = gimple_eh_must_not_throw_fndecl (inner);
- this_region->u.must_not_throw.failure_loc = gimple_location (tp);
+ this_region = gen_eh_region_must_not_throw (state->cur_region);
+ this_region->u.must_not_throw.failure_decl
+ = gimple_eh_must_not_throw_fndecl (inner);
+ this_region->u.must_not_throw.failure_loc = gimple_location (tp);
- /* In order to get mangling applied to this decl, we must mark it
- used now. Otherwise, pass_ipa_free_lang_data won't think it
- needs to happen. */
- TREE_USED (this_region->u.must_not_throw.failure_decl) = 1;
+ /* In order to get mangling applied to this decl, we must mark it
+ used now. Otherwise, pass_ipa_free_lang_data won't think it
+ needs to happen. */
+ TREE_USED (this_region->u.must_not_throw.failure_decl) = 1;
- this_state = *state;
- this_state.cur_region = this_region;
+ this_state.cur_region = this_region;
+ }
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
@@ -1759,26 +1771,20 @@ lower_eh_must_not_throw (struct leh_state *state, gimple tp)
static gimple_seq
lower_cleanup (struct leh_state *state, gimple tp)
{
- struct leh_state this_state;
- eh_region this_region;
+ struct leh_state this_state = *state;
+ eh_region this_region = NULL;
struct leh_tf_state fake_tf;
gimple_seq result;
- /* If not using eh, then exception-only cleanups are no-ops. */
- if (!flag_exceptions)
+ if (flag_exceptions)
{
- result = gimple_try_eval (tp);
- lower_eh_constructs_1 (state, result);
- return result;
+ this_region = gen_eh_region_cleanup (state->cur_region);
+ this_state.cur_region = this_region;
}
- this_region = gen_eh_region_cleanup (state->cur_region);
- this_state = *state;
- this_state.cur_region = this_region;
-
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
- if (!bitmap_bit_p (eh_region_may_contain_throw, this_region->index))
+ if (!eh_region_may_contain_throw (this_region))
return gimple_try_eval (tp);
/* Build enough of a try-finally state so that we can reuse
@@ -1979,7 +1985,7 @@ lower_eh_constructs (void)
return 0;
finally_tree = htab_create (31, struct_ptr_hash, struct_ptr_eq, free);
- eh_region_may_contain_throw = BITMAP_ALLOC (NULL);
+ eh_region_may_contain_throw_map = BITMAP_ALLOC (NULL);
memset (&null_state, 0, sizeof (null_state));
collect_finally_tree_1 (bodyp, NULL);
@@ -1996,7 +2002,7 @@ lower_eh_constructs (void)
gcc_assert (bodyp == gimple_body (current_function_decl));
htab_delete (finally_tree);
- BITMAP_FREE (eh_region_may_contain_throw);
+ BITMAP_FREE (eh_region_may_contain_throw_map);
eh_seq = NULL;
/* If this function needs a language specific EH personality routine
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index fbd047085da..4c052be418f 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -776,12 +776,14 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
|| SSA_VAR_P (ref1->ref)
|| handled_component_p (ref1->ref)
|| INDIRECT_REF_P (ref1->ref)
- || TREE_CODE (ref1->ref) == TARGET_MEM_REF)
+ || TREE_CODE (ref1->ref) == TARGET_MEM_REF
+ || TREE_CODE (ref1->ref) == CONST_DECL)
&& (!ref2->ref
|| SSA_VAR_P (ref2->ref)
|| handled_component_p (ref2->ref)
|| INDIRECT_REF_P (ref2->ref)
- || TREE_CODE (ref2->ref) == TARGET_MEM_REF));
+ || TREE_CODE (ref2->ref) == TARGET_MEM_REF
+ || TREE_CODE (ref2->ref) == CONST_DECL));
/* Decompose the references into their base objects and the access. */
base1 = ao_ref_base (ref1);
@@ -798,6 +800,8 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
which is seen as a struct copy. */
if (TREE_CODE (base1) == SSA_NAME
|| TREE_CODE (base2) == SSA_NAME
+ || TREE_CODE (base1) == CONST_DECL
+ || TREE_CODE (base2) == CONST_DECL
|| is_gimple_min_invariant (base1)
|| is_gimple_min_invariant (base2))
return false;
@@ -934,7 +938,6 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
their first argument. */
case BUILT_IN_STRCPY:
case BUILT_IN_STRNCPY:
- case BUILT_IN_BCOPY:
case BUILT_IN_MEMCPY:
case BUILT_IN_MEMMOVE:
case BUILT_IN_MEMPCPY:
@@ -952,6 +955,15 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref)
size);
return refs_may_alias_p_1 (&dref, ref, false);
}
+ case BUILT_IN_BCOPY:
+ {
+ ao_ref dref;
+ tree size = gimple_call_arg (call, 2);
+ ao_ref_init_from_ptr_and_size (&dref,
+ gimple_call_arg (call, 0),
+ size);
+ return refs_may_alias_p_1 (&dref, ref, false);
+ }
/* The following builtins do not read from memory. */
case BUILT_IN_FREE:
case BUILT_IN_MEMSET:
@@ -1151,7 +1163,6 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
their first argument. */
case BUILT_IN_STRCPY:
case BUILT_IN_STRNCPY:
- case BUILT_IN_BCOPY:
case BUILT_IN_MEMCPY:
case BUILT_IN_MEMMOVE:
case BUILT_IN_MEMPCPY:
@@ -1170,6 +1181,15 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
size);
return refs_may_alias_p_1 (&dref, ref, false);
}
+ case BUILT_IN_BCOPY:
+ {
+ ao_ref dref;
+ tree size = gimple_call_arg (call, 2);
+ ao_ref_init_from_ptr_and_size (&dref,
+ gimple_call_arg (call, 1),
+ size);
+ return refs_may_alias_p_1 (&dref, ref, false);
+ }
/* Freeing memory kills the pointed-to memory. More importantly
the call has to serve as a barrier for moving loads and stores
across it. */
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index cc655df7cc6..74dc6d2c1ba 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -3663,8 +3663,8 @@ find_func_aliases (gimple origt)
pointer passed by address. */
else if (is_gimple_call (t))
{
- tree fndecl;
- if ((fndecl = gimple_call_fndecl (t)) != NULL_TREE
+ tree fndecl = gimple_call_fndecl (t);
+ if (fndecl != NULL_TREE
&& DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
/* ??? All builtins that are handled here need to be handled
in the alias-oracle query functions explicitly! */
@@ -3687,8 +3687,10 @@ find_func_aliases (gimple origt)
case BUILT_IN_STRNCAT:
{
tree res = gimple_call_lhs (t);
- tree dest = gimple_call_arg (t, 0);
- tree src = gimple_call_arg (t, 1);
+ tree dest = gimple_call_arg (t, (DECL_FUNCTION_CODE (fndecl)
+ == BUILT_IN_BCOPY ? 1 : 0));
+ tree src = gimple_call_arg (t, (DECL_FUNCTION_CODE (fndecl)
+ == BUILT_IN_BCOPY ? 0 : 1));
if (res != NULL_TREE)
{
get_constraint_for (res, &lhsc);
@@ -3774,7 +3776,9 @@ find_func_aliases (gimple origt)
default:
/* Fallthru to general call handling. */;
}
- if (!in_ipa_mode)
+ if (!in_ipa_mode
+ || (fndecl
+ && !lookup_vi_for_tree (fndecl)))
{
VEC(ce_s, heap) *rhsc = NULL;
int flags = gimple_call_flags (t);
@@ -4425,9 +4429,6 @@ create_variable_info_for (tree decl, const char *name)
tree declsize = DECL_P (decl) ? DECL_SIZE (decl) : TYPE_SIZE (decl_type);
VEC (fieldoff_s,heap) *fieldstack = NULL;
- if (TREE_CODE (decl) == FUNCTION_DECL && in_ipa_mode)
- return create_function_info_for (decl, name);
-
if (var_can_have_subvars (decl) && use_field_sensitive)
push_fields_onto_fieldstack (decl_type, &fieldstack, 0);
@@ -4773,8 +4774,6 @@ set_uids_in_ptset (bitmap into, bitmap from, struct pt_solution *pt)
}
-static bool have_alias_info = false;
-
/* Compute the points-to solution *PT for the variable VI. */
static void
@@ -5399,44 +5398,12 @@ delete_alias_heapvars (void)
heapvar_for_stmt = NULL;
}
-/* Create points-to sets for the current function. See the comments
- at the start of the file for an algorithmic overview. */
+/* Solve the constraint set. */
static void
-compute_points_to_sets (void)
+solve_constraints (void)
{
struct scc_info *si;
- basic_block bb;
- unsigned i;
- varinfo_t vi;
-
- timevar_push (TV_TREE_PTA);
-
- init_alias_vars ();
- init_alias_heapvars ();
-
- intra_create_variable_infos ();
-
- /* Now walk all statements and derive aliases. */
- FOR_EACH_BB (bb)
- {
- gimple_stmt_iterator gsi;
-
- for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple phi = gsi_stmt (gsi);
-
- if (is_gimple_reg (gimple_phi_result (phi)))
- find_func_aliases (phi);
- }
-
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- gimple stmt = gsi_stmt (gsi);
-
- find_func_aliases (stmt);
- }
- }
if (dump_file)
{
@@ -5493,6 +5460,48 @@ compute_points_to_sets (void)
if (dump_file)
dump_sa_points_to_info (dump_file);
+}
+
+/* Create points-to sets for the current function. See the comments
+ at the start of the file for an algorithmic overview. */
+
+static void
+compute_points_to_sets (void)
+{
+ basic_block bb;
+ unsigned i;
+ varinfo_t vi;
+
+ timevar_push (TV_TREE_PTA);
+
+ init_alias_vars ();
+ init_alias_heapvars ();
+
+ intra_create_variable_infos ();
+
+ /* Now walk all statements and derive aliases. */
+ FOR_EACH_BB (bb)
+ {
+ gimple_stmt_iterator gsi;
+
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+
+ if (is_gimple_reg (gimple_phi_result (phi)))
+ find_func_aliases (phi);
+ }
+
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+
+ find_func_aliases (stmt);
+ }
+ }
+
+ /* From the constraints compute the points-to sets. */
+ solve_constraints ();
/* Compute the points-to sets for ESCAPED and CALLUSED used for
call-clobber analysis. */
@@ -5524,8 +5533,6 @@ compute_points_to_sets (void)
}
timevar_pop (TV_TREE_PTA);
-
- have_alias_info = true;
}
@@ -5559,7 +5566,6 @@ delete_points_to_sets (void)
VEC_free (varinfo_t, heap, varmap);
free_alloc_pool (variable_info_pool);
free_alloc_pool (constraint_pool);
- have_alias_info = false;
}
@@ -5658,101 +5664,94 @@ static unsigned int
ipa_pta_execute (void)
{
struct cgraph_node *node;
- struct scc_info *si;
in_ipa_mode = 1;
+
init_alias_heapvars ();
init_alias_vars ();
+ /* Build the constraints. */
for (node = cgraph_nodes; node; node = node->next)
{
unsigned int varid;
+ /* Nodes without a body are not interesting. Especially do not
+ visit clones at this point for now - we get duplicate decls
+ there for inline clones at least. */
+ if (!gimple_has_body_p (node->decl)
+ || node->clone_of)
+ continue;
+
+ /* It does not make sense to have graph edges into or out of
+ externally visible functions. There is no extra information
+ we can gather from them. */
+ if (node->local.externally_visible)
+ continue;
+
varid = create_function_info_for (node->decl,
cgraph_node_name (node));
- if (node->local.externally_visible)
- {
- varinfo_t fi = get_varinfo (varid);
- for (; fi; fi = fi->next)
- make_constraint_from (fi, anything_id);
- }
}
+
for (node = cgraph_nodes; node; node = node->next)
{
- if (node->analyzed)
- {
- struct function *func = DECL_STRUCT_FUNCTION (node->decl);
- basic_block bb;
- tree old_func_decl = current_function_decl;
- if (dump_file)
- fprintf (dump_file,
- "Generating constraints for %s\n",
- cgraph_node_name (node));
- push_cfun (func);
- current_function_decl = node->decl;
+ struct function *func;
+ basic_block bb;
+ tree old_func_decl;
- FOR_EACH_BB_FN (bb, func)
- {
- gimple_stmt_iterator gsi;
+ /* Nodes without a body are not interesting. */
+ if (!gimple_has_body_p (node->decl)
+ || node->clone_of)
+ continue;
- for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
- gsi_next (&gsi))
- {
- gimple phi = gsi_stmt (gsi);
+ if (dump_file)
+ fprintf (dump_file,
+ "Generating constraints for %s\n",
+ cgraph_node_name (node));
- if (is_gimple_reg (gimple_phi_result (phi)))
- find_func_aliases (phi);
- }
+ func = DECL_STRUCT_FUNCTION (node->decl);
+ old_func_decl = current_function_decl;
+ push_cfun (func);
+ current_function_decl = node->decl;
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- find_func_aliases (gsi_stmt (gsi));
- }
- current_function_decl = old_func_decl;
- pop_cfun ();
- }
- else
- {
- /* Make point to anything. */
- }
- }
+ /* For externally visible functions use local constraints for
+ their arguments. For local functions we see all callers
+ and thus do not need initial constraints for parameters. */
+ if (node->local.externally_visible)
+ intra_create_variable_infos ();
- if (dump_file)
- {
- fprintf (dump_file, "Points-to analysis\n\nConstraints:\n\n");
- dump_constraints (dump_file);
- }
+ /* Build constriants for the function body. */
+ FOR_EACH_BB_FN (bb, func)
+ {
+ gimple_stmt_iterator gsi;
- if (dump_file)
- fprintf (dump_file,
- "\nCollapsing static cycles and doing variable "
- "substitution:\n");
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
- init_graph (VEC_length (varinfo_t, varmap) * 2);
- build_pred_graph ();
- si = perform_var_substitution (graph);
- rewrite_constraints (graph, si);
+ if (is_gimple_reg (gimple_phi_result (phi)))
+ find_func_aliases (phi);
+ }
- build_succ_graph ();
- free_var_substitution_info (si);
- move_complex_constraints (graph);
- unite_pointer_equivalences (graph);
- find_indirect_cycles (graph);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
- /* Implicit nodes and predecessors are no longer necessary at this
- point. */
- remove_preds_and_fake_succs (graph);
+ find_func_aliases (stmt);
+ }
+ }
- if (dump_file)
- fprintf (dump_file, "\nSolving graph\n");
+ current_function_decl = old_func_decl;
+ pop_cfun ();
+ }
- solve_graph (graph);
+ /* From the constraints compute the points-to sets. */
+ solve_constraints ();
- if (dump_file)
- dump_sa_points_to_info (dump_file);
+ delete_points_to_sets ();
in_ipa_mode = 0;
- delete_alias_heapvars ();
- delete_points_to_sets ();
+
return 0;
}
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index b646ded59e7..8e88c2f73b0 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1201,11 +1201,6 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
record type or a pointer to an unprototyped function,
then the conversion is not necessary. */
if (VOID_TYPE_P (TREE_TYPE (outer_type))
- || (AGGREGATE_TYPE_P (TREE_TYPE (outer_type))
- && TREE_CODE (TREE_TYPE (outer_type)) != ARRAY_TYPE
- && (TREE_CODE (TREE_TYPE (outer_type))
- == TREE_CODE (TREE_TYPE (inner_type)))
- && !COMPLETE_TYPE_P (TREE_TYPE (outer_type)))
|| ((TREE_CODE (TREE_TYPE (outer_type)) == FUNCTION_TYPE
|| TREE_CODE (TREE_TYPE (outer_type)) == METHOD_TYPE)
&& (TREE_CODE (TREE_TYPE (outer_type))
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index ea3a508966f..b4c1f401bb5 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -1138,8 +1138,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
/* While cost model enhancements are expected in the future, the high level
view of the code at this time is as follows:
- A) If there is an unsupported misaligned access then see if peeling
- to align this access can make all data references satisfy
+ A) If there is a misaligned access then see if peeling to align
+ this access can make all data references satisfy
vect_supportable_dr_alignment. If so, update data structures
as needed and return true.
@@ -1184,7 +1184,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
&& DR_GROUP_FIRST_DR (stmt_info) != stmt)
continue;
- if (!supportable_dr_alignment)
+ if (!aligned_access_p (dr))
{
do_peeling = vector_alignment_reachable_p (dr);
if (do_peeling)
diff --git a/gcc/tree.c b/gcc/tree.c
index 43434150231..60797254fa1 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4171,11 +4171,6 @@ free_lang_data_in_type (tree type)
{
gcc_assert (TYPE_P (type));
- /* Fill in the alias-set. We need to at least track zeroness here
- for correctness. */
- if (lang_hooks.get_alias_set (type) == 0)
- TYPE_ALIAS_SET (type) = 0;
-
/* Give the FE a chance to remove its own data first. */
lang_hooks.free_lang_data (type);
@@ -4924,6 +4919,20 @@ free_lang_data_in_cgraph (void)
static unsigned
free_lang_data (void)
{
+ unsigned i;
+
+ /* Allocate and assign alias sets to the standard integer types
+ while the slots are still in the way the frontends generated them. */
+ for (i = 0; i < itk_none; ++i)
+ if (integer_types[i])
+ TYPE_ALIAS_SET (integer_types[i]) = get_alias_set (integer_types[i]);
+
+ /* FIXME. Remove after save_debug_info is working. */
+ if (!(flag_generate_lto
+ || (!in_lto_p
+ && !flag_gtoggle && debug_info_level <= DINFO_LEVEL_TERSE)))
+ return 0;
+
/* Traverse the IL resetting language specific information for
operands, expressions, etc. */
free_lang_data_in_cgraph ();
@@ -4951,9 +4960,9 @@ free_lang_data (void)
else
signed_char_type_node = char_type_node;
- /* Reset some langhooks. */
+ /* Reset some langhooks. Do not reset types_compatible_p, it may
+ still be used indirectly via the get_alias_set langhook. */
lang_hooks.callgraph.analyze_expr = NULL;
- lang_hooks.types_compatible_p = NULL;
lang_hooks.dwarf_name = lhd_dwarf_name;
lang_hooks.decl_printable_name = gimple_decl_printable_name;
lang_hooks.set_decl_assembler_name = lhd_set_decl_assembler_name;
@@ -4975,24 +4984,12 @@ free_lang_data (void)
}
-/* Gate function for free_lang_data. */
-
-static bool
-gate_free_lang_data (void)
-{
- /* FIXME. Remove after save_debug_info is working. */
- return (flag_generate_lto
- || (!in_lto_p
- && !flag_gtoggle && debug_info_level <= DINFO_LEVEL_TERSE));
-}
-
-
struct simple_ipa_opt_pass pass_ipa_free_lang_data =
{
{
SIMPLE_IPA_PASS,
NULL, /* name */
- gate_free_lang_data, /* gate */
+ NULL, /* gate */
free_lang_data, /* execute */
NULL, /* sub */
NULL, /* next */
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 9fa19219186..5cc8ced3956 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -6416,7 +6416,7 @@ emit_note_insn_var_location (void **varp, void *data)
continue;
}
loc[n_var_parts] = loc2;
- mode = GET_MODE (loc[n_var_parts]);
+ mode = GET_MODE (var->var_part[i].loc_chain->loc);
initialized = var->var_part[i].loc_chain->init;
last_limit = offsets[n_var_parts] + GET_MODE_SIZE (mode);
@@ -6427,9 +6427,10 @@ emit_note_insn_var_location (void **varp, void *data)
break;
if (j < var->n_var_parts
&& wider_mode != VOIDmode
+ && mode == GET_MODE (var->var_part[j].loc_chain->loc)
+ && (REG_P (loc[n_var_parts]) || MEM_P (loc[n_var_parts]))
&& (loc2 = vt_expand_loc (var->var_part[j].loc_chain->loc, vars))
&& GET_CODE (loc[n_var_parts]) == GET_CODE (loc2)
- && mode == GET_MODE (loc2)
&& last_limit == var->var_part[j].offset)
{
rtx new_loc = NULL;
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index f9d20206d23..ba9393ed960 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -4,6 +4,10 @@
*s. Accept ld version without text in ()s.
* configure: Regenerated.
+2009-10-22 Razya Ladelsky <razya@il.ibm.com>
+
+ * testsuite/libgomp.graphite/force-parallel-2.c: Adjust scan.
+
2009-10-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR libgomp/41418
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index daeb4393081..9bd58919d7b 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-28 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/stl_iterator_base_funcs.h: (next): Change
+ template parameter name consistently with the resolution
+ of DR 1011 ([Ready] in Santa Cruz).
+
+2009-10-28 Johannes Singler <singler@kit.edu>
+
+ PR libstdc++/40852
+ * include/parallel/multiseq_selection.h
+ (multiseq_partition, multiseq_selection): Avoid intermediate
+ values exceeding the integer type range for very large inputs.
+
2009-10-26 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/chrono (duration<>::duration(const duration<>&)): Fix
diff --git a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
index 0a854faa14c..b629ca20231 100644
--- a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
+++ b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
@@ -173,10 +173,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
}
#ifdef __GXX_EXPERIMENTAL_CXX0X__
- template<typename _InputIterator>
- inline _InputIterator
- next(_InputIterator __x, typename
- iterator_traits<_InputIterator>::difference_type __n = 1)
+ template<typename _ForwardIterator>
+ inline _ForwardIterator
+ next(_ForwardIterator __x, typename
+ iterator_traits<_ForwardIterator>::difference_type __n = 1)
{
std::advance(__x, __n);
return __x;
diff --git a/libstdc++-v3/include/parallel/multiseq_selection.h b/libstdc++-v3/include/parallel/multiseq_selection.h
index fdce872c5a1..ac06385b44b 100644
--- a/libstdc++-v3/include/parallel/multiseq_selection.h
+++ b/libstdc++-v3/include/parallel/multiseq_selection.h
@@ -187,9 +187,6 @@ namespace __gnu_parallel
// equality iff __nmax = 2^__k - 1.
__l = (1ULL << __r) - 1;
- // From now on, including padding.
- __N = __l * __m;
-
for (int __i = 0; __i < __m; __i++)
{
__a[__i] = 0;
@@ -215,7 +212,7 @@ namespace __gnu_parallel
__sample.push_back(
std::make_pair(__S(__i)[0] /*__dummy element*/, __i));
- _DifferenceType __localrank = __rank * __m / __N ;
+ _DifferenceType __localrank = __rank / __l;
int __j;
for (__j = 0;
@@ -265,15 +262,11 @@ namespace __gnu_parallel
__b[__i] -= __n + 1;
}
- _DifferenceType __leftsize = 0, __total = 0;
+ _DifferenceType __leftsize = 0;
for (int __i = 0; __i < __m; __i++)
- {
__leftsize += __a[__i] / (__n + 1);
- __total += __l / (__n + 1);
- }
-
- _DifferenceType __skew = static_cast<_DifferenceType>
- (static_cast<uint64_t>(__total) * __rank / __N - __leftsize);
+
+ _DifferenceType __skew = __rank / (__n + 1) - __leftsize;
if (__skew > 0)
{
@@ -442,9 +435,6 @@ namespace __gnu_parallel
// equality iff __nmax = 2^__k - 1
__l = pow2(__r) - 1;
- // From now on, including padding.
- __N = __l * __m;
-
for (int __i = 0; __i < __m; ++__i)
{
__a[__i] = 0;
@@ -472,7 +462,7 @@ namespace __gnu_parallel
__sample.push_back(
std::make_pair(__S(__i)[0] /*__dummy element*/, __i));
- _DifferenceType __localrank = __rank * __m / __N ;
+ _DifferenceType __localrank = __rank / __l;
int __j;
for (__j = 0;
@@ -513,15 +503,11 @@ namespace __gnu_parallel
__b[__i] -= __n + 1;
}
- _DifferenceType __leftsize = 0, __total = 0;
+ _DifferenceType __leftsize = 0;
for (int __i = 0; __i < __m; ++__i)
- {
__leftsize += __a[__i] / (__n + 1);
- __total += __l / (__n + 1);
- }
- _DifferenceType __skew = ((unsigned long long)__total * __rank / __N
- - __leftsize);
+ _DifferenceType __skew = __rank / (__n + 1) - __leftsize;
if (__skew > 0)
{
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index 14cd0874971..fd2d7169966 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-28 Rafael Avila de Espindola <espindola@google.com>
+
+ * lto-plugin.c (all_symbols_read_handler): Use LDPL_FATAL instead of
+ LDPL_ERROR
+
+2009-10-27 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
+
+ PR lto/41652
+ * configure.ac: Call AC_SYS_LARGEFILE before AC_OUTPUT.
+ * configure: Regenerate.
+
2009-10-26 Richard Guenther <rguenther@suse.de>
* configure.ac: Use AM_MAINTAINER_MODE.
diff --git a/lto-plugin/configure b/lto-plugin/configure
index 91b84efab8e..1265e10c4f9 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -861,13 +861,13 @@ enable_option_checking
with_build_libsubdir
enable_maintainer_mode
enable_dependency_tracking
+enable_largefile
enable_shared
enable_static
with_pic
enable_fast_install
with_gnu_ld
enable_libtool_lock
-enable_largefile
'
ac_precious_vars='build_alias
host_alias
@@ -1503,12 +1503,12 @@ Optional Features:
(and sometimes confusing) to the casual installer
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
+ --disable-largefile omit support for large files
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
- --disable-largefile omit support for large files
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -3838,6 +3838,205 @@ fi
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if test "${ac_cv_sys_largefile_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if test "${ac_cv_sys_large_files+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+fi
+
+
case `pwd` in
*\ * | *\ *)
@@ -4481,13 +4680,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:4484: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:4683: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:4487: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:4686: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:4490: output\"" >&5)
+ (eval echo "\"\$as_me:4689: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -5661,7 +5860,6 @@ fi
-
# Check whether --enable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then :
enableval=$enable_libtool_lock;
@@ -5693,7 +5891,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 5696 "configure"' > conftest.$ac_ext
+ echo '#line 5894 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7223,11 +7421,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7226: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7424: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7230: \$? = $ac_status" >&5
+ echo "$as_me:7428: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7562,11 +7760,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7565: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7763: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7569: \$? = $ac_status" >&5
+ echo "$as_me:7767: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7667,11 +7865,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7670: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7868: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7674: \$? = $ac_status" >&5
+ echo "$as_me:7872: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -7722,11 +7920,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7725: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7923: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7729: \$? = $ac_status" >&5
+ echo "$as_me:7927: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -10104,7 +10302,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10107 "configure"
+#line 10305 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10200,7 +10398,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10203 "configure"
+#line 10401 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12614,201 +12812,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-# Check whether --enable-largefile was given.
-if test "${enable_largefile+set}" = set; then :
- enableval=$enable_largefile;
-fi
-
-if test "$enable_largefile" != no; then
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
-$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_CC+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_sys_largefile_CC=no
- if test "$GCC" != yes; then
- ac_save_CC=$CC
- while :; do
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- break
-fi
-rm -f core conftest.err conftest.$ac_objext
- CC="$CC -n32"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_largefile_CC=' -n32'; break
-fi
-rm -f core conftest.err conftest.$ac_objext
- break
- done
- CC=$ac_save_CC
- rm -f conftest.$ac_ext
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
-$as_echo "$ac_cv_sys_largefile_CC" >&6; }
- if test "$ac_cv_sys_largefile_CC" != no; then
- CC=$CC$ac_cv_sys_largefile_CC
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_file_offset_bits=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_file_offset_bits=64; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_sys_file_offset_bits=unknown
- break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
-$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
-case $ac_cv_sys_file_offset_bits in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-_ACEOF
-;;
-esac
-rm -rf conftest*
- if test $ac_cv_sys_file_offset_bits = unknown; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
-$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if test "${ac_cv_sys_large_files+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_large_files=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _LARGE_FILES 1
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_large_files=1; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_sys_large_files=unknown
- break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
-$as_echo "$ac_cv_sys_large_files" >&6; }
-case $ac_cv_sys_large_files in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
-_ACEOF
-;;
-esac
-rm -rf conftest*
- fi
-fi
-
diff --git a/lto-plugin/configure.ac b/lto-plugin/configure.ac
index d35972a750a..daefde67ccd 100644
--- a/lto-plugin/configure.ac
+++ b/lto-plugin/configure.ac
@@ -4,6 +4,7 @@ GCC_TOPLEV_SUBDIRS
AM_INIT_AUTOMAKE([foreign])
AM_MAINTAINER_MODE
AC_PROG_CC
+AC_SYS_LARGEFILE
AC_ARG_VAR(LIBELFLIBS,[How to link libelf])
AC_ARG_VAR(LIBELFINC,[How to find libelf include files])
AM_PROG_LIBTOOL
@@ -11,4 +12,3 @@ AC_SUBST(target_noncanonical)
AC_TYPE_UINT64_T
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
-AC_SYS_LARGEFILE
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 0cf1ab4ec69..3a51441c433 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -512,8 +512,6 @@ all_symbols_read_handler (void)
static enum ld_plugin_status
cleanup_handler (void)
{
- /* Note: we cannot use LDPL_FATAL in here as that would produce
- an infinite loop. */
int t;
unsigned i;
char *arguments;
@@ -525,23 +523,23 @@ cleanup_handler (void)
if (info->temp)
{
t = unlink (info->name);
- check (t == 0, LDPL_ERROR, "could not unlink temporary file");
+ check (t == 0, LDPL_FATAL, "could not unlink temporary file");
}
}
/* If we are being called from an error handler, it is possible
that the arguments file is still exists. */
t = asprintf (&arguments, "%s/arguments", temp_obj_dir_name);
- check (t >= 0, LDPL_ERROR, "asprintf failed");
+ check (t >= 0, LDPL_FATAL, "asprintf failed");
if (stat(arguments, &buf) == 0)
{
t = unlink (arguments);
- check (t == 0, LDPL_ERROR, "could not unlink arguments file");
+ check (t == 0, LDPL_FATAL, "could not unlink arguments file");
}
free (arguments);
t = rmdir (temp_obj_dir_name);
- check (t == 0, LDPL_ERROR, "could not remove temporary directory");
+ check (t == 0, LDPL_FATAL, "could not remove temporary directory");
free_2 ();
return LDPS_OK;