diff options
author | Richard Guenther <rguenther@suse.de> | 2016-11-14 15:42:40 +0100 |
---|---|---|
committer | Richard Guenther <rguenther@suse.de> | 2016-11-14 15:42:40 +0100 |
commit | ca94f8c64654980144e88fb19b04adf5f023aa55 (patch) | |
tree | ef90f8461d210f78e7f7b0ba89923a5eda7b3758 | |
parent | 9e872f3fe8b4f6624e2edf5ee55a833e53f290c8 (diff) | |
parent | 5dc46e164993bbf658f61069823a1b37a2d715eb (diff) | |
download | gcc-gimplefe.tar.gz |
Merge remote-tracking branch 'trunk' of git://gcc.gnu.org/git/gcc into gimplefegimplefe
171 files changed, 5075 insertions, 2276 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c0f8976aaf..3b9c8ac9724 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,201 @@ +2016-11-14 Martin Liska <mliska@suse.cz> + + * tree-ssa-dse.c (dse_optimize_stmt): Remove quotes and extra + new line. + +2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com> + Richard Biener <rguenther@suse.de> + + * doc/invoke.texi (fgimple): Document. + * dumpfile.h (TDF_GIMPLE): Add. + * dumpfile.c (dump_options): Add gimple. + * gimple-pretty-print.c (dump_gimple_switch): Adjust dump + for TDF_GIMPLE. + (dump_gimple_label): Likewise. + (dump_gimple_phi): Likewise. + (dump_gimple_bb_header): Likewise. + (dump_phi_nodes): Likewise. + (pp_cfg_jump): Likewise. Pass in dump flags. + (dump_implicit_edges): Adjust. + * passes.c (pass_init_dump_file): Do not dump function header + for TDF_GIMPLE. + * tree-cfg.c (dump_function_to_file): Dump function return type + and __GIMPLE keyword for TDF_GIMPLE. Change guard for dumping + GIMPLE stmts. + * tree-pretty-print.c (dump_decl_name): Adjust dump for TDF_GIMPLE. + (dump_generic_node): Likewise. + * function.h (struct function): Add pass_startwith member. + * passes.c (execute_one_pass): Implement startwith. + * tree-ssanames.c (make_ssa_name_fn): New argument, check for version + and assign proper version for parsed ssa names. + * tree-ssanames.h (make_ssa_name_fn): Add new argument to the function. + * internal-fn.c (expand_PHI): New function. + * internal-fn.h (expand_PHI): Declared here. + * internal-fn.def: New defination for PHI. + * tree-cfg.c (lower_phi_internal_fn): New function. + (build_gimple_cfg): Call it. + (verify_gimple_call): Condition for passing label as arg in internal + function PHI. + * tree-into-ssa.c (rewrite_add_phi_arguments): Handle already + present PHIs with arguments. + +2016-11-14 Martin Liska <mliska@suse.cz> + + PR bootstrap/78069 + * common.opt: Add prefer-atomic as a new enum value for + -fprofile-update. + * coretypes.h: Likewise. + * doc/invoke.texi: Document the new option value. + * gcc.c: Replace atomic with prefer-atomic. Remove warning. + * tree-profile.c (tree_profiling): Select default value + of -fprofile-update when 'prefer-atomic' is selected. + +2016-11-14 Wilco Dijkstra <wdijkstr@arm.com> + + * config/arm/cortex-a57.md (cortex_a57_alu): Move extend here, bfm... + (cortex_a57_alu_shift): ...here. + +2016-11-14 Wilco Dijkstra <wdijkstr@arm.com> + + * config/aarch64/aarch64.md (aarch64_ashl_sisd_or_int_<mode>3) + Use bfx attribute. + (aarch64_lshr_sisd_or_int_<mode>3): Likewise. + (aarch64_ashr_sisd_or_int_<mode>3): Likewise. + (<optab>si3_insn_uxtw): Likewise. + (<optab><mode>3_insn): Likewise. + (<ANY_EXTEND:optab><GPI:mode>_ashl<SHORT:mode>): Likewise. + (zero_extend<GPI:mode>_lshr<SHORT:mode>): Likewise. + (extend<GPI:mode>_ashr<SHORT:mode>): Likewise. + (<optab><mode>): Likewise. + (insv<mode>): Likewise. + (andim_ashift<mode>_bfiz): Likewise. + * config/aarch64/thunderx.md (thunderx_shift): Add bfx. + * config/arm/cortex-a53.md (cortex_a53_alu_shift): Likewise. + * config/arm/cortex-a57.md (cortex_a57_alu): Add bfx. + * config/arm/exynos-m1.md (exynos_m1_alu): Add bfx. + (exynos_m1_alu_p): Likewise. + * config/arm/types.md: Add bfx. + * config/arm/xgene1.md (xgene1_bfm): Add bfx. + +2016-11-14 Wilco Dijkstra <wdijkstr@arm.com> + + * config/aarch64/aarch64.c (cortexa57_vector_cost): + Change vec_stmt_cost, vec_align_load_cost and vec_unalign_load_cost. + +2016-11-14 Richard Biener <rguenther@suse.de> + + PR tree-optimization/78312 + * gimple-ssa-backprop.c (backprop::prepare_change): Reset + flow-sensitive info. + +2016-11-14 Georg-Johann Lay <avr@gjlay.de> + + PR target/78093 + * doc/invoke.texi (AVR Options) [-mabsdata]: Document new option. + * config/avr/avr.opt (-mabsdata): New option. + * config/avr/avr-arch.h (avr_device_specific_features): Add AVR_ISA_LDS. + * config/avr/avr.c (avr_encode_section_info) [AVR_TINY]: If + -mabsdata & symbol is not progmem, tag as AVR_SYMBOL_FLAG_TINY_ABSDATA. + * config/avr/avr-mcus.def (attiny4/5/9/10/20): Use AVR_ISA_LDS. + * config/avr/gen-avr-mmcu-specs.c (print_mcu): Print cc1_absdata + spec depending on AVR_ISA_LDS. + * config/avr/specs.h (CC1_SPEC): Enhanced by cc1_absdata spec. + +2016-11-13 Jakub Jelinek <jakub@redhat.com> + + * match.pd: Don't try to compare addresses of variables with + DECL_VALUE_EXPR. + +2016-11-13 Kugan Vivekanandarajah <kuganv@linaro.org> + + * ipa-cp.c (ipa_get_jf_pass_through_result): Skip unary expressions. + (propagate_vr_accross_jump_function): Handle unary expressions. + * ipa-prop.c (ipa_set_jf_unary_pass_through): New. + (load_from_param_1): New. + (load_from_unmodified_param): Factor common part into load_from_param_1. + (load_from_param): New. + (compute_complex_assign_jump_func): Handle unary expressions. + (update_jump_functions_after_inlining): Likewise. + (ipa_write_jump_function): Likewise. + (ipa_read_jump_function): Likewise. + +2016-11-13 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> + + PR c/35503 + * doc/invoke.texi: Document Wrestrict. + * pretty-print.c (pp_format): Add case for "Z" specifier. + (test_pp_format): Test "Z" specifier. +c-family/ + * c-common.h (warn_for_restrict): Declare. + * c-warn.c: Include gcc-rich-location.h. + (warn_for_restrict): New function. + * c-format.c (gcc_tdiag_char_table): Add entry for "Z" specifier. + (gcc_cdiag_char_table): Likewise. + (gcc_cxxdiag_char_table): Likewise. + * c.opt (Wrestrict): New option. +c/ + * c-parser.c (c_parser_postfix_expression_after_primary): Call + warn_for_restrict. +cp/ + * parser.c (cp_parser_postfix_pexpression): Call warn_for_restrict. + +2016-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * ipa-icf.c (sem_function::merge): Do not create a wrapper also if the + original function needs a static chain. + +2016-11-13 David Edelsohn <dje.gcc@gmail.com> + + PR target/78336 + * config/rs6000/rs6000.c (rs6000_asm_weaken_decl): Protect + ASM_OUTPUT_DEF. + +2016-11-12 Segher Boessenkool <segher@kernel.crashing.org> + + PR target/77957 + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Don't + return early if !optional_tbtab. + +2016-11-11 Eric Botcazou <ebotcazou@adacore.com> + + PR rtl-optimization/59461 + * doc/rtl.texi (paradoxical subregs): Add missing word. + * combine.c (reg_nonzero_bits_for_combine): Do not discard results + in modes with precision larger than that of last_set_mode. + * rtlanal.c (nonzero_bits1) <SUBREG>: If WORD_REGISTER_OPERATIONS is + set and LOAD_EXTEND_OP is appropriate, propagate results from inner + REGs to paradoxical SUBREGs. + (num_sign_bit_copies1) <SUBREG>: Likewise. Check that the mode is not + larger than a word before invoking LOAD_EXTEND_OP on it. + +2016-11-11 Michael Meissner <meissner@linux.vnet.ibm.com> + + PR target/78243 + * config/rs6000/vsx.md (vsx_extract_<mode>_p9): Correct the + element order for little endian ordering. + + * config/rs6000/altivec.md (reduc_plus_scal_<mode>): Use + VECTOR_ELT_ORDER_BIG and not BYTES_BIG_ENDIAN to adjust element + number. + +2016-11-11 Uros Bizjak <ubizjak@gmail.com> + + PR target/78310 + * config/i386/i386.md (rotate to rotatex splitter): Avoid overflow + when calculating operand 2. + (rotate to rotatex zext splitter): Ditto. + +2016-11-11 Jeff Law <law@redhat.com> + + * gimple-ssa-isolate-paths.c (is_divmod_with_given_divisor): New + function. + (stmt_uses_name_in_undefined_way): New function, extracted from + find_implicit_erroneous_behavior and extended for div/mod case. + (stmt_uses_0_or_null_in_undefined_way): New function, extracted from + find_explicit_erroneous_behavior and extended for div/mod case. + (find_implicit_erroneous_behavior): Use new helper function. + (find_explicit_erroneous_behavior): Use new helper function. + 2016-11-11 Richard Biener <rguenther@suse.de> PR tree-optimization/71575 @@ -32,10 +230,8 @@ (rs6000_secondary_reload_simple_move): Likewise. (rs6000_preferred_reload_class): Don't force integer constants to be loaded into vector registers that we can easily make into - memory (or being created in the GPRs and moved over with direct - move). - * config/rs6000/vsx.md (UNSPEC_P9_MEMORY): Delete, no longer - used. + memory (or being created in the GPRs and moved over with direct move). + * config/rs6000/vsx.md (UNSPEC_P9_MEMORY): Delete, no longer used. (vsx_extract_<mode>): Rework V4SImode, V8HImode, and V16QImode vector extraction on ISA 3.0 when the scalar integer can be allocated in vector registers. Generate the VEC_SELECT directy, @@ -59,8 +255,7 @@ (zero_extendhi<mode>): Likewise. (extendqi<mode>): Likewise. (extendhi<mode>2): Likewise. - (HImode splitter for load/sign extend in vector register): - Likewise. + (HImode splitter for load/sign extend in vector register): Likewise. (float<QHI:mode><FP_ISA3:mode>2): Eliminate old method of optimizing floating point conversions to/from small data types and rewrite it to support QImode/HImode being allowed in vector @@ -87,8 +282,8 @@ 2016-11-10 Pat Haugen <pthaugen@us.ibm.com> PR rtl-optimization/78241 - * loop-unroll.c (unroll_loop_runtime_iterations): Don't adjust 'niter', but - emit initial peel copy if niter expr is not reliable. + * loop-unroll.c (unroll_loop_runtime_iterations): Don't adjust 'niter', + but emit initial peel copy if niter expr is not reliable. 2016-11-10 Segher Boessenkool <segher@kernel.crashing.org> @@ -169,8 +364,7 @@ 2016-11-10 Siddhesh Poyarekar <siddhesh.poyarekar@linaro.org> - * config/aarch64/aarch64-cores.def (qdf24xx): Update part - number. + * config/aarch64/aarch64-cores.def (qdf24xx): Update part number. (falkor): New core. * config/aarch64/aarch64-tune.md: Regenerated. * config/arm/arm-cores.def (falkor): New core. @@ -217,6 +411,7 @@ PR target/78262 * config/i386/i386.md (*<shift_insn><mode>3_doubleword): Mark operand 0 as earlyclobber. + (*ashl<mode>3_doubleword): Ditto for all operand 0 alternatives. 2016-11-09 Martin Liska <mliska@suse.cz> diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 76fa9202480..293bb6dda98 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20161111 +20161114 diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4 index 38dd8994a21..791f2a72e64 100644 --- a/gcc/acinclude.m4 +++ b/gcc/acinclude.m4 @@ -550,6 +550,10 @@ AC_CACHE_CHECK([assembler for $1], [$2], ifelse([$7],,,[dnl if test $[$2] = yes; then $7 +fi]) +ifelse([$8],,,[dnl +if test $[$2] != yes; then + $8 fi])]) dnl gcc_SUN_LD_VERSION diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e37a0000fb8..937f9243e80 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,36 @@ +2016-11-14 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/Makefile.in: Replace s-interr-hwint.adb with + s-interr-vxworks.adb throughout. + +2016-11-13 Bob Duff <duff@adacore.com> + + * gcc-interface/decl.c (gnat_to_gnu_entity): In assertion about known + Esize, protect with !is_type and change !Unknown_Esize to Known_Esize. + +2016-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Signed_Integer_Subtype>: + Look at the underlying type for the signedness of the type. + +2016-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Deal specially + with negative constants. + +2016-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/utils2.c (gnat_protect_expr): Also protect only the + address if the expression is the component of a dereference. + Do not use a reference type for the final temporary reference. + +2016-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * gcc-interface/Makefile.in (NO_OMIT_ADAFLAGS): Define. + (a-except.o): Replace -fno-inline with NO_INLINE_ADAFLAGS. + (s-memory.o): New rule. + (tracebak.o): Replace -fno-omit-frame-pointer with NO_OMIT_ADAFLAGS. + 2016-11-07 Tamar Christina <tamar.christina@arm.com> * adaint.c: Added signal.h for Windows. diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index e22b4d20a00..ec8aa076cbb 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -107,6 +107,7 @@ ADA_CFLAGS = ADAFLAGS = -W -Wall -gnatpg -gnata FORCE_DEBUG_ADAFLAGS = -g NO_INLINE_ADAFLAGS = -fno-inline +NO_OMIT_ADAFLAGS = -fno-omit-frame-pointer NO_SIBLING_ADAFLAGS = -fno-optimize-sibling-calls NO_REORDER_ADAFLAGS = -fno-toplevel-reorder GNATLIBFLAGS = -W -Wall -gnatpg -nostdinc @@ -473,7 +474,7 @@ ifeq ($(strip $(filter-out m68k% wrs vx%,$(target_cpu) $(target_vendor) $(target a-intnam.ads<a-intnam-vxworks.ads \ a-numaux.ads<a-numaux-vxworks.ads \ s-inmaop.adb<s-inmaop-vxworks.adb \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-intman.ads<s-intman-vxworks.ads \ s-intman.adb<s-intman-vxworks.adb \ s-osinte.adb<s-osinte-vxworks.adb \ @@ -594,7 +595,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks vxworks7,$(target_cpu) $(target_ else ifeq ($(strip $(filter-out kernel-smp,$(THREAD_KIND))),) LIBGNAT_TARGET_PAIRS += \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-mudido.adb<s-mudido-affinity.adb \ s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \ s-vxwext.ads<s-vxwext-kernel.ads \ @@ -605,7 +606,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks vxworks7,$(target_cpu) $(target_ EXTRA_LIBGNAT_OBJS+=affinity.o else LIBGNAT_TARGET_PAIRS += \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-tpopsp.adb<s-tpopsp-vxworks.adb ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),) @@ -650,7 +651,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(target_cpu) $(target_vendor) a-numaux.ads<a-numaux-vxworks.ads \ g-io.adb<g-io-vxworks-ppc-cert.adb \ s-inmaop.adb<s-inmaop-vxworks.adb \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-intman.ads<s-intman-vxworks.ads \ s-intman.adb<s-intman-vxworks.adb \ s-osinte.adb<s-osinte-vxworks.adb \ @@ -716,7 +717,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksmils,$(target_cpu) $(target_vendo a-numaux.ads<a-numaux-vxworks.ads \ g-io.adb<g-io-vxworks-ppc-cert.adb \ s-inmaop.adb<s-inmaop-vxworks.adb \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-intman.ads<s-intman-vxworks.ads \ s-intman.adb<s-intman-vxworks.adb \ s-osinte.adb<s-osinte-vxworks.adb \ @@ -771,7 +772,7 @@ ifeq ($(strip $(filter-out %86 wrs vxworksae,$(target_cpu) $(target_vendor) $(ta a-numaux.ads<a-numaux-vxworks.ads \ g-io.adb<g-io-vxworks-ppc-cert.adb \ s-inmaop.adb<s-inmaop-vxworks.adb \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-intman.ads<s-intman-vxworks.ads \ s-intman.adb<s-intman-vxworks.adb \ s-osinte.adb<s-osinte-vxworks.adb \ @@ -834,7 +835,7 @@ ifeq ($(strip $(filter-out sparc% wrs vx%,$(target_cpu) $(target_vendor) $(targe a-intnam.ads<a-intnam-vxworks.ads \ a-numaux.ads<a-numaux-vxworks.ads \ s-inmaop.adb<s-inmaop-vxworks.adb \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-intman.ads<s-intman-vxworks.ads \ s-intman.adb<s-intman-vxworks.adb \ s-osinte.adb<s-osinte-vxworks.adb \ @@ -993,7 +994,7 @@ ifeq ($(strip $(filter-out %86 x86_64 wrs vxworks vxworks7,$(target_cpu) $(targe else ifeq ($(strip $(filter-out kernel-smp, $(THREAD_KIND))),) LIBGNAT_TARGET_PAIRS += \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-mudido.adb<s-mudido-affinity.adb \ s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \ s-vxwext.ads<s-vxwext-kernel.ads \ @@ -1003,7 +1004,7 @@ ifeq ($(strip $(filter-out %86 x86_64 wrs vxworks vxworks7,$(target_cpu) $(targe EXTRA_LIBGNAT_OBJS+=affinity.o else LIBGNAT_TARGET_PAIRS += \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-tpopsp.adb<s-tpopsp-vxworks.adb ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),) @@ -1059,7 +1060,7 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(target_cpu) $(target_vendor) $(ta a-intnam.ads<a-intnam-vxworks.ads \ a-numaux.ads<a-numaux-vxworks.ads \ s-inmaop.adb<s-inmaop-vxworks.adb \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-intman.ads<s-intman-vxworks.ads \ s-intman.adb<s-intman-vxworks.adb \ s-osinte.adb<s-osinte-vxworks.adb \ @@ -1143,7 +1144,7 @@ ifeq ($(strip $(filter-out mips% wrs vx%,$(target_cpu) $(target_vendor) $(target a-intnam.ads<a-intnam-vxworks.ads \ a-numaux.ads<a-numaux-vxworks.ads \ s-inmaop.adb<s-inmaop-vxworks.adb \ - s-interr.adb<s-interr-hwint.adb \ + s-interr.adb<s-interr-vxworks.adb \ s-intman.ads<s-intman-vxworks.ads \ s-intman.adb<s-intman-vxworks.adb \ s-osinte.adb<s-osinte-vxworks.adb \ @@ -1692,7 +1693,7 @@ ifeq ($(strip $(filter-out rtems%,$(target_os))),) s-taspri.ads<s-taspri-posix.ads \ s-tpopsp.adb<s-tpopsp-rtems.adb \ s-stchop.adb<s-stchop-rtems.adb \ - s-interr.adb<s-interr-hwint.adb + s-interr.adb<s-interr-vxworks.adb endif # PikeOS @@ -3016,8 +3017,8 @@ s-tasdeb.o : s-tasdeb.adb s-tasdeb.ads # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets. a-except.o : a-except.adb a-except.ads - $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \ - $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(NO_INLINE_ADAFLAGS) \ + $(NO_REORDER_ADAFLAGS) -O1 $(ADA_INCLUDES) $< $(OUTPUT_OPTION) # compile s-excdeb.o without optimization and with debug info to let the # debugger set breakpoints and inspect subprogram parameters on exception @@ -3041,11 +3042,19 @@ a-tags.o : a-tags.adb a-tags.ads $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \ $< $(OUTPUT_OPTION) -# need to keep the frame pointer in this file to pop the stack properly on +# force no sibling call optimization on s-memory.o to avoid turning the +# tail recursion in Alloc into a loop that confuses branch prediction. + +s-memory.o : s-memory.adb s-memory.ads + $(CC) -c $(ALL_ADAFLAGS) $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \ + $< $(OUTPUT_OPTION) + +# need to keep the frame pointer in tracebak.o to pop the stack properly on # some targets. + tracebak.o : tracebak.c tb-gcc.c $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \ - $(INCLUDES) -fno-omit-frame-pointer $< $(OUTPUT_OPTION) + $(INCLUDES) $(NO_OMIT_ADAFLAGS) $< $(OUTPUT_OPTION) adadecode.o : adadecode.c adadecode.h aux-io.o : aux-io.c diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 3aaaaca73ed..9de85ef8e4b 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -388,7 +388,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) must be specified unless it was specified by the programmer. Exceptions are for access-to-protected-subprogram types and all access subtypes, as another GNAT type is used to lay out the GCC type for them. */ - gcc_assert (!Unknown_Esize (gnat_entity) + gcc_assert (!is_type + || Known_Esize (gnat_entity) || Has_Size_Clause (gnat_entity) || (!IN (kind, Numeric_Kind) && !IN (kind, Enumeration_Kind) @@ -1836,7 +1837,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) && esize == CHAR_TYPE_SIZE && flag_signed_char) gnu_type = make_signed_type (CHAR_TYPE_SIZE); - else if (Is_Unsigned_Type (Etype (gnat_entity)) + else if (Is_Unsigned_Type (Underlying_Type (Etype (gnat_entity))) || (Esize (Etype (gnat_entity)) != Esize (gnat_entity) && Is_Unsigned_Type (gnat_entity)) || Has_Biased_Representation (gnat_entity)) @@ -8022,6 +8023,14 @@ annotate_value (tree gnu_size) switch (TREE_CODE (gnu_size)) { case INTEGER_CST: + /* For negative values, build NEGATE_EXPR of the opposite. Such values + can appear for discriminants in expressions for variants. */ + if (tree_int_cst_sgn (gnu_size) < 0) + { + tree t = wide_int_to_tree (sizetype, wi::neg (gnu_size)); + return annotate_value (build1 (NEGATE_EXPR, sizetype, t)); + } + return TREE_OVERFLOW (gnu_size) ? No_Uint : UI_From_gnu (gnu_size); case COMPONENT_REF: diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c index c0d831fb1e5..fc6f1b86bdc 100644 --- a/gcc/ada/gcc-interface/utils2.c +++ b/gcc/ada/gcc-interface/utils2.c @@ -2586,6 +2586,12 @@ gnat_protect_expr (tree exp) return t; } + /* Likewise if we're indirectly referencing part of something. */ + if (code == COMPONENT_REF + && TREE_CODE (TREE_OPERAND (exp, 0)) == INDIRECT_REF) + return build3 (code, type, gnat_protect_expr (TREE_OPERAND (exp, 0)), + TREE_OPERAND (exp, 1), NULL_TREE); + /* If this is a COMPONENT_REF of a fat pointer, save the entire fat pointer. This may be more efficient, but will also allow us to more easily find the match for the PLACEHOLDER_EXPR. */ @@ -2605,9 +2611,7 @@ gnat_protect_expr (tree exp) /* Otherwise reference, protect the address and dereference. */ return build_unary_op (INDIRECT_REF, type, - save_expr (build_unary_op (ADDR_EXPR, - build_reference_type (type), - exp))); + save_expr (build_unary_op (ADDR_EXPR, NULL_TREE, exp))); } /* This is equivalent to stabilize_reference_1 in tree.c but we take an extra diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 55c2e609606..2360d9ed17c 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,15 @@ +2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com> + Richard Biener <rguenther@suse.de> + + * c-common.h (c_common_resword): Add RID_GIMPLE, RID_PHI types. + * c-common.h (enum rid): Add RID_GIMPLE, RID_PHI. + * c.opt (fgimple): New option. + +2016-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * c-ada-spec.c (print_ada_declaration): For typedef declarations, look + for nested types only if the type is a record or union and dump SLOC. + 2016-11-09 Jason Merrill <jason@redhat.com> * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_template_auto. diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index a5395b69489..42a2cd3a302 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -2813,7 +2813,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc) } else { - if (!TREE_VISITED (stub) + if (RECORD_OR_UNION_TYPE_P (typ) && DECL_SOURCE_FILE (stub) == source_file_base) dump_nested_types (buffer, stub, stub, true, spc); @@ -2821,7 +2821,8 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc) dump_generic_ada_node (buffer, t, type, spc, false, true); pp_string (buffer, " is "); dump_generic_ada_node (buffer, typ, type, spc, false, true); - pp_semicolon (buffer); + pp_string (buffer, "; -- "); + dump_sloc (buffer, t); } TREE_VISITED (t) = 1; diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index 1fbe06038a4..241b3454e06 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -1498,6 +1498,7 @@ extern void warnings_for_convert_and_check (location_t, tree, tree, tree); extern void c_do_switch_warnings (splay_tree, location_t, tree, tree, bool, bool); extern void warn_for_omitted_condop (location_t, tree); +extern void warn_for_restrict (unsigned, vec<tree, va_gc> *); /* Places where an lvalue, or modifiable lvalue, may be required. Used to select diagnostic messages in lvalue_error and diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index bf39ee06e79..8a4bf6f0d29 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -713,6 +713,7 @@ static const format_char_info gcc_tdiag_char_table[] = { "r", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "cR", NULL }, { "<>'R",0, STD_C89, NOARGUMENTS, "", "", NULL }, { "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL }, + { "Z", 1, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "", &gcc_tdiag_char_table[0] }, { NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL } }; @@ -736,6 +737,7 @@ static const format_char_info gcc_cdiag_char_table[] = { "r", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "cR", NULL }, { "<>'R",0, STD_C89, NOARGUMENTS, "", "", NULL }, { "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL }, + { "Z", 1, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "", &gcc_tdiag_char_table[0] }, { NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL } }; @@ -762,6 +764,7 @@ static const format_char_info gcc_cxxdiag_char_table[] = { "r", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "cR", NULL }, { "<>'R",0, STD_C89, NOARGUMENTS, "", "", NULL }, { "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL }, + { "Z", 1, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "", &gcc_tdiag_char_table[0] }, { NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL } }; diff --git a/gcc/c-family/c-warn.c b/gcc/c-family/c-warn.c index 18ee24787a9..7197fe3d750 100644 --- a/gcc/c-family/c-warn.c +++ b/gcc/c-family/c-warn.c @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "diagnostic.h" #include "intl.h" #include "asan.h" +#include "gcc-rich-location.h" /* Print a warning if a constant expression had overflow in folding. Invoke this function on every expression that the language @@ -2161,3 +2162,58 @@ maybe_warn_bool_compare (location_t loc, enum tree_code code, tree op0, "with boolean expression is always false", cst); } } + +/* Warn if an argument at position param_pos is passed to a + restrict-qualified param, and it aliases with another argument. */ + +void +warn_for_restrict (unsigned param_pos, vec<tree, va_gc> *args) +{ + tree arg = (*args)[param_pos]; + if (TREE_VISITED (arg) || operand_equal_p (arg, null_pointer_node, 0)) + return; + + location_t loc = EXPR_LOC_OR_LOC (arg, input_location); + gcc_rich_location richloc (loc); + + unsigned i; + tree current_arg; + int *arg_positions = XNEWVEC (int, args->length ()); + unsigned arg_positions_len = 0; + + FOR_EACH_VEC_ELT (*args, i, current_arg) + { + if (i == param_pos) + continue; + + tree current_arg = (*args)[i]; + if (operand_equal_p (arg, current_arg, 0)) + { + TREE_VISITED (current_arg) = 1; + arg_positions[arg_positions_len++] = (i + 1); + } + } + + if (arg_positions_len == 0) + { + free (arg_positions); + return; + } + + for (unsigned i = 0; i < arg_positions_len; i++) + { + unsigned pos = arg_positions[i]; + tree arg = (*args)[pos - 1]; + if (EXPR_HAS_LOCATION (arg)) + richloc.add_range (EXPR_LOCATION (arg), false); + } + + warning_at_rich_loc_n (&richloc, OPT_Wrestrict, arg_positions_len, + "passing argument %i to restrict-qualified parameter" + " aliases with argument %Z", + "passing argument %i to restrict-qualified parameter" + " aliases with arguments %Z", + param_pos + 1, arg_positions, arg_positions_len); + + free (arg_positions); +} diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 2476954c067..722d3800cf0 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -1089,6 +1089,11 @@ Wduplicate-decl-specifier C ObjC Var(warn_duplicate_decl_specifier) Warning LangEnabledBy(C ObjC,Wall) Warn when a declaration has duplicate const, volatile, restrict or _Atomic specifier. +Wrestrict +C ObjC C++ ObjC++ Var(warn_restrict) Warning LangEnabledBy(C ObjC C++ ObjC++) +Warn when an argument passed to a restrict-qualified parameter aliases with +another argument. + ansi C ObjC C++ ObjC++ A synonym for -std=c89 (for C) or -std=c++98 (for C++). diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index ee50c304b5f..75f39d7ed8b 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,42 @@ +2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com> + Richard Biener <rguenther@suse.de> + + * Make-lang.in (C_AND_OBJC_OBJS): Add gimple-parser.o. + * config-lang.in (gtfiles): Add c/c-parser.h. + * c-tree.h (enum c_declspec_word): Add cdw_gimple. + (struct c_declspecs): Add gimple_pass member and gimple_p flag. + * c-parser.c (enum c_id_kind, struct c_token, + c_parser_next_token_is, c_parser_next_token_is_not, + c_parser_next_token_is_keyword, + enum c_lookahead_kind, enum c_dtr_syn, enum c_parser_prec): + Split out to ... + * c-parser.h: ... new header. + * c-parser.c: Include c-parser.h and gimple-parser.h. + (c_parser_peek_token, c_parser_peek_2nd_token, + c_token_starts_typename, c_parser_next_token_starts_declspecs, + c_parser_next_tokens_start_declaration, c_parser_consume_token, + c_parser_error, c_parser_require, c_parser_skip_until_found, + c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token, + c_parser_type_name): Export. + (c_parser_tokens_buf): New function. + (c_parser_error): Likewise. + (c_parser_set_error): Likewise. + (c_parser_declspecs): Handle RID_GIMPLE. + (c_parser_declaration_or_fndef): Parse __GIMPLE marked body + via c_parser_parse_gimple_body. + * c-parser.h (c_parser_peek_token, c_parser_peek_2nd_token, + c_token_starts_typename, c_parser_next_token_starts_declspecs, + c_parser_next_tokens_start_declaration, c_parser_consume_token, + c_parser_error, c_parser_require, c_parser_skip_until_found, + c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token, + c_parser_type_name): Declare. + (struct c_parser): Declare forward. + (c_parser_tokens_buf): Declare. + (c_parser_error): Likewise. + (c_parser_set_error): Likewise. + * gimple-parser.c: New file. + * gimple-parser.h: Likewise. + 2016-09-11 Le-Chun Wu <lcwu@google.com> Mark Wielaard <mjw@redhat.com> diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 08a7d788a01..00fe7312c4c 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -8374,6 +8374,28 @@ c_parser_postfix_expression_after_primary (c_parser *parser, warn_for_memset (expr_loc, arg0, arg2, literal_zero_mask); } + if (TREE_CODE (expr.value) == FUNCTION_DECL && warn_restrict) + { + unsigned i; + tree arg; + FOR_EACH_VEC_SAFE_ELT (exprlist, i, arg) + TREE_VISITED (arg) = 0; + + unsigned param_pos = 0; + function_args_iterator iter; + tree t; + FOREACH_FUNCTION_ARGS (TREE_TYPE (expr.value), t, iter) + { + if (POINTER_TYPE_P (t) && TYPE_RESTRICT (t) + && !TYPE_READONLY (TREE_TYPE (t))) + warn_for_restrict (param_pos, exprlist); + param_pos++; + } + + FOR_EACH_VEC_SAFE_ELT (exprlist, i, arg) + TREE_VISITED (arg) = 0; + } + start = expr.get_start (); finish = parser->tokens_buf[0].get_finish (); expr.value diff --git a/gcc/combine.c b/gcc/combine.c index 6ffa387a95c..6b7bdd0f687 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -9895,18 +9895,17 @@ reg_nonzero_bits_for_combine (const_rtx x, machine_mode mode, (DF_LR_IN (ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb), REGNO (x))))) { - unsigned HOST_WIDE_INT mask = rsp->last_set_nonzero_bits; - - if (GET_MODE_PRECISION (rsp->last_set_mode) < GET_MODE_PRECISION (mode)) - /* We don't know anything about the upper bits. */ - mask |= GET_MODE_MASK (mode) ^ GET_MODE_MASK (rsp->last_set_mode); - - *nonzero &= mask; + /* Note that, even if the precision of last_set_mode is lower than that + of mode, record_value_for_reg invoked nonzero_bits on the register + with nonzero_bits_mode (because last_set_mode is necessarily integral + and HWI_COMPUTABLE_MODE_P in this case) so bits in nonzero_bits_mode + are all valid, hence in mode too since nonzero_bits_mode is defined + to the largest HWI_COMPUTABLE_MODE_P mode. */ + *nonzero &= rsp->last_set_nonzero_bits; return NULL; } tem = get_last_value (x); - if (tem) { if (SHORT_IMMEDIATES_SIGN_EXTEND) @@ -9915,7 +9914,8 @@ reg_nonzero_bits_for_combine (const_rtx x, machine_mode mode, return tem; } - else if (nonzero_sign_valid && rsp->nonzero_bits) + + if (nonzero_sign_valid && rsp->nonzero_bits) { unsigned HOST_WIDE_INT mask = rsp->nonzero_bits; diff --git a/gcc/common.opt b/gcc/common.opt index 314145a09d3..5e8d72d6ae6 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -1959,7 +1959,7 @@ Enable correction of flow inconsistent profile data input. fprofile-update= Common Joined RejectNegative Enum(profile_update) Var(flag_profile_update) Init(PROFILE_UPDATE_SINGLE) --fprofile-update=[single|atomic] Set the profile update method. +-fprofile-update=[single|atomic|prefer-atomic] Set the profile update method. Enum Name(profile_update) Type(enum profile_update) UnknownError(unknown profile update method %qs) @@ -1970,6 +1970,9 @@ Enum(profile_update) String(single) Value(PROFILE_UPDATE_SINGLE) EnumValue Enum(profile_update) String(atomic) Value(PROFILE_UPDATE_ATOMIC) +EnumValue +Enum(profile_update) String(prefer-atomic) Value(PROFILE_UPDATE_PREFER_ATOMIC) + fprofile-generate Common Enable common options for generating profile info for profile feedback directed optimizations. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index b7d4640826a..bd97c5b701c 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -398,12 +398,12 @@ static const struct cpu_vector_cost cortexa57_vector_cost = 1, /* scalar_stmt_cost */ 4, /* scalar_load_cost */ 1, /* scalar_store_cost */ - 3, /* vec_stmt_cost */ + 2, /* vec_stmt_cost */ 3, /* vec_permute_cost */ 8, /* vec_to_scalar_cost */ 8, /* scalar_to_vec_cost */ - 5, /* vec_align_load_cost */ - 5, /* vec_unalign_load_cost */ + 4, /* vec_align_load_cost */ + 4, /* vec_unalign_load_cost */ 1, /* vec_unalign_store_cost */ 1, /* vec_store_cost */ 1, /* cond_taken_branch_cost */ diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 46eaa30b159..a652a7c12bd 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -3955,7 +3955,7 @@ shl\t%<rtn>0<vas>, %<rtn>1<vas>, %2 ushl\t%<rtn>0<vas>, %<rtn>1<vas>, %<rtn>2<vas>" [(set_attr "simd" "no,no,yes,yes") - (set_attr "type" "bfm,shift_reg,neon_shift_imm<q>, neon_shift_reg<q>")] + (set_attr "type" "bfx,shift_reg,neon_shift_imm<q>, neon_shift_reg<q>")] ) ;; Logical right shift using SISD or Integer instruction @@ -3972,7 +3972,7 @@ # #" [(set_attr "simd" "no,no,yes,yes,yes") - (set_attr "type" "bfm,shift_reg,neon_shift_imm<q>,neon_shift_reg<q>,neon_shift_reg<q>")] + (set_attr "type" "bfx,shift_reg,neon_shift_imm<q>,neon_shift_reg<q>,neon_shift_reg<q>")] ) (define_split @@ -4019,7 +4019,7 @@ # #" [(set_attr "simd" "no,no,yes,yes,yes") - (set_attr "type" "bfm,shift_reg,neon_shift_imm<q>,neon_shift_reg<q>,neon_shift_reg<q>")] + (set_attr "type" "bfx,shift_reg,neon_shift_imm<q>,neon_shift_reg<q>,neon_shift_reg<q>")] ) (define_split @@ -4129,7 +4129,7 @@ "@ <shift>\\t%w0, %w1, %2 <shift>\\t%w0, %w1, %w2" - [(set_attr "type" "bfm,shift_reg")] + [(set_attr "type" "bfx,shift_reg")] ) (define_insn "*<optab><mode>3_insn" @@ -4141,7 +4141,7 @@ operands[3] = GEN_INT (<sizen> - UINTVAL (operands[2])); return "<bfshift>\t%w0, %w1, %2, %3"; } - [(set_attr "type" "bfm")] + [(set_attr "type" "bfx")] ) (define_insn "*extr<mode>5_insn" @@ -4234,7 +4234,7 @@ operands[3] = GEN_INT (<SHORT:sizen> - UINTVAL (operands[2])); return "<su>bfiz\t%<GPI:w>0, %<GPI:w>1, %2, %3"; } - [(set_attr "type" "bfm")] + [(set_attr "type" "bfx")] ) (define_insn "*zero_extend<GPI:mode>_lshr<SHORT:mode>" @@ -4247,7 +4247,7 @@ operands[3] = GEN_INT (<SHORT:sizen> - UINTVAL (operands[2])); return "ubfx\t%<GPI:w>0, %<GPI:w>1, %2, %3"; } - [(set_attr "type" "bfm")] + [(set_attr "type" "bfx")] ) (define_insn "*extend<GPI:mode>_ashr<SHORT:mode>" @@ -4260,7 +4260,7 @@ operands[3] = GEN_INT (<SHORT:sizen> - UINTVAL (operands[2])); return "sbfx\\t%<GPI:w>0, %<GPI:w>1, %2, %3"; } - [(set_attr "type" "bfm")] + [(set_attr "type" "bfx")] ) ;; ------------------------------------------------------------------- @@ -4292,7 +4292,7 @@ "IN_RANGE (INTVAL (operands[2]) + INTVAL (operands[3]), 1, GET_MODE_BITSIZE (<MODE>mode) - 1)" "<su>bfx\\t%<w>0, %<w>1, %3, %2" - [(set_attr "type" "bfm")] + [(set_attr "type" "bfx")] ) ;; Bitfield Insert (insv) @@ -4374,7 +4374,7 @@ : GEN_INT (<GPI:sizen> - UINTVAL (operands[2])); return "<su>bfiz\t%<GPI:w>0, %<GPI:w>1, %2, %3"; } - [(set_attr "type" "bfm")] + [(set_attr "type" "bfx")] ) ;; XXX We should match (any_extend (ashift)) here, like (and (ashift)) below @@ -4386,7 +4386,7 @@ (match_operand 3 "const_int_operand" "n")))] "aarch64_mask_and_shift_for_ubfiz_p (<MODE>mode, operands[3], operands[2])" "ubfiz\\t%<w>0, %<w>1, %2, %P3" - [(set_attr "type" "bfm")] + [(set_attr "type" "bfx")] ) (define_insn "bswap<mode>2" diff --git a/gcc/config/aarch64/thunderx.md b/gcc/config/aarch64/thunderx.md index 058713a2ad9..7c1c28b0498 100644 --- a/gcc/config/aarch64/thunderx.md +++ b/gcc/config/aarch64/thunderx.md @@ -39,7 +39,7 @@ (define_insn_reservation "thunderx_shift" 1 (and (eq_attr "tune" "thunderx") - (eq_attr "type" "bfm,extend,rotate_imm,shift_imm,shift_reg,rbit,rev")) + (eq_attr "type" "bfm,bfx,extend,rotate_imm,shift_imm,shift_reg,rbit,rev")) "thunderx_pipe0 | thunderx_pipe1") diff --git a/gcc/config/arm/cortex-a53.md b/gcc/config/arm/cortex-a53.md index 70c0f4daabe..eb6d0b04976 100644 --- a/gcc/config/arm/cortex-a53.md +++ b/gcc/config/arm/cortex-a53.md @@ -93,7 +93,7 @@ (and (eq_attr "tune" "cortexa53") (eq_attr "type" "alu_shift_imm,alus_shift_imm, crc,logic_shift_imm,logics_shift_imm, - alu_ext,alus_ext,bfm,extend,mvn_shift")) + alu_ext,alus_ext,bfm,bfx,extend,mvn_shift")) "cortex_a53_slot_any") (define_insn_reservation "cortex_a53_alu_shift_reg" 3 diff --git a/gcc/config/arm/cortex-a57.md b/gcc/config/arm/cortex-a57.md index 85b18e5970f..63072509e50 100644 --- a/gcc/config/arm/cortex-a57.md +++ b/gcc/config/arm/cortex-a57.md @@ -297,7 +297,7 @@ (eq_attr "type" "alu_imm,alus_imm,logic_imm,logics_imm,\ alu_sreg,alus_sreg,logic_reg,logics_reg,\ adc_imm,adcs_imm,adc_reg,adcs_reg,\ - adr,bfm,clz,csel,rbit,rev,alu_dsp_reg,\ + adr,bfx,extend,clz,rbit,rev,alu_dsp_reg,\ rotate_imm,shift_imm,shift_reg,\ mov_imm,mov_reg,\ mvn_imm,mvn_reg,\ @@ -307,7 +307,7 @@ ;; ALU ops with immediate shift (define_insn_reservation "cortex_a57_alu_shift" 3 (and (eq_attr "tune" "cortexa57") - (eq_attr "type" "extend,\ + (eq_attr "type" "bfm,\ alu_shift_imm,alus_shift_imm,\ crc,logic_shift_imm,logics_shift_imm,\ mov_shift,mvn_shift")) diff --git a/gcc/config/arm/exynos-m1.md b/gcc/config/arm/exynos-m1.md index 318b151d646..00574d7930f 100644 --- a/gcc/config/arm/exynos-m1.md +++ b/gcc/config/arm/exynos-m1.md @@ -358,7 +358,7 @@ (eq_attr "type" "alu_imm, alus_imm, logic_imm, logics_imm,\ alu_sreg, alus_sreg, logic_reg, logics_reg,\ adc_imm, adcs_imm, adc_reg, adcs_reg,\ - adr, bfm, clz, rbit, rev, csel, alu_dsp_reg,\ + adr, bfm, bfx, clz, rbit, rev, csel, alu_dsp_reg,\ shift_imm, shift_reg, rotate_imm, extend,\ mov_imm, mov_reg,\ mvn_imm, mvn_reg,\ @@ -372,7 +372,7 @@ (eq_attr "type" "alu_imm, alus_imm, logic_imm, logics_imm,\ alu_sreg, alus_sreg, logic_reg, logics_reg,\ adc_imm, adcs_imm, adc_reg, adcs_reg,\ - adr, bfm, clz, rbit, rev, alu_dsp_reg,\ + adr, bfm, bfx, clz, rbit, rev, alu_dsp_reg,\ shift_imm, shift_reg, rotate_imm, extend,\ mov_imm, mov_reg,\ mvn_imm, mvn_reg,\ diff --git a/gcc/config/arm/types.md b/gcc/config/arm/types.md index 25f79b4d010..7a95a3704d0 100644 --- a/gcc/config/arm/types.md +++ b/gcc/config/arm/types.md @@ -51,6 +51,7 @@ ; alus_shift_imm as alu_shift_imm, setting condition flags. ; alus_shift_reg as alu_shift_reg, setting condition flags. ; bfm bitfield move operation. +; bfx bitfield extract operation. ; block blockage insn, this blocks all functional units. ; branch branch. ; call subroutine call. @@ -557,6 +558,7 @@ alus_shift_imm,\ alus_shift_reg,\ bfm,\ + bfx,\ block,\ branch,\ call,\ diff --git a/gcc/config/arm/xgene1.md b/gcc/config/arm/xgene1.md index b7aeac69163..4f27b28461f 100644 --- a/gcc/config/arm/xgene1.md +++ b/gcc/config/arm/xgene1.md @@ -164,7 +164,7 @@ (define_insn_reservation "xgene1_bfm" 2 (and (eq_attr "tune" "xgene1") - (eq_attr "type" "bfm")) + (eq_attr "type" "bfm,bfx")) "xgene1_decode1op,xgene1_fsu") (define_insn_reservation "xgene1_f_rint" 5 diff --git a/gcc/config/avr/avr-arch.h b/gcc/config/avr/avr-arch.h index 42eaee56b7b..a740a151105 100644 --- a/gcc/config/avr/avr-arch.h +++ b/gcc/config/avr/avr-arch.h @@ -157,7 +157,9 @@ enum avr_device_specific_features AVR_ISA_NONE, AVR_ISA_RMW = 0x1, /* device has RMW instructions. */ AVR_SHORT_SP = 0x2, /* Stack Pointer has 8 bits width. */ - AVR_ERRATA_SKIP = 0x4 /* device has a core erratum. */ + AVR_ERRATA_SKIP = 0x4, /* device has a core erratum. */ + AVR_ISA_LDS = 0x8 /* whether LDS / STS is valid for all data in static + storage. Only useful for reduced Tiny. */ }; /* Map architecture to its texinfo string. */ diff --git a/gcc/config/avr/avr-mcus.def b/gcc/config/avr/avr-mcus.def index 6bcc6ff08ae..e5b4cdaf660 100644 --- a/gcc/config/avr/avr-mcus.def +++ b/gcc/config/avr/avr-mcus.def @@ -341,11 +341,11 @@ AVR_MCU ("atxmega128a1u", ARCH_AVRXMEGA7, AVR_ISA_RMW, "__AVR_ATxmega128A1U_ AVR_MCU ("atxmega128a4u", ARCH_AVRXMEGA7, AVR_ISA_RMW, "__AVR_ATxmega128A4U__", 0x2000, 0x0, 3) /* Tiny family */ AVR_MCU ("avrtiny", ARCH_AVRTINY, AVR_ISA_NONE, NULL, 0x0040, 0x0, 1) -AVR_MCU ("attiny4", ARCH_AVRTINY, AVR_ISA_NONE, "__AVR_ATtiny4__", 0x0040, 0x0, 1) -AVR_MCU ("attiny5", ARCH_AVRTINY, AVR_ISA_NONE, "__AVR_ATtiny5__", 0x0040, 0x0, 1) -AVR_MCU ("attiny9", ARCH_AVRTINY, AVR_ISA_NONE, "__AVR_ATtiny9__", 0x0040, 0x0, 1) -AVR_MCU ("attiny10", ARCH_AVRTINY, AVR_ISA_NONE, "__AVR_ATtiny10__", 0x0040, 0x0, 1) -AVR_MCU ("attiny20", ARCH_AVRTINY, AVR_ISA_NONE, "__AVR_ATtiny20__", 0x0040, 0x0, 1) +AVR_MCU ("attiny4", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny4__", 0x0040, 0x0, 1) +AVR_MCU ("attiny5", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny5__", 0x0040, 0x0, 1) +AVR_MCU ("attiny9", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny9__", 0x0040, 0x0, 1) +AVR_MCU ("attiny10", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny10__", 0x0040, 0x0, 1) +AVR_MCU ("attiny20", ARCH_AVRTINY, AVR_ISA_LDS, "__AVR_ATtiny20__", 0x0040, 0x0, 1) AVR_MCU ("attiny40", ARCH_AVRTINY, AVR_ISA_NONE, "__AVR_ATtiny40__", 0x0040, 0x0, 1) /* Assembler only. */ AVR_MCU ("avr1", ARCH_AVR1, AVR_ISA_NONE, NULL, 0x0060, 0x0, 1) diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 7ad2b6422b0..b6899a4b69a 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -10182,14 +10182,18 @@ avr_encode_section_info (tree decl, rtx rtl, int new_decl_p) && SYMBOL_REF_P (XEXP (rtl, 0))) { rtx sym = XEXP (rtl, 0); + bool progmem_p = -1 == avr_progmem_p (decl, DECL_ATTRIBUTES (decl)); - if (-1 == avr_progmem_p (decl, DECL_ATTRIBUTES (decl))) + if (progmem_p) { // Tag symbols for later addition of 0x4000 (AVR_TINY_PM_OFFSET). SYMBOL_REF_FLAGS (sym) |= AVR_SYMBOL_FLAG_TINY_PM; } if (avr_decl_absdata_p (decl, DECL_ATTRIBUTES (decl)) + || (TARGET_ABSDATA + && !progmem_p + && !addr_attr) || (addr_attr // If addr_attr is non-null, it has an argument. Peek into it. && TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (addr_attr))) < 0xc0)) @@ -10198,7 +10202,7 @@ avr_encode_section_info (tree decl, rtx rtl, int new_decl_p) SYMBOL_REF_FLAGS (sym) |= AVR_SYMBOL_FLAG_TINY_ABSDATA; } - if (-1 == avr_progmem_p (decl, DECL_ATTRIBUTES (decl)) + if (progmem_p && avr_decl_absdata_p (decl, DECL_ATTRIBUTES (decl))) { error ("%q+D has incompatible attributes %qs and %qs", diff --git a/gcc/config/avr/avr.opt b/gcc/config/avr/avr.opt index 1af792b8df0..9ad6c5ab8d7 100644 --- a/gcc/config/avr/avr.opt +++ b/gcc/config/avr/avr.opt @@ -99,6 +99,10 @@ mfract-convert-truncate Target Report Mask(FRACT_CONV_TRUNC) Allow to use truncation instead of rounding towards zero for fractional fixed-point types. +mabsdata +Target Report Mask(ABSDATA) +Assume that all data in static storage can be accessed by LDS / STS. This option is only useful for reduced Tiny devices. + nodevicelib Driver Target Report RejectNegative Do not link against the device-specific library lib<MCU>.a. diff --git a/gcc/config/avr/gen-avr-mmcu-specs.c b/gcc/config/avr/gen-avr-mmcu-specs.c index 7fca756ae62..9ea987f6add 100644 --- a/gcc/config/avr/gen-avr-mmcu-specs.c +++ b/gcc/config/avr/gen-avr-mmcu-specs.c @@ -130,6 +130,7 @@ print_mcu (const avr_mcu_t *mcu) FILE *f = fopen (name ,"w"); + bool absdata = 0 != (mcu->dev_attribute & AVR_ISA_LDS); bool errata_skip = 0 != (mcu->dev_attribute & AVR_ERRATA_SKIP); bool rmw = 0 != (mcu->dev_attribute & AVR_ISA_RMW); bool sp8 = 0 != (mcu->dev_attribute & AVR_SHORT_SP); @@ -189,6 +190,10 @@ print_mcu (const avr_mcu_t *mcu) ? "\t%{!mno-skip-bug: -mskip-bug}" : "\t%{!mskip-bug: -mno-skip-bug}"); + fprintf (f, "*cc1_absdata:\n%s\n\n", absdata + ? "\t%{!mno-absdata: -mabsdata}" + : "\t%{mabsdata}"); + // avr-gcc specific specs for assembling / the assembler. fprintf (f, "*asm_arch:\n\t-mmcu=%s\n\n", arch->name); diff --git a/gcc/config/avr/specs.h b/gcc/config/avr/specs.h index 52763cc607a..222ad5badae 100644 --- a/gcc/config/avr/specs.h +++ b/gcc/config/avr/specs.h @@ -34,7 +34,8 @@ along with GCC; see the file COPYING3. If not see #define CC1_SPEC \ "%(cc1_n_flash) " \ "%(cc1_errata_skip) " \ - "%(cc1_rmw) " + "%(cc1_rmw) " \ + "%(cc1_absdata) " #undef CC1PLUS_SPEC #define CC1PLUS_SPEC \ diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index a5650a1ea14..ac2650b2910 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -9704,7 +9704,7 @@ "ix86_expand_binary_operator (ASHIFT, <MODE>mode, operands); DONE;") (define_insn "*ashl<mode>3_doubleword" - [(set (match_operand:DWI 0 "register_operand" "=&r,r") + [(set (match_operand:DWI 0 "register_operand" "=&r,&r") (ashift:DWI (match_operand:DWI 1 "reg_or_pm1_operand" "n,0") (match_operand:QI 2 "nonmemory_operand" "<S>c,<S>c"))) (clobber (reg:CC FLAGS_REG))] @@ -10908,8 +10908,9 @@ [(set (match_dup 0) (rotatert:SWI48 (match_dup 1) (match_dup 2)))] { - operands[2] - = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - INTVAL (operands[2])); + int bitsize = GET_MODE_BITSIZE (<MODE>mode); + + operands[2] = GEN_INT ((bitsize - INTVAL (operands[2])) % bitsize); }) (define_split @@ -10975,8 +10976,9 @@ [(set (match_dup 0) (zero_extend:DI (rotatert:SI (match_dup 1) (match_dup 2))))] { - operands[2] - = GEN_INT (GET_MODE_BITSIZE (SImode) - INTVAL (operands[2])); + int bitsize = GET_MODE_BITSIZE (SImode); + + operands[2] = GEN_INT ((bitsize - INTVAL (operands[2])) % bitsize); }) (define_split diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index 5cac839da28..802aa7459af 100644 --- a/gcc/config/rs6000/altivec.md +++ b/gcc/config/rs6000/altivec.md @@ -2785,7 +2785,7 @@ rtx vtmp1 = gen_reg_rtx (V4SImode); rtx vtmp2 = gen_reg_rtx (<MODE>mode); rtx dest = gen_lowpart (V4SImode, vtmp2); - int elt = BYTES_BIG_ENDIAN ? GET_MODE_NUNITS (<MODE>mode) - 1 : 0; + int elt = VECTOR_ELT_ORDER_BIG ? GET_MODE_NUNITS (<MODE>mode) - 1 : 0; emit_insn (gen_altivec_vspltisw (vzero, const0_rtx)); emit_insn (gen_altivec_vsum4s<VI_char>s (vtmp1, operands[1], vzero)); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index ac0bcbdcd50..609f26707c2 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -30412,53 +30412,54 @@ rs6000_output_function_epilogue (FILE *file, seems to set the bit when not optimizing. */ fprintf (file, "%d\n", ((float_parms << 1) | (! optimize))); - if (! optional_tbtab) - return; - - /* Optional fields follow. Some are variable length. */ - - /* Parameter types, left adjusted bit fields: 0 fixed, 10 single float, - 11 double float. */ - /* There is an entry for each parameter in a register, in the order that - they occur in the parameter list. Any intervening arguments on the - stack are ignored. If the list overflows a long (max possible length - 34 bits) then completely leave off all elements that don't fit. */ - /* Only emit this long if there was at least one parameter. */ - if (fixed_parms || float_parms) - fprintf (file, "\t.long %d\n", parm_info); - - /* Offset from start of code to tb table. */ - fputs ("\t.long ", file); - ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LT"); - RS6000_OUTPUT_BASENAME (file, fname); - putc ('-', file); - rs6000_output_function_entry (file, fname); - putc ('\n', file); + if (optional_tbtab) + { + /* Optional fields follow. Some are variable length. */ + + /* Parameter types, left adjusted bit fields: 0 fixed, 10 single + float, 11 double float. */ + /* There is an entry for each parameter in a register, in the order + that they occur in the parameter list. Any intervening arguments + on the stack are ignored. If the list overflows a long (max + possible length 34 bits) then completely leave off all elements + that don't fit. */ + /* Only emit this long if there was at least one parameter. */ + if (fixed_parms || float_parms) + fprintf (file, "\t.long %d\n", parm_info); + + /* Offset from start of code to tb table. */ + fputs ("\t.long ", file); + ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LT"); + RS6000_OUTPUT_BASENAME (file, fname); + putc ('-', file); + rs6000_output_function_entry (file, fname); + putc ('\n', file); - /* Interrupt handler mask. */ - /* Omit this long, since we never set the interrupt handler bit - above. */ + /* Interrupt handler mask. */ + /* Omit this long, since we never set the interrupt handler bit + above. */ - /* Number of CTL (controlled storage) anchors. */ - /* Omit this long, since the has_ctl bit is never set above. */ + /* Number of CTL (controlled storage) anchors. */ + /* Omit this long, since the has_ctl bit is never set above. */ - /* Displacement into stack of each CTL anchor. */ - /* Omit this list of longs, because there are no CTL anchors. */ + /* Displacement into stack of each CTL anchor. */ + /* Omit this list of longs, because there are no CTL anchors. */ - /* Length of function name. */ - if (*fname == '*') - ++fname; - fprintf (file, "\t.short %d\n", (int) strlen (fname)); + /* Length of function name. */ + if (*fname == '*') + ++fname; + fprintf (file, "\t.short %d\n", (int) strlen (fname)); - /* Function name. */ - assemble_string (fname, strlen (fname)); + /* Function name. */ + assemble_string (fname, strlen (fname)); - /* Register for alloca automatic storage; this is always reg 31. - Only emit this if the alloca bit was set above. */ - if (frame_pointer_needed) - fputs ("\t.byte 31\n", file); + /* Register for alloca automatic storage; this is always reg 31. + Only emit this if the alloca bit was set above. */ + if (frame_pointer_needed) + fputs ("\t.byte 31\n", file); - fputs ("\t.align 2\n", file); + fputs ("\t.align 2\n", file); + } } /* Arrange to define .LCTOC1 label, if not already done. */ @@ -35672,7 +35673,9 @@ rs6000_asm_weaken_decl (FILE *stream, tree decl, fputc ('\n', stream); if (val) { +#ifdef ASM_OUTPUT_DEF ASM_OUTPUT_DEF (stream, name, val); +#endif if (decl && TREE_CODE (decl) == FUNCTION_DECL && DEFAULT_ABI == ABI_AIX && DOT_SYMBOLS) { diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index ebb0f6dc099..c5a57cbebb6 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -2542,10 +2542,13 @@ "VECTOR_MEM_VSX_P (<MODE>mode) && TARGET_VEXTRACTUB && TARGET_VSX_SMALL_INTEGER" { - /* Note, the element number has already been adjusted for endianness, so we - don't have to adjust it here. */ - int unit_size = GET_MODE_UNIT_SIZE (<MODE>mode); - HOST_WIDE_INT offset = unit_size * INTVAL (operands[2]); + HOST_WIDE_INT elt = INTVAL (operands[2]); + HOST_WIDE_INT elt_adj = (!VECTOR_ELT_ORDER_BIG + ? GET_MODE_NUNITS (<MODE>mode) - 1 - elt + : elt); + + HOST_WIDE_INT unit_size = GET_MODE_UNIT_SIZE (<MODE>mode); + HOST_WIDE_INT offset = unit_size * elt_adj; operands[2] = GEN_INT (offset); if (unit_size == 4) diff --git a/gcc/configure b/gcc/configure index 0f04033bc1d..197a152dfa8 100755 --- a/gcc/configure +++ b/gcc/configure @@ -22432,6 +22432,7 @@ $as_echo "#define HAVE_GAS_BALIGN_AND_P2ALIGN 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .p2align with maximum skip" >&5 $as_echo_n "checking assembler for .p2align with maximum skip... " >&6; } if test "${gcc_cv_as_max_skip_p2align+set}" = set; then : @@ -22467,6 +22468,7 @@ $as_echo "#define HAVE_GAS_MAX_SKIP_P2ALIGN 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .literal16" >&5 $as_echo_n "checking assembler for .literal16... " >&6; } if test "${gcc_cv_as_literal16+set}" = set; then : @@ -22502,6 +22504,7 @@ $as_echo "#define HAVE_GAS_LITERAL16 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for working .subsection -1" >&5 $as_echo_n "checking assembler for working .subsection -1... " >&6; } if test "${gcc_cv_as_subsection_m1+set}" = set; then : @@ -22549,6 +22552,7 @@ $as_echo "#define HAVE_GAS_SUBSECTION_ORDERING 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .weak" >&5 $as_echo_n "checking assembler for .weak... " >&6; } if test "${gcc_cv_as_weak+set}" = set; then : @@ -22584,6 +22588,7 @@ $as_echo "#define HAVE_GAS_WEAK 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .weakref" >&5 $as_echo_n "checking assembler for .weakref... " >&6; } if test "${gcc_cv_as_weakref+set}" = set; then : @@ -22619,6 +22624,7 @@ $as_echo "#define HAVE_GAS_WEAKREF 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .nsubspa comdat" >&5 $as_echo_n "checking assembler for .nsubspa comdat... " >&6; } if test "${gcc_cv_as_nsubspa_comdat+set}" = set; then : @@ -22655,6 +22661,7 @@ $as_echo "#define HAVE_GAS_NSUBSPA_COMDAT 1" >>confdefs.h fi + # .hidden needs to be supported in both the assembler and the linker, # because GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN. # This is irritatingly difficult to feature test for; we have to check the @@ -22702,6 +22709,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_hidden" >&5 $as_echo "$gcc_cv_as_hidden" >&6; } + case "${target}" in *-*-darwin*) # Darwin as has some visibility support, though with a different syntax. @@ -23157,6 +23165,11 @@ if test $gcc_cv_as_leb128 = yes; then $as_echo "#define HAVE_AS_LEB128 1" >>confdefs.h fi +if test $gcc_cv_as_leb128 != yes; then + +$as_echo "#define HAVE_AS_LEB128 0" >>confdefs.h + +fi # Check if we have assembler support for unwind directives. { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for cfi directives" >&5 @@ -23236,6 +23249,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_cfi_directive" >&5 $as_echo "$gcc_cv_as_cfi_directive" >&6; } + if test $gcc_cv_as_cfi_directive = yes && test x$gcc_cv_objdump != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for working cfi advance" >&5 $as_echo_n "checking assembler for working cfi advance... " >&6; } @@ -23273,6 +23287,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_cfi_advance_working" >&5 $as_echo "$gcc_cv_as_cfi_advance_working" >&6; } + else # no objdump, err on the side of caution gcc_cv_as_cfi_advance_working=no @@ -23316,6 +23331,7 @@ fi $as_echo "$gcc_cv_as_cfi_personality_directive" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_GAS_CFI_PERSONALITY_DIRECTIVE `if test $gcc_cv_as_cfi_personality_directive = yes; then echo 1; else echo 0; fi` @@ -23368,6 +23384,7 @@ $as_echo "$gcc_cv_as_cfi_sections_directive" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_GAS_CFI_SECTIONS_DIRECTIVE `if test $gcc_cv_as_cfi_sections_directive = yes; then echo 1; else echo 0; fi` @@ -23471,6 +23488,7 @@ fi $as_echo "$gcc_cv_as_eh_frame" >&6; } + if test $gcc_cv_as_eh_frame = buggy; then $as_echo "#define USE_AS_TRADITIONAL_FORMAT 1" >>confdefs.h @@ -23508,6 +23526,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_shf_merge" >&5 $as_echo "$gcc_cv_as_shf_merge" >&6; } + if test $gcc_cv_as_shf_merge = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for section merging support" >&5 $as_echo_n "checking assembler for section merging support... " >&6; } @@ -23540,6 +23559,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_shf_merge" >&5 $as_echo "$gcc_cv_as_shf_merge" >&6; } + fi cat >>confdefs.h <<_ACEOF @@ -23578,6 +23598,7 @@ $as_echo "#define HAVE_AS_STABS_DIRECTIVE 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for COMDAT group support (GNU as)" >&5 $as_echo_n "checking assembler for COMDAT group support (GNU as)... " >&6; } if test "${gcc_cv_as_comdat_group+set}" = set; then : @@ -23609,6 +23630,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_comdat_group" >&5 $as_echo "$gcc_cv_as_comdat_group" >&6; } + if test $gcc_cv_as_comdat_group = yes; then gcc_cv_as_comdat_group_percent=no gcc_cv_as_comdat_group_group=no @@ -23644,6 +23666,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_comdat_group_percent" >&5 $as_echo "$gcc_cv_as_comdat_group_percent" >&6; } + if test $gcc_cv_as_comdat_group_percent = yes; then gcc_cv_as_comdat_group_group=no else @@ -23694,6 +23717,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_comdat_group_group" >&5 $as_echo "$gcc_cv_as_comdat_group_group" >&6; } + ;; esac if test -z "${gcc_cv_as_comdat_group_group+set}"; then @@ -23801,6 +23825,7 @@ $as_echo "#define HAVE_GAS_DISCRIMINATOR 1" >>confdefs.h fi + # Thread-local storage - the check is heavily parameterized. conftest_s= tls_first_major= @@ -24298,6 +24323,7 @@ $as_echo "$gcc_cv_as_tls" >&6; } if test $gcc_cv_as_tls = yes; then set_have_as_tls=yes fi + fi if test $set_have_as_tls = yes ; then @@ -24471,6 +24497,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_aarch64_mabi" >&5 $as_echo "$gcc_cv_as_aarch64_mabi" >&6; } + if test x$gcc_cv_as_aarch64_mabi = xyes; then $as_echo "#define HAVE_AS_MABI_OPTION 1" >>confdefs.h @@ -24530,6 +24557,7 @@ if test $gcc_cv_as_aarch64_picreloc = yes; then $as_echo "#define HAVE_AS_SMALL_PIC_RELOCS 1" >>confdefs.h fi + # Enable default workaround for AArch64 Cortex-A53 erratum 835769. # Check whether --enable-fix-cortex-a53-835769 was given. if test "${enable_fix_cortex_a53_835769+set}" = set; then : @@ -24618,6 +24646,7 @@ if test $gcc_cv_as_alpha_explicit_relocs = yes; then $as_echo "#define HAVE_AS_EXPLICIT_RELOCS 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for jsrdirect relocation support" >&5 $as_echo_n "checking assembler for jsrdirect relocation support... " >&6; } if test "${gcc_cv_as_alpha_jsrdirect_relocs+set}" = set; then : @@ -24655,6 +24684,7 @@ if test $gcc_cv_as_alpha_jsrdirect_relocs = yes; then $as_echo "#define HAVE_AS_JSRDIRECT_RELOCS 1" >>confdefs.h fi + ;; avr-*-*) @@ -24689,6 +24719,7 @@ $as_echo "#define HAVE_AS_AVR_MLINK_RELAX_OPTION 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for -mrmw option" >&5 $as_echo_n "checking assembler for -mrmw option... " >&6; } if test "${gcc_cv_as_avr_mrmw+set}" = set; then : @@ -24719,6 +24750,7 @@ if test $gcc_cv_as_avr_mrmw = yes; then $as_echo "#define HAVE_AS_AVR_MRMW_OPTION 1" >>confdefs.h fi + ;; cris-*-*) @@ -24756,6 +24788,7 @@ if test $gcc_cv_as_cris_no_mul_bug = yes; then $as_echo "#define HAVE_AS_NO_MUL_BUG_ABORT_OPTION 1" >>confdefs.h fi + ;; sparc*-*-*) @@ -24790,6 +24823,7 @@ $as_echo "#define HAVE_AS_REGISTER_PSEUDO_OP 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for -relax option" >&5 $as_echo_n "checking assembler for -relax option... " >&6; } if test "${gcc_cv_as_sparc_relax+set}" = set; then : @@ -24821,6 +24855,7 @@ $as_echo "#define HAVE_AS_RELAX_OPTION 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for GOTDATA_OP relocs" >&5 $as_echo_n "checking assembler for GOTDATA_OP relocs... " >&6; } if test "${gcc_cv_as_sparc_gotdata_op+set}" = set; then : @@ -24870,6 +24905,7 @@ $as_echo "#define HAVE_AS_SPARC_GOTDATA_OP 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for unaligned pcrel relocs" >&5 $as_echo_n "checking assembler for unaligned pcrel relocs... " >&6; } if test "${gcc_cv_as_sparc_ua_pcrel+set}" = set; then : @@ -24960,7 +24996,9 @@ $as_echo "#define HAVE_AS_SPARC_UA_PCREL_HIDDEN 1" >>confdefs.h fi -fi # unaligned pcrel relocs + +fi + # unaligned pcrel relocs { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for offsetable %lo()" >&5 $as_echo_n "checking assembler for offsetable %lo()... " >&6; } @@ -24999,6 +25037,7 @@ $as_echo "#define HAVE_AS_OFFSETABLE_LO10 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for FMAF, HPC, and VIS 3.0 instructions" >&5 $as_echo_n "checking assembler for FMAF, HPC, and VIS 3.0 instructions... " >&6; } if test "${gcc_cv_as_sparc_fmaf+set}" = set; then : @@ -25037,6 +25076,7 @@ $as_echo "#define HAVE_AS_FMAF_HPC_VIS3 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for SPARC4 instructions" >&5 $as_echo_n "checking assembler for SPARC4 instructions... " >&6; } if test "${gcc_cv_as_sparc_sparc4+set}" = set; then : @@ -25079,6 +25119,7 @@ $as_echo "#define HAVE_AS_SPARC4 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for SPARC5 and VIS 4.0 instructions" >&5 $as_echo_n "checking assembler for SPARC5 and VIS 4.0 instructions... " >&6; } if test "${gcc_cv_as_sparc_sparc5+set}" = set; then : @@ -25115,6 +25156,7 @@ $as_echo "#define HAVE_AS_SPARC5_VIS4 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for LEON instructions" >&5 $as_echo_n "checking assembler for LEON instructions... " >&6; } if test "${gcc_cv_as_sparc_leon+set}" = set; then : @@ -25151,6 +25193,7 @@ if test $gcc_cv_as_sparc_leon = yes; then $as_echo "#define HAVE_AS_LEON 1" >>confdefs.h fi + ;; i[34567]86-*-* | x86_64-*-*) @@ -25216,6 +25259,7 @@ fi $as_echo "$gcc_cv_as_comm_has_align" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_GAS_ALIGNED_COMM `if test $gcc_cv_as_comm_has_align = yes; then echo 1; else echo 0; fi` _ACEOF @@ -25262,6 +25306,7 @@ if test $gcc_cv_as_ix86_pe_secrel32 = yes; then $as_echo "#define HAVE_GAS_PE_SECREL32_RELOC 1" >>confdefs.h fi + # Test if the assembler supports the extended form of the .section # directive that specifies section alignment. LTO support uses this, # but normally only after installation, so we warn but don't fail the @@ -25296,6 +25341,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_section_has_align" >&5 $as_echo "$gcc_cv_as_section_has_align" >&6; } + if test x$gcc_cv_as_section_has_align != xyes; then case ",$enable_languages," in *,lto,*) @@ -25341,6 +25387,7 @@ fi $as_echo "$gcc_cv_as_section_has_e" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_GAS_SECTION_EXCLUDE `if test $gcc_cv_as_section_has_e = yes; then echo 1; else echo 0; fi` _ACEOF @@ -25377,6 +25424,7 @@ $as_echo "#define HAVE_AS_IX86_FILDS 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for fildq and fistpq mnemonics" >&5 $as_echo_n "checking assembler for fildq and fistpq mnemonics... " >&6; } if test "${gcc_cv_as_ix86_fildq+set}" = set; then : @@ -25408,6 +25456,7 @@ $as_echo "#define HAVE_AS_IX86_FILDQ 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for cmov syntax" >&5 $as_echo_n "checking assembler for cmov syntax... " >&6; } if test "${gcc_cv_as_ix86_cmov_sun_syntax+set}" = set; then : @@ -25439,6 +25488,7 @@ $as_echo "#define HAVE_AS_IX86_CMOV_SUN_SYNTAX 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for ffreep mnemonic" >&5 $as_echo_n "checking assembler for ffreep mnemonic... " >&6; } if test "${gcc_cv_as_ix86_ffreep+set}" = set; then : @@ -25470,6 +25520,7 @@ $as_echo "#define HAVE_AS_IX86_FFREEP 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .quad directive" >&5 $as_echo_n "checking assembler for .quad directive... " >&6; } if test "${gcc_cv_as_ix86_quad+set}" = set; then : @@ -25501,6 +25552,7 @@ $as_echo "#define HAVE_AS_IX86_QUAD 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for sahf mnemonic" >&5 $as_echo_n "checking assembler for sahf mnemonic... " >&6; } if test "${gcc_cv_as_ix86_sahf+set}" = set; then : @@ -25533,6 +25585,7 @@ $as_echo "#define HAVE_AS_IX86_SAHF 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for interunit movq mnemonic" >&5 $as_echo_n "checking assembler for interunit movq mnemonic... " >&6; } if test "${gcc_cv_as_ix86_interunit_movq+set}" = set; then : @@ -25562,6 +25615,7 @@ fi $as_echo "$gcc_cv_as_ix86_interunit_movq" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_AS_IX86_INTERUNIT_MOVQ `if test $gcc_cv_as_ix86_interunit_movq = yes; then echo 1; else echo 0; fi` _ACEOF @@ -25598,6 +25652,7 @@ $as_echo "#define HAVE_AS_IX86_HLE 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for swap suffix" >&5 $as_echo_n "checking assembler for swap suffix... " >&6; } if test "${gcc_cv_as_ix86_swap+set}" = set; then : @@ -25629,6 +25684,7 @@ $as_echo "#define HAVE_AS_IX86_SWAP 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for different section symbol subtraction" >&5 $as_echo_n "checking assembler for different section symbol subtraction... " >&6; } if test "${gcc_cv_as_ix86_diff_sect_delta+set}" = set; then : @@ -25666,6 +25722,7 @@ $as_echo "#define HAVE_AS_IX86_DIFF_SECT_DELTA 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for rep and lock prefix" >&5 $as_echo_n "checking assembler for rep and lock prefix... " >&6; } if test "${gcc_cv_as_ix86_rep_lock_prefix+set}" = set; then : @@ -25703,6 +25760,7 @@ $as_echo "#define HAVE_AS_IX86_REP_LOCK_PREFIX 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for ud2 mnemonic" >&5 $as_echo_n "checking assembler for ud2 mnemonic... " >&6; } if test "${gcc_cv_as_ix86_ud2+set}" = set; then : @@ -25734,6 +25792,7 @@ $as_echo "#define HAVE_AS_IX86_UD2 1" >>confdefs.h fi + # Enforce 32-bit output with gas and gld. if test x$gas = xyes; then as_ix86_gas_32_opt="--32" @@ -25781,6 +25840,7 @@ $as_echo "#define HAVE_AS_IX86_TLSGDPLT 1" >>confdefs.h fi + conftest_s=' .section .tdata,"aw'$tls_section_flag'",@progbits tls_ld: @@ -25818,6 +25878,7 @@ fi $as_echo "$gcc_cv_as_ix86_tlsldmplt" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_AS_IX86_TLSLDMPLT `if test $gcc_cv_as_ix86_tlsldmplt = yes; then echo 1; else echo 0; fi` _ACEOF @@ -25868,6 +25929,7 @@ fi $as_echo "$gcc_cv_as_ix86_tlsldm" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_AS_IX86_TLSLDM `if test $gcc_cv_as_ix86_tlsldm = yes; then echo 1; else echo 0; fi` _ACEOF @@ -25921,6 +25983,7 @@ fi $as_echo "$gcc_cv_as_ix86_got32x" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_AS_IX86_GOT32X `if test x"$gcc_cv_as_ix86_got32x" = xyes; then echo 1; else echo 0; fi` _ACEOF @@ -25961,6 +26024,7 @@ fi $as_echo "$gcc_cv_as_ix86_gotoff_in_data" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_AS_GOTOFF_IN_DATA `if test $gcc_cv_as_ix86_gotoff_in_data = yes; then echo 1; else echo 0; fi` _ACEOF @@ -26015,6 +26079,7 @@ fi $as_echo "$gcc_cv_as_ix86_tls_get_addr_via_got" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_AS_IX86_TLS_GET_ADDR_GOT `if test x"$gcc_cv_as_ix86_tls_get_addr_via_got" = xyes; then echo 1; else echo 0; fi` _ACEOF @@ -26060,6 +26125,7 @@ $as_echo "#define HAVE_AS_LTOFFX_LDXMOV_RELOCS 1" >>confdefs.h fi + ;; powerpc*-*-*) @@ -26092,6 +26158,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_machine_directive" >&5 $as_echo "$gcc_cv_as_machine_directive" >&6; } + if test x$gcc_cv_as_machine_directive != xyes; then echo "*** This target requires an assembler supporting \".machine\"" >&2 echo you can get it from: ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg >&2 @@ -26146,6 +26213,7 @@ $as_echo "#define HAVE_AS_MFCRF 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .machine "pwr5" .csect .text[PR] @@ -26190,6 +26258,7 @@ $as_echo "#define HAVE_AS_POPCNTB 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .machine "pwr5x" .csect .text[PR] @@ -26234,6 +26303,7 @@ $as_echo "#define HAVE_AS_FPRND 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .machine "pwr6" .csect .text[PR] @@ -26278,6 +26348,7 @@ $as_echo "#define HAVE_AS_MFPGPR 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .csect .text[PR] LCF..0: @@ -26326,6 +26397,7 @@ $as_echo "#define HAVE_AS_REL16 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .machine "pwr6" .csect .text[PR] @@ -26370,6 +26442,7 @@ $as_echo "#define HAVE_AS_CMPB 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .machine "pwr6" .csect .text[PR] @@ -26414,6 +26487,7 @@ $as_echo "#define HAVE_AS_DFP 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .machine "pwr7" .csect .text[PR] @@ -26458,6 +26532,7 @@ $as_echo "#define HAVE_AS_VSX 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .machine "pwr7" .csect .text[PR] @@ -26502,6 +26577,7 @@ $as_echo "#define HAVE_AS_POPCNTD 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .machine "pwr8" .csect .text[PR]';; @@ -26544,6 +26620,7 @@ $as_echo "#define HAVE_AS_POWER8 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .machine "pwr9" .csect .text[PR]';; @@ -26586,6 +26663,7 @@ $as_echo "#define HAVE_AS_POWER9 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .csect .text[PR] lwsync';; @@ -26628,6 +26706,7 @@ $as_echo "#define HAVE_AS_LWSYNC 1" >>confdefs.h fi + case $target in *-*-aix*) conftest_s=' .machine "476" .csect .text[PR] @@ -26672,6 +26751,7 @@ $as_echo "#define HAVE_AS_DCI 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .gnu_attribute support" >&5 $as_echo_n "checking assembler for .gnu_attribute support... " >&6; } if test "${gcc_cv_as_powerpc_gnu_attribute+set}" = set; then : @@ -26707,6 +26787,7 @@ $as_echo "#define HAVE_AS_GNU_ATTRIBUTE 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for tls marker support" >&5 $as_echo_n "checking assembler for tls marker support... " >&6; } if test "${gcc_cv_as_powerpc_tls_markers+set}" = set; then : @@ -26742,6 +26823,7 @@ $as_echo "#define HAVE_AS_TLS_MARKERS 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for prologue entry point marker support" >&5 $as_echo_n "checking assembler for prologue entry point marker support... " >&6; } if test "${gcc_cv_as_powerpc_entry_markers+set}" = set; then : @@ -26777,6 +26859,7 @@ $as_echo "#define HAVE_AS_ENTRY_MARKERS 1" >>confdefs.h fi + case $target in *-*-aix*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for AIX .ref support" >&5 @@ -26819,6 +26902,7 @@ $as_echo "#define HAVE_AS_REF 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for AIX DWARF location lists section support" >&5 $as_echo_n "checking assembler for AIX DWARF location lists section support... " >&6; } if test "${gcc_cv_as_aix_dwloc+set}" = set; then : @@ -26856,6 +26940,7 @@ if test $gcc_cv_as_aix_dwloc = yes; then $as_echo "#define HAVE_XCOFF_DWARF_EXTRAS 1" >>confdefs.h fi + ;; esac ;; @@ -26897,6 +26982,7 @@ if test $gcc_cv_as_mips_explicit_relocs = yes; then fi fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for -mno-shared support" >&5 $as_echo_n "checking assembler for -mno-shared support... " >&6; } if test "${gcc_cv_as_mips_no_shared+set}" = set; then : @@ -26932,6 +27018,7 @@ $as_echo "#define HAVE_AS_NO_SHARED 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .gnu_attribute support" >&5 $as_echo_n "checking assembler for .gnu_attribute support... " >&6; } if test "${gcc_cv_as_mips_gnu_attribute+set}" = set; then : @@ -26967,6 +27054,7 @@ $as_echo "#define HAVE_AS_GNU_ATTRIBUTE 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .module support" >&5 $as_echo_n "checking assembler for .module support... " >&6; } if test "${gcc_cv_as_mips_dot_module+set}" = set; then : @@ -26998,6 +27086,7 @@ if test $gcc_cv_as_mips_dot_module = yes; then $as_echo "#define HAVE_AS_DOT_MODULE 1" >>confdefs.h fi + if test x$gcc_cv_as_mips_dot_module = xno \ && test x$with_fp_32 != x; then as_fn_error "Requesting --with-fp-32= requires assembler support for .module." "$LINENO" 5 @@ -27034,6 +27123,7 @@ $as_echo "#define HAVE_GAS_MICROMIPS 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .dtprelword support" >&5 $as_echo_n "checking assembler for .dtprelword support... " >&6; } if test "${gcc_cv_as_mips_dtprelword+set}" = set; then : @@ -27073,6 +27163,7 @@ $as_echo "#define HAVE_AS_DTPRELWORD 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for DSPR1 mult with four accumulators support" >&5 $as_echo_n "checking assembler for DSPR1 mult with four accumulators support... " >&6; } if test "${gcc_cv_as_mips_dspr1_mult+set}" = set; then : @@ -27112,6 +27203,7 @@ $as_echo "#define HAVE_AS_DSPR1_MULT 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler and linker for explicit JALR relocation" >&5 $as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6; } gcc_cv_as_ld_jalr_reloc=no @@ -27231,6 +27323,7 @@ if test $gcc_cv_as_mips_nan = yes; then $as_echo "#define HAVE_AS_NAN 1" >>confdefs.h fi + if test x$gcc_cv_as_mips_nan = xno \ && test x$with_nan != x; then as_fn_error "Requesting --with-nan= requires assembler support for -mnan=" "$LINENO" 5 @@ -27271,6 +27364,7 @@ if test $gcc_cv_as_s390_gnu_attribute = yes; then $as_echo "#define HAVE_AS_GNU_ATTRIBUTE 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .machine and .machinemode support" >&5 $as_echo_n "checking assembler for .machine and .machinemode support... " >&6; } if test "${gcc_cv_as_s390_machine_machinemode+set}" = set; then : @@ -27308,6 +27402,7 @@ if test $gcc_cv_as_s390_machine_machinemode = yes; then $as_echo "#define HAVE_AS_MACHINE_MACHINEMODE 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for architecture modifiers support" >&5 $as_echo_n "checking assembler for architecture modifiers support... " >&6; } if test "${gcc_cv_as_s390_architecture_modifiers+set}" = set; then : @@ -27342,6 +27437,7 @@ if test $gcc_cv_as_s390_architecture_modifiers = yes; then $as_echo "#define HAVE_AS_ARCHITECTURE_MODIFIERS 1" >>confdefs.h fi + ;; esac @@ -27422,6 +27518,7 @@ fi $as_echo "$gcc_cv_as_dwarf2_debug_line" >&6; } + # The .debug_line file table must be in the exact order that # we specified the files, since these indices are also used # by DW_AT_decl_file. Approximate this test by testing if @@ -27454,6 +27551,7 @@ fi $as_echo "$gcc_cv_as_dwarf2_file_buggy" >&6; } + if test $gcc_cv_as_dwarf2_debug_line = yes \ && test $gcc_cv_as_dwarf2_file_buggy = no; then @@ -27497,6 +27595,7 @@ $as_echo "#define HAVE_AS_GDWARF2_DEBUG_FLAG 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for --gstabs option" >&5 $as_echo_n "checking assembler for --gstabs option... " >&6; } if test "${gcc_cv_as_gstabs_flag+set}" = set; then : @@ -27533,6 +27632,7 @@ $as_echo "#define HAVE_AS_GSTABS_DEBUG_FLAG 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for --debug-prefix-map option" >&5 $as_echo_n "checking assembler for --debug-prefix-map option... " >&6; } if test "${gcc_cv_as_debug_prefix_map_flag+set}" = set; then : @@ -27567,6 +27667,7 @@ if test $gcc_cv_as_debug_prefix_map_flag = yes; then $as_echo "#define HAVE_AS_DEBUG_PREFIX_MAP 1" >>confdefs.h fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for compressed debug sections" >&5 @@ -27617,6 +27718,7 @@ fi $as_echo "$gcc_cv_as_compress_debug" >&6; } + cat >>confdefs.h <<_ACEOF #define HAVE_AS_COMPRESS_DEBUG $gcc_cv_as_compress_debug _ACEOF @@ -27663,6 +27765,7 @@ $as_echo "#define HAVE_GAS_LCOMM_WITH_ALIGNMENT 1" >>confdefs.h fi + if test x$with_sysroot = x && test x$host = x$target \ && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" \ && test "$prefix" != "NONE"; then @@ -27759,6 +27862,7 @@ if test $glibc_version_major -gt 2 \ fi fi + fi if test x$enable_gnu_unique_object = xyes; then diff --git a/gcc/configure.ac b/gcc/configure.ac index 2f9b859eafb..140b9f9ac90 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2753,6 +2753,8 @@ L2:], fi fi]], [AC_DEFINE(HAVE_AS_LEB128, 1, + [Define if your assembler supports .sleb128 and .uleb128.])], + [AC_DEFINE(HAVE_AS_LEB128, 0, [Define if your assembler supports .sleb128 and .uleb128.])]) # Check if we have assembler support for unwind directives. diff --git a/gcc/coretypes.h b/gcc/coretypes.h index 869f858d4a1..6d78a25c971 100644 --- a/gcc/coretypes.h +++ b/gcc/coretypes.h @@ -177,7 +177,8 @@ enum offload_abi { /* Types of profile update methods. */ enum profile_update { PROFILE_UPDATE_SINGLE, - PROFILE_UPDATE_ATOMIC + PROFILE_UPDATE_ATOMIC, + PROFILE_UPDATE_PREFER_ATOMIC }; /* Types of unwind/exception handling info that can be generated. */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 678c44d5d40..65574d3ee4b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,69 @@ +2016-11-13 Jakub Jelinek <jakub@redhat.com> + Jason Merrill <jason@redhat.com> + + Implement P0217R3 - C++17 structured bindings + * cp-tree.h (struct lang_decl_base): Add decomposition_p. + (DECL_DECOMPOSITION_P): New + (enum auto_deduction_context): Add adc_decomp_type. + (enum cp_declarator_kind): Add cdk_decomp. + * constexpr.c (cxx_eval_constant_expression): Look through + DECL_VALUE_EXPR. + (potential_constant_expression_1): Likewise. + * decl.c (reshape_init): Preserve CONSTRUCTOR_IS_DIRECT_INIT. + (check_initializer): Use build_aggr_init for DECL_DECOMPOSITION_P. + (cp_finish_decl): Pass adc_decomp_type for decomposition. + (find_decomp_class_base, get_tuple_size, get_tuple_element_type) + (get_tuple_decomp_init, cp_finish_decomp): New. + (grokdeclarator): Handle decomposition. + * init.c (build_aggr_init): Handle decomposition array. + (build_vec_init): Handle initialization from { array }. + * name-lookup.c (add_function): Always wrap TEMPLATE_DECL in + OVERLOAD. + * parser.c (declarator_can_be_parameter_pack): Handle cdk_decomp. + (function_declarator_p, strip_declarator_types) + (cp_parser_check_declarator_template_parameters): Likewise. + (cp_parser_range_for, cp_convert_range_for): Handle decomposition. + (cp_parser_simple_declaration): Parse decomposition. + (cp_parser_decomposition_declaration): New. + * pt.c (tsubst_decomp_names): New. + (subst_expr) [DECL_EXPR, RANGE_FOR_STMT]: Handle decomposition. + (do_auto_deduction): Handle adc_decomp_type. + * semantics.c (finish_decltype_type): Look through DECL_VALUE_EXPR. + * typeck.c (is_bitfield_expr_with_lowered_type): Likewise. + * tree.c (lvalue_kind): Likewise. + (cp_build_reference_type): Handle reference collapsing. + +2016-11-13 Jason Merrill <jason@redhat.com> + + * call.c (build_new_method_call_1): Include template arguments in + error message. + (print_error_for_call_failure): Likewise. + (build_new_function_call): Pass them in. + * name-lookup.c (supplement_binding_1): Don't complain about a + conflict with an erroneous declaration. + * error.c (dump_decl): Fix printing of alias declaration. + * decl.c (make_typename_type): Call cxx_incomplete_type_error. + * parser.c (cp_parser_diagnose_invalid_type_name): Likewise. + * semantics.c (perform_koenig_lookup): Don't wrap an error in + TEMPLATE_ID_EXPR. + +2016-11-12 Jason Merrill <jason@redhat.com> + + CWG 2233 + * typeck.c (convert_arguments): Handle default arg followed by none. + + * constexpr.c (potential_constant_expression_1): REALPART_EXPR and + IMAGPART_EXPR can be lvalues. + + DR 374 + PR c++/56840 + * pt.c (check_specialization_namespace): Allow any enclosing + namespace. + (check_unqualified_spec_or_inst): New. + (check_explicit_specialization): Call it. + * parser.c (cp_parser_elaborated_type_specifier) + (cp_parser_class_head): Call it. + 2016-11-10 Jason Merrill <jason@redhat.com> PR c++/77337 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 0dcf322344c..f6f45905162 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4146,8 +4146,16 @@ static void print_error_for_call_failure (tree fn, vec<tree, va_gc> *args, struct z_candidate *candidates) { + tree targs = NULL_TREE; + if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) + { + targs = TREE_OPERAND (fn, 1); + fn = TREE_OPERAND (fn, 0); + } tree name = DECL_NAME (OVL_CURRENT (fn)); location_t loc = location_of (name); + if (targs) + name = lookup_template_function (name, targs); if (!any_strictly_viable (candidates)) error_at (loc, "no matching function for call to %<%D(%A)%>", @@ -4215,8 +4223,6 @@ build_new_function_call (tree fn, vec<tree, va_gc> **args, bool koenig_p, return cp_build_function_call_vec (candidates->fn, args, complain); // Otherwise, emit notes for non-viable candidates. - if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) - fn = TREE_OPERAND (fn, 0); print_error_for_call_failure (fn, *args, candidates); } result = error_mark_node; @@ -8649,19 +8655,20 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args, TREE_TYPE (instance)); else { - char *pretty_name; - bool free_p; - tree arglist; - - pretty_name = name_as_c_string (name, basetype, &free_p); - arglist = build_tree_list_vec (user_args); + tree arglist = build_tree_list_vec (user_args); + tree errname = name; + if (IDENTIFIER_CTOR_OR_DTOR_P (errname)) + { + tree fn = DECL_ORIGIN (get_first_fn (fns)); + errname = DECL_NAME (fn); + } + if (explicit_targs) + errname = lookup_template_function (errname, explicit_targs); if (skip_first_for_error) arglist = TREE_CHAIN (arglist); - error ("no matching function for call to %<%T::%s(%A)%#V%>", - basetype, pretty_name, arglist, + error ("no matching function for call to %<%T::%E(%A)%#V%>", + basetype, errname, arglist, TREE_TYPE (instance)); - if (free_p) - free (pretty_name); } print_z_candidates (location_of (name), candidates); } diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index f75f0b039fa..e8c7702dede 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -3770,7 +3770,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t, return (*ctx->values->get (t)); case VAR_DECL: - if (is_capture_proxy (t)) + if (DECL_HAS_VALUE_EXPR_P (t)) return cxx_eval_constant_expression (ctx, DECL_VALUE_EXPR (t), lval, non_constant_p, overflow_p); /* fall through */ @@ -5037,6 +5037,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, return RECUR (TREE_OPERAND (t, 0), rval); case VAR_DECL: + if (DECL_HAS_VALUE_EXPR_P (t)) + return RECUR (DECL_VALUE_EXPR (t), rval); if (want_rval && !var_in_maybe_constexpr_fn (t) && !type_dependent_expression_p (t) @@ -5105,6 +5107,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, #endif return RECUR (t, any); + case REALPART_EXPR: + case IMAGPART_EXPR: case COMPONENT_REF: case BIT_FIELD_REF: case ARROW_EXPR: @@ -5276,8 +5280,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, return true; /* fall through. */ - case REALPART_EXPR: - case IMAGPART_EXPR: case CONJ_EXPR: case SAVE_EXPR: case FIX_TRUNC_EXPR: diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 8183775b49e..8c2dbe1fba6 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2228,7 +2228,8 @@ struct GTY(()) lang_decl_base { unsigned u2sel : 1; unsigned concept_p : 1; /* applies to vars and functions */ unsigned var_declared_inline_p : 1; /* var */ - /* 2 spare bits */ + unsigned decomposition_p : 1; /* var */ + /* 1 spare bit */ }; /* True for DECL codes which have template info and access. */ @@ -3626,6 +3627,16 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter) (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.var_declared_inline_p \ = true) +/* Nonzero if NODE is the artificial VAR_DECL for decomposition + declaration. */ +#define DECL_DECOMPOSITION_P(NODE) \ + (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE)) \ + ? DECL_LANG_SPECIFIC (NODE)->u.base.decomposition_p \ + : false) +#define SET_DECL_DECOMPOSITION_P(NODE) \ + (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.decomposition_p \ + = true) + /* Nonzero if NODE is an inline VAR_DECL. In C++17, static data members declared with constexpr specifier are implicitly inline variables. */ #define DECL_INLINE_VAR_P(NODE) \ @@ -5165,7 +5176,8 @@ enum auto_deduction_context adc_variable_type, /* Variable initializer deduction */ adc_return_type, /* Return type deduction */ adc_unify, /* Template argument deduction */ - adc_requirement /* Argument dedution constraint */ + adc_requirement, /* Argument deduction constraint */ + adc_decomp_type /* Decomposition declaration initializer deduction */ }; /* True iff this TEMPLATE_TYPE_PARM represents decltype(auto). */ @@ -5382,6 +5394,7 @@ enum cp_declarator_kind { cdk_pointer, cdk_reference, cdk_ptrmem, + cdk_decomp, cdk_error }; @@ -5412,7 +5425,8 @@ struct cp_declarator { /* Whether we parsed an ellipsis (`...') just before the declarator, to indicate this is a parameter pack. */ BOOL_BITFIELD parameter_pack_p : 1; - location_t id_loc; /* Currently only set for cdk_id and cdk_function. */ + location_t id_loc; /* Currently only set for cdk_id, cdk_decomp and + cdk_function. */ /* GNU Attributes that apply to this declarator. If the declarator is a pointer or a reference, these attribute apply to the type pointed to. */ @@ -5421,8 +5435,8 @@ struct cp_declarator { declarator is a pointer or a reference, these attributes apply to the pointer, rather than to the type pointed to. */ tree std_attributes; - /* For all but cdk_id and cdk_error, the contained declarator. For - cdk_id and cdk_error, guaranteed to be NULL. */ + /* For all but cdk_id, cdk_decomp and cdk_error, the contained declarator. + For cdk_id, cdk_decomp and cdk_error, guaranteed to be NULL. */ cp_declarator *declarator; union { /* For identifiers. */ @@ -5794,6 +5808,7 @@ extern tree start_decl (const cp_declarator *, cp_decl_specifier_seq *, int, extern void start_decl_1 (tree, bool); extern bool check_array_initializer (tree, tree, tree); extern void cp_finish_decl (tree, tree, bool, tree, int); +extern void cp_finish_decomp (tree, tree, unsigned int); extern int cp_complete_array_type (tree *, tree, bool); extern int cp_complete_array_type_or_error (tree *, tree, bool, tsubst_flags_t); extern tree build_ptrmemfunc_type (tree); @@ -6066,7 +6081,7 @@ extern tree implicitly_declare_fn (special_function_kind, tree, extern bool maybe_clone_body (tree); /* In parser.c */ -extern tree cp_convert_range_for (tree, tree, tree, bool); +extern tree cp_convert_range_for (tree, tree, tree, tree, unsigned int, bool); extern bool parsing_nsdmi (void); extern void inject_this_parameter (tree, cp_cv_quals); @@ -6082,6 +6097,7 @@ extern void reset_specialization (void); extern void end_specialization (void); extern void begin_explicit_instantiation (void); extern void end_explicit_instantiation (void); +extern void check_unqualified_spec_or_inst (tree, location_t); extern tree check_explicit_specialization (tree, tree, int, int); extern int num_template_headers_for_class (tree); extern void check_template_variable (tree); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 185c98bebb8..f142c1fb931 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3756,8 +3756,13 @@ make_typename_type (tree context, tree name, enum tag_types tag_type, if (!t) { if (complain & tf_error) - error (want_template ? G_("no class template named %q#T in %q#T") - : G_("no type named %q#T in %q#T"), name, context); + { + if (!COMPLETE_TYPE_P (context)) + cxx_incomplete_type_error (NULL_TREE, context); + else + error (want_template ? G_("no class template named %q#T in %q#T") + : G_("no type named %q#T in %q#T"), name, context); + } return error_mark_node; } @@ -6069,6 +6074,10 @@ reshape_init (tree type, tree init, tsubst_flags_t complain) return error_mark_node; } + if (CONSTRUCTOR_IS_DIRECT_INIT (init) + && BRACE_ENCLOSED_INITIALIZER_P (new_init)) + CONSTRUCTOR_IS_DIRECT_INIT (new_init) = true; + return new_init; } @@ -6249,7 +6258,8 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups) if (type == error_mark_node) return NULL_TREE; - if ((type_build_ctor_call (type) || CLASS_TYPE_P (type)) + if ((type_build_ctor_call (type) || CLASS_TYPE_P (type) + || (DECL_DECOMPOSITION_P (decl) && TREE_CODE (type) == ARRAY_TYPE)) && !(flags & LOOKUP_ALREADY_DIGESTED) && !(init && BRACE_ENCLOSED_INITIALIZER_P (init) && CP_AGGREGATE_TYPE_P (type) @@ -6765,10 +6775,11 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p, d_init = build_x_compound_expr_from_list (d_init, ELK_INIT, tf_warning_or_error); d_init = resolve_nondeduced_context (d_init, tf_warning_or_error); - type = TREE_TYPE (decl) = do_auto_deduction (type, d_init, - auto_node, - tf_warning_or_error, - adc_variable_type); + enum auto_deduction_context adc = adc_variable_type; + if (VAR_P (decl) && DECL_DECOMPOSITION_P (decl)) + adc = adc_decomp_type; + type = TREE_TYPE (decl) = do_auto_deduction (type, d_init, auto_node, + tf_warning_or_error, adc); if (type == error_mark_node) return; if (TREE_CODE (type) == FUNCTION_TYPE) @@ -7132,6 +7143,390 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p, invoke_plugin_callbacks (PLUGIN_FINISH_DECL, decl); } +/* For class TYPE return itself or some its bases that contain + any direct non-static data members. Return error_mark_node if an + error has been diagnosed. */ + +static tree +find_decomp_class_base (location_t loc, tree type, tree ret) +{ + bool member_seen = false; + for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) + if (TREE_CODE (field) != FIELD_DECL || DECL_ARTIFICIAL (field)) + continue; + else if (ret) + return type; + else if (ANON_AGGR_TYPE_P (TREE_TYPE (field))) + { + if (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE) + error_at (loc, "cannot decompose class type %qT because it has an " + "anonymous struct member", type); + else + error_at (loc, "cannot decompose class type %qT because it has an " + "anonymous union member", type); + inform (DECL_SOURCE_LOCATION (field), "declared here"); + return error_mark_node; + } + else if (TREE_PRIVATE (field) || TREE_PROTECTED (field)) + { + error_at (loc, "cannot decompose non-public member %qD of %qT", + field, type); + inform (DECL_SOURCE_LOCATION (field), + TREE_PRIVATE (field) ? "declared private here" + : "declared protected here"); + return error_mark_node; + } + else + member_seen = true; + + tree base_binfo, binfo; + tree orig_ret = ret; + int i; + if (member_seen) + ret = type; + for (binfo = TYPE_BINFO (type), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) + { + tree t = find_decomp_class_base (loc, TREE_TYPE (base_binfo), ret); + if (t == error_mark_node) + return error_mark_node; + if (t != NULL_TREE) + { + if (ret == type) + { + error_at (loc, "cannot decompose class type %qT: both it and " + "its base class %qT have non-static data members", + type, t); + return error_mark_node; + } + else if (orig_ret != NULL_TREE) + return t; + else if (ret == t) + /* OK, found the same base along another path. We'll complain + in convert_to_base if it's ambiguous. */; + else if (ret != NULL_TREE) + { + error_at (loc, "cannot decompose class type %qT: its base " + "classes %qT and %qT have non-static data " + "members", type, ret, t); + return error_mark_node; + } + else + ret = t; + } + } + return ret; +} + +/* Return std::tuple_size<TYPE>::value. */ + +tree +get_tuple_size (tree type) +{ + tree args = make_tree_vec (1); + TREE_VEC_ELT (args, 0) = type; + tree inst = lookup_template_class (get_identifier ("tuple_size"), args, + /*in_decl*/NULL_TREE, + /*context*/std_node, + /*entering_scope*/false, tf_none); + tree val = lookup_qualified_name (inst, get_identifier ("value"), + /*type*/false, /*complain*/false); + if (TREE_CODE (val) == VAR_DECL || TREE_CODE (val) == CONST_DECL) + val = maybe_constant_value (val); + if (TREE_CODE (val) == INTEGER_CST) + return val; + else + return NULL_TREE; +} + +/* Return std::tuple_element<I,TYPE>::type. */ + +tree +get_tuple_element_type (tree type, unsigned i) +{ + tree args = make_tree_vec (2); + TREE_VEC_ELT (args, 0) = build_int_cst (integer_type_node, i); + TREE_VEC_ELT (args, 1) = type; + tree inst = lookup_template_class (get_identifier ("tuple_element"), args, + /*in_decl*/NULL_TREE, + /*context*/std_node, + /*entering_scope*/false, + tf_warning_or_error); + return make_typename_type (inst, get_identifier ("type"), + none_type, tf_warning_or_error); +} + +/* Return e.get<i>() or get<i>(e). */ + +tree +get_tuple_decomp_init (tree decl, unsigned i) +{ + tree get_id = get_identifier ("get"); + tree targs = make_tree_vec (1); + TREE_VEC_ELT (targs, 0) = build_int_cst (integer_type_node, i); + + tree etype = TREE_TYPE (decl); + tree e = convert_from_reference (decl); + + /* [The id-expression] e is an lvalue if the type of the entity e is an + lvalue reference and an xvalue otherwise. */ + if (TREE_CODE (etype) != REFERENCE_TYPE + || TYPE_REF_IS_RVALUE (etype)) + e = move (e); + + tree fns = lookup_qualified_name (TREE_TYPE (e), get_id, + /*type*/false, /*complain*/false); + if (fns != error_mark_node) + { + fns = lookup_template_function (fns, targs); + return build_new_method_call (e, fns, /*args*/NULL, + /*path*/NULL_TREE, LOOKUP_NORMAL, + /*fn_p*/NULL, tf_warning_or_error); + } + else + { + vec<tree,va_gc> *args = make_tree_vector_single (e); + fns = lookup_template_function (get_id, targs); + fns = perform_koenig_lookup (fns, args, tf_warning_or_error); + return finish_call_expr (fns, &args, /*novirt*/false, + /*koenig*/true, tf_warning_or_error); + } +} + +/* Finish a decomposition declaration. DECL is the underlying declaration + "e", FIRST is the head of a chain of decls for the individual identifiers + chained through DECL_CHAIN in reverse order and COUNT is the number of + those decls. */ + +void +cp_finish_decomp (tree decl, tree first, unsigned int count) +{ + location_t loc = DECL_SOURCE_LOCATION (decl); + if (error_operand_p (decl)) + { + error_out: + while (count--) + { + TREE_TYPE (first) = error_mark_node; + if (DECL_HAS_VALUE_EXPR_P (first)) + { + SET_DECL_VALUE_EXPR (first, NULL_TREE); + DECL_HAS_VALUE_EXPR_P (first) = 0; + } + first = DECL_CHAIN (first); + } + return; + } + + if (type_dependent_expression_p (decl) + /* This happens for range for when not in templates. + Still add the DECL_VALUE_EXPRs for later processing. */ + || (!processing_template_decl + && type_uses_auto (TREE_TYPE (decl)))) + { + for (unsigned int i = 0; i < count; i++) + { + if (!DECL_HAS_VALUE_EXPR_P (first)) + { + tree v = build_nt (ARRAY_REF, decl, + size_int (count - i - 1), + NULL_TREE, NULL_TREE); + SET_DECL_VALUE_EXPR (first, v); + DECL_HAS_VALUE_EXPR_P (first) = 1; + } + if (processing_template_decl) + { + retrofit_lang_decl (first); + SET_DECL_DECOMPOSITION_P (first); + } + first = DECL_CHAIN (first); + } + return; + } + + auto_vec<tree, 16> v; + v.safe_grow (count); + tree d = first; + for (unsigned int i = 0; i < count; i++, d = DECL_CHAIN (d)) + { + v[count - i - 1] = d; + if (processing_template_decl) + { + retrofit_lang_decl (d); + SET_DECL_DECOMPOSITION_P (d); + } + } + + tree type = TREE_TYPE (decl); + tree eltype = NULL_TREE; + if (TREE_CODE (type) == REFERENCE_TYPE) + type = TREE_TYPE (type); + + unsigned HOST_WIDE_INT eltscnt = 0; + if (TREE_CODE (type) == ARRAY_TYPE) + { + tree nelts; + nelts = array_type_nelts_top (type); + if (nelts == error_mark_node) + goto error_out; + if (!tree_fits_uhwi_p (nelts)) + { + error_at (loc, "cannot decompose variable length array %qT", type); + goto error_out; + } + eltscnt = tree_to_uhwi (nelts); + if (count != eltscnt) + { + cnt_mismatch: + if (count > eltscnt) + error_at (loc, "%u names provided while %qT decomposes into " + "%wu elements", count, type, eltscnt); + else + error_at (loc, "only %u names provided while %qT decomposes into " + "%wu elements", count, type, eltscnt); + goto error_out; + } + eltype = TREE_TYPE (type); + for (unsigned int i = 0; i < count; i++) + { + TREE_TYPE (v[i]) = eltype; + layout_decl (v[i], 0); + tree t = convert_from_reference (decl); + t = build4_loc (DECL_SOURCE_LOCATION (v[i]), ARRAY_REF, + eltype, t, size_int (i), NULL_TREE, + NULL_TREE); + SET_DECL_VALUE_EXPR (v[i], t); + DECL_HAS_VALUE_EXPR_P (v[i]) = 1; + } + } + /* 2 GNU extensions. */ + else if (TREE_CODE (type) == COMPLEX_TYPE) + { + eltscnt = 2; + if (count != eltscnt) + goto cnt_mismatch; + eltype = cp_build_qualified_type (TREE_TYPE (type), TYPE_QUALS (type)); + for (unsigned int i = 0; i < count; i++) + { + TREE_TYPE (v[i]) = eltype; + layout_decl (v[i], 0); + tree t = convert_from_reference (decl); + t = build1_loc (DECL_SOURCE_LOCATION (v[i]), + i ? IMAGPART_EXPR : REALPART_EXPR, eltype, + t); + SET_DECL_VALUE_EXPR (v[i], t); + DECL_HAS_VALUE_EXPR_P (v[i]) = 1; + } + } + else if (TREE_CODE (type) == VECTOR_TYPE) + { + eltscnt = TYPE_VECTOR_SUBPARTS (type); + if (count != eltscnt) + goto cnt_mismatch; + eltype = cp_build_qualified_type (TREE_TYPE (type), TYPE_QUALS (type)); + for (unsigned int i = 0; i < count; i++) + { + TREE_TYPE (v[i]) = eltype; + layout_decl (v[i], 0); + tree t = convert_from_reference (decl); + convert_vector_to_array_for_subscript (DECL_SOURCE_LOCATION (v[i]), + &t, size_int (i)); + t = build4_loc (DECL_SOURCE_LOCATION (v[i]), ARRAY_REF, + eltype, t, size_int (i), NULL_TREE, + NULL_TREE); + SET_DECL_VALUE_EXPR (v[i], t); + DECL_HAS_VALUE_EXPR_P (v[i]) = 1; + } + } + else if (tree tsize = get_tuple_size (type)) + { + eltscnt = tree_to_uhwi (tsize); + if (count != eltscnt) + goto cnt_mismatch; + for (unsigned i = 0; i < count; ++i) + { + location_t sloc = input_location; + location_t dloc = DECL_SOURCE_LOCATION (v[i]); + + input_location = dloc; + tree init = get_tuple_decomp_init (decl, i); + tree eltype = (init == error_mark_node ? error_mark_node + : get_tuple_element_type (type, i)); + input_location = sloc; + + if (init == error_mark_node || eltype == error_mark_node) + { + inform (dloc, "in initialization of decomposition variable %qD", + v[i]); + goto error_out; + } + eltype = cp_build_reference_type (eltype, !lvalue_p (init)); + TREE_TYPE (v[i]) = eltype; + layout_decl (v[i], 0); + if (DECL_HAS_VALUE_EXPR_P (v[i])) + { + /* In this case the names are variables, not just proxies. */ + SET_DECL_VALUE_EXPR (v[i], NULL_TREE); + DECL_HAS_VALUE_EXPR_P (v[i]) = 0; + } + cp_finish_decl (v[i], init, /*constexpr*/false, + /*asm*/NULL_TREE, LOOKUP_NORMAL); + } + } + else if (TREE_CODE (type) == UNION_TYPE) + { + error_at (loc, "cannot decompose union type %qT", type); + goto error_out; + } + else if (!CLASS_TYPE_P (type)) + { + error_at (loc, "cannot decompose non-array non-class type %qT", type); + goto error_out; + } + else + { + tree btype = find_decomp_class_base (loc, type, NULL_TREE); + if (btype == error_mark_node) + goto error_out; + else if (btype == NULL_TREE) + { + error_at (loc, "cannot decompose class type %qT without non-static " + "data members", type); + goto error_out; + } + for (tree field = TYPE_FIELDS (btype); field; field = TREE_CHAIN (field)) + if (TREE_CODE (field) != FIELD_DECL || DECL_ARTIFICIAL (field)) + continue; + else + eltscnt++; + if (count != eltscnt) + goto cnt_mismatch; + tree t = convert_from_reference (decl); + if (type != btype) + { + t = convert_to_base (t, btype, /*check_access*/true, + /*nonnull*/false, tf_warning_or_error); + type = btype; + } + unsigned int i = 0; + for (tree field = TYPE_FIELDS (btype); field; field = TREE_CHAIN (field)) + if (TREE_CODE (field) != FIELD_DECL || DECL_ARTIFICIAL (field)) + continue; + else + { + tree tt = finish_non_static_data_member (field, t, NULL_TREE); + tree probe = tt; + if (REFERENCE_REF_P (probe)) + probe = TREE_OPERAND (probe, 0); + TREE_TYPE (v[i]) = TREE_TYPE (probe); + layout_decl (v[i], 0); + SET_DECL_VALUE_EXPR (v[i], tt); + DECL_HAS_VALUE_EXPR_P (v[i]) = 1; + i++; + } + } +} + /* Returns a declaration for a VAR_DECL as if: extern "C" TYPE NAME; @@ -7868,8 +8263,7 @@ check_class_member_definition_namespace (tree decl) diagnostics. */ if (processing_specialization) return; - /* There are no restrictions on the placement of - explicit instantiations. */ + /* We check this in check_explicit_instantiation_namespace. */ if (processing_explicit_instantiation) return; /* [class.mfct] @@ -9445,7 +9839,7 @@ grokdeclarator (const cp_declarator *declarator, cp_storage_class storage_class; bool unsigned_p, signed_p, short_p, long_p, thread_p; bool type_was_error_mark_node = false; - bool parameter_pack_p = declarator? declarator->parameter_pack_p : false; + bool parameter_pack_p = declarator ? declarator->parameter_pack_p : false; bool template_type_arg = false; bool template_parm_flag = false; bool typedef_p = decl_spec_seq_has_spec_p (declspecs, ds_typedef); @@ -9646,6 +10040,10 @@ grokdeclarator (const cp_declarator *declarator, case cdk_ptrmem: break; + case cdk_decomp: + name = "decomposition"; + break; + case cdk_error: return error_mark_node; @@ -9855,15 +10253,15 @@ grokdeclarator (const cp_declarator *declarator, if (explicit_intN) { if (! int_n_enabled_p[declspecs->int_n_idx]) - { - error ("%<__int%d%> is not supported by this target", - int_n_data[declspecs->int_n_idx].bitsize); - explicit_intN = false; - } + { + error ("%<__int%d%> is not supported by this target", + int_n_data[declspecs->int_n_idx].bitsize); + explicit_intN = false; + } else if (pedantic && ! in_system_header_at (input_location)) - pedwarn (input_location, OPT_Wpedantic, - "ISO C++ does not support %<__int%d%> for %qs", - int_n_data[declspecs->int_n_idx].bitsize, name); + pedwarn (input_location, OPT_Wpedantic, + "ISO C++ does not support %<__int%d%> for %qs", + int_n_data[declspecs->int_n_idx].bitsize, name); } /* Now process the modifiers that were specified @@ -10089,6 +10487,79 @@ grokdeclarator (const cp_declarator *declarator, virtualp = 0; } + if (innermost_code == cdk_decomp) + { + location_t loc = (declarator->kind == cdk_reference + ? declarator->declarator->id_loc : declarator->id_loc); + if (inlinep) + error_at (declspecs->locations[ds_inline], + "decomposition declaration cannot be declared %<inline%>"); + if (typedef_p) + error_at (declspecs->locations[ds_typedef], + "decomposition declaration cannot be declared %<typedef%>"); + if (constexpr_p) + error_at (declspecs->locations[ds_constexpr], "decomposition " + "declaration cannot be declared %<constexpr%>"); + if (thread_p) + error_at (declspecs->locations[ds_thread], + "decomposition declaration cannot be declared %qs", + declspecs->gnu_thread_keyword_p + ? "__thread" : "thread_local"); + if (concept_p) + error_at (declspecs->locations[ds_concept], + "decomposition declaration cannot be declared %<concept%>"); + switch (storage_class) + { + case sc_none: + break; + case sc_register: + error_at (loc, "decomposition declaration cannot be declared " + "%<register%>"); + break; + case sc_static: + error_at (loc, "decomposition declaration cannot be declared " + "%<static%>"); + break; + case sc_extern: + error_at (loc, "decomposition declaration cannot be declared " + "%<extern%>"); + break; + case sc_mutable: + error_at (loc, "decomposition declaration cannot be declared " + "%<mutable%>"); + break; + case sc_auto: + error_at (loc, "decomposition declaration cannot be declared " + "C++98 %<auto%>"); + break; + default: + gcc_unreachable (); + } + if (TREE_CODE (type) != TEMPLATE_TYPE_PARM + || TYPE_IDENTIFIER (type) != get_identifier ("auto")) + { + if (type != error_mark_node) + { + error_at (loc, "decomposition declaration cannot be declared " + "with type %qT", type); + inform (loc, + "type must be cv-qualified %<auto%> or reference to " + "cv-qualified %<auto%>"); + } + type = build_qualified_type (make_auto (), type_quals); + declspecs->type = type; + } + inlinep = 0; + typedef_p = 0; + constexpr_p = 0; + thread_p = 0; + concept_p = 0; + storage_class = sc_none; + staticp = 0; + declspecs->storage_class = sc_none; + declspecs->locations[ds_thread] = UNKNOWN_LOCATION; + } + /* Static anonymous unions are dealt with here. */ if (staticp && decl_context == TYPENAME && declspecs->type @@ -10228,7 +10699,7 @@ grokdeclarator (const cp_declarator *declarator, attr_flags); } - if (declarator->kind == cdk_id) + if (declarator->kind == cdk_id || declarator->kind == cdk_decomp) break; inner_declarator = declarator->declarator; @@ -10739,6 +11210,7 @@ grokdeclarator (const cp_declarator *declarator, is non-NULL, we know it is a cdk_id declarator; otherwise, we would not have exited the loop above. */ if (declarator + && declarator->kind == cdk_id && declarator->u.id.qualifying_scope && MAYBE_CLASS_TYPE_P (declarator->u.id.qualifying_scope)) { @@ -10750,13 +11222,14 @@ grokdeclarator (const cp_declarator *declarator, { if (friendp) { - permerror (input_location, "member functions are implicitly friends of their class"); + permerror (input_location, "member functions are implicitly " + "friends of their class"); friendp = 0; } else permerror (declarator->id_loc, - "extra qualification %<%T::%> on member %qs", - ctype, name); + "extra qualification %<%T::%> on member %qs", + ctype, name); } else if (/* If the qualifying type is already complete, then we can skip the following checks. */ @@ -11129,7 +11602,8 @@ grokdeclarator (const cp_declarator *declarator, else if (unqualified_id == NULL_TREE && decl_context != PARM && decl_context != CATCHPARM && TREE_CODE (type) != UNION_TYPE - && ! bitfield) + && ! bitfield + && innermost_code != cdk_decomp) { error ("abstract declarator %qT used as declaration", type); return error_mark_node; @@ -11715,6 +12189,14 @@ grokdeclarator (const cp_declarator *declarator, if (inlinep) mark_inline_variable (decl); + if (innermost_code == cdk_decomp) + { + gcc_assert (declarator && declarator->kind == cdk_decomp); + DECL_SOURCE_LOCATION (decl) = declarator->id_loc; + retrofit_lang_decl (decl); + DECL_ARTIFICIAL (decl) = 1; + SET_DECL_DECOMPOSITION_P (decl); + } } if (VAR_P (decl) && !initialized) diff --git a/gcc/cp/error.c b/gcc/cp/error.c index aa92a7e6a6b..fe1f75110b8 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1049,7 +1049,9 @@ dump_decl (cxx_pretty_printer *pp, tree t, int flags) pp_cxx_whitespace (pp); pp_cxx_ws_string (pp, "="); pp_cxx_whitespace (pp); - dump_type (pp, DECL_ORIGINAL_TYPE (t), flags); + dump_type (pp, (DECL_ORIGINAL_TYPE (t) + ? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t)), + flags); break; } if ((flags & TFF_DECL_SPECIFIERS) diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 5eba4c3e18c..1fad79cb247 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1575,27 +1575,34 @@ build_aggr_init (tree exp, tree init, int flags, tsubst_flags_t complain) if (TREE_CODE (type) == ARRAY_TYPE) { - tree itype; + tree itype = init ? TREE_TYPE (init) : NULL_TREE; + int from_array = 0; - /* An array may not be initialized use the parenthesized - initialization form -- unless the initializer is "()". */ - if (init && TREE_CODE (init) == TREE_LIST) + if (VAR_P (exp) && DECL_DECOMPOSITION_P (exp)) + from_array = 1; + else { - if (complain & tf_error) - error ("bad array initializer"); - return error_mark_node; + /* An array may not be initialized use the parenthesized + initialization form -- unless the initializer is "()". */ + if (init && TREE_CODE (init) == TREE_LIST) + { + if (complain & tf_error) + error ("bad array initializer"); + return error_mark_node; + } + /* Must arrange to initialize each element of EXP + from elements of INIT. */ + if (cv_qualified_p (type)) + TREE_TYPE (exp) = cv_unqualified (type); + if (itype && cv_qualified_p (itype)) + TREE_TYPE (init) = cv_unqualified (itype); + from_array = (itype && same_type_p (TREE_TYPE (init), + TREE_TYPE (exp))); } - /* Must arrange to initialize each element of EXP - from elements of INIT. */ - itype = init ? TREE_TYPE (init) : NULL_TREE; - if (cv_qualified_p (type)) - TREE_TYPE (exp) = cv_unqualified (type); - if (itype && cv_qualified_p (itype)) - TREE_TYPE (init) = cv_unqualified (itype); + stmt_expr = build_vec_init (exp, NULL_TREE, init, /*explicit_value_init_p=*/false, - itype && same_type_p (TREE_TYPE (init), - TREE_TYPE (exp)), + from_array, complain); TREE_READONLY (exp) = was_const; TREE_THIS_VOLATILE (exp) = was_volatile; @@ -3891,6 +3898,18 @@ build_vec_init (tree base, tree maxindex, tree init, base = get_temp_regvar (ptype, rval); iterator = get_temp_regvar (ptrdiff_type_node, maxindex); + bool direct_init = false; + if (from_array && init && BRACE_ENCLOSED_INITIALIZER_P (init) + && CONSTRUCTOR_NELTS (init) == 1) + { + tree elt = CONSTRUCTOR_ELT (init, 0)->value; + if (TREE_CODE (TREE_TYPE (elt)) == ARRAY_TYPE) + { + direct_init = DIRECT_LIST_INIT_P (init); + init = elt; + } + } + /* If initializing one array from another, initialize element by element. We rely upon the below calls to do the argument checking. Evaluate the initializer before entering the try block. */ @@ -4115,6 +4134,8 @@ build_vec_init (tree base, tree maxindex, tree init, from = build1 (INDIRECT_REF, itype, base2); if (xvalue) from = move (from); + if (direct_init) + from = build_tree_list (NULL_TREE, from); } else from = NULL_TREE; diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index e574c271194..7ad65b89599 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -565,7 +565,8 @@ supplement_binding_1 (cxx_binding *binding, tree decl) } else { - diagnose_name_conflict (decl, bval); + if (!error_operand_p (bval)) + diagnose_name_conflict (decl, bval); ok = false; } @@ -3558,7 +3559,7 @@ set_decl_namespace (tree decl, tree scope, bool friendp) /* Since decl is a function, old should contain a function decl. */ if (!is_overloaded_fn (old)) goto complain; - /* A template can be explicitly specialized in any namespace. */ + /* We handle these in check_explicit_instantiation_namespace. */ if (processing_explicit_instantiation) return; if (processing_template_decl || processing_specialization) @@ -5392,7 +5393,7 @@ add_function (struct arg_lookup *k, tree fn) function templates are ignored. */; else if (k->fn_set && k->fn_set->add (fn)) /* It's already in the list. */; - else if (!k->functions) + else if (!k->functions && TREE_CODE (fn) != TEMPLATE_DECL) k->functions = fn; else if (fn == k->functions) ; diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 7b95dba72f2..9360ab0cbd6 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1668,6 +1668,7 @@ declarator_can_be_parameter_pack (cp_declarator *declarator) { case cdk_id: case cdk_array: + case cdk_decomp: found = true; break; @@ -1721,6 +1722,7 @@ function_declarator_p (const cp_declarator *declarator) && declarator->declarator->kind == cdk_id) return true; if (declarator->kind == cdk_id + || declarator->kind == cdk_decomp || declarator->kind == cdk_error) return false; declarator = declarator->declarator; @@ -2200,6 +2202,8 @@ static void cp_parser_static_assert (cp_parser *, bool); static tree cp_parser_decltype (cp_parser *); +static tree cp_parser_decomposition_declaration + (cp_parser *, cp_decl_specifier_seq *, tree *, location_t *); /* Declarators [gram.dcl.decl] */ @@ -3272,7 +3276,10 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree id, parser->scope, id, parser->scope); else if (TYPE_P (parser->scope)) { - if (cp_lexer_next_token_is (parser->lexer, CPP_LESS)) + if (!COMPLETE_TYPE_P (parser->scope)) + cxx_incomplete_type_error (location_of (id), NULL_TREE, + parser->scope); + else if (cp_lexer_next_token_is (parser->lexer, CPP_LESS)) error_at (location_of (id), "%qE in %q#T does not name a template type", id, parser->scope); @@ -6925,6 +6932,29 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, warn_for_memset (input_location, arg0, arg2, literal_mask); } + if (TREE_CODE (postfix_expression) == FUNCTION_DECL + && warn_restrict) + { + unsigned i; + tree arg; + FOR_EACH_VEC_SAFE_ELT (args, i, arg) + TREE_VISITED (arg) = 0; + + unsigned param_pos = 0; + for (tree decl = DECL_ARGUMENTS (postfix_expression); + decl != NULL_TREE; + decl = DECL_CHAIN (decl), param_pos++) + { + tree type = TREE_TYPE (decl); + if (POINTER_TYPE_P (type) && TYPE_RESTRICT (type) + && !TYPE_READONLY (TREE_TYPE (type))) + warn_for_restrict (param_pos, args); + } + + FOR_EACH_VEC_SAFE_ELT (args, i, arg) + TREE_VISITED (arg) = 0; + } + if (TREE_CODE (postfix_expression) == COMPONENT_REF) { tree instance = TREE_OPERAND (postfix_expression, 0); @@ -11445,16 +11475,45 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl, bool ivdep) { tree stmt, range_expr; - cxx_binding *binding = NULL; - tree name = NULL_TREE; + auto_vec <cxx_binding *, 16> bindings; + auto_vec <tree, 16> names; + tree decomp_first_name = NULL_TREE; + unsigned int decomp_cnt = 0; /* Get the range declaration momentarily out of the way so that the range expression doesn't clash with it. */ if (range_decl != error_mark_node) { - name = DECL_NAME (range_decl); - binding = IDENTIFIER_BINDING (name); - IDENTIFIER_BINDING (name) = binding->previous; + if (DECL_HAS_VALUE_EXPR_P (range_decl)) + { + tree v = DECL_VALUE_EXPR (range_decl); + /* For decomposition declaration get all of the corresponding + declarations out of the way. */ + if (TREE_CODE (v) == ARRAY_REF + && VAR_P (TREE_OPERAND (v, 0)) + && DECL_DECOMPOSITION_P (TREE_OPERAND (v, 0))) + { + tree d = range_decl; + range_decl = TREE_OPERAND (v, 0); + decomp_cnt = tree_to_uhwi (TREE_OPERAND (v, 1)) + 1; + decomp_first_name = d; + for (unsigned int i = 0; i < decomp_cnt; i++, d = DECL_CHAIN (d)) + { + tree name = DECL_NAME (d); + names.quick_push (name); + bindings.quick_push (IDENTIFIER_BINDING (name)); + IDENTIFIER_BINDING (name) + = IDENTIFIER_BINDING (name)->previous; + } + } + } + if (names.is_empty ()) + { + tree name = DECL_NAME (range_decl); + names.quick_push (name); + bindings.quick_push (IDENTIFIER_BINDING (name)); + IDENTIFIER_BINDING (name) = IDENTIFIER_BINDING (name)->previous; + } } if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) @@ -11465,11 +11524,12 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl, else range_expr = cp_parser_expression (parser); - /* Put the range declaration back into scope. */ - if (range_decl != error_mark_node) + /* Put the range declaration(s) back into scope. */ + for (unsigned int i = 0; i < names.length (); i++) { - binding->previous = IDENTIFIER_BINDING (name); - IDENTIFIER_BINDING (name) = binding; + cxx_binding *binding = bindings[i]; + binding->previous = IDENTIFIER_BINDING (names[i]); + IDENTIFIER_BINDING (names[i]) = binding; } /* If in template, STMT is converted to a normal for-statement @@ -11490,7 +11550,8 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl, else { stmt = begin_for_stmt (scope, init); - stmt = cp_convert_range_for (stmt, range_decl, range_expr, ivdep); + stmt = cp_convert_range_for (stmt, range_decl, range_expr, + decomp_first_name, decomp_cnt, ivdep); } return stmt; } @@ -11582,6 +11643,7 @@ do_range_for_auto_deduction (tree decl, tree range_expr) tree cp_convert_range_for (tree statement, tree range_decl, tree range_expr, + tree decomp_first_name, unsigned int decomp_cnt, bool ivdep) { tree begin, end; @@ -11655,6 +11717,8 @@ cp_convert_range_for (tree statement, tree range_decl, tree range_expr, tf_warning_or_error), /*is_constant_init*/false, NULL_TREE, LOOKUP_ONLYCONVERTING); + if (VAR_P (range_decl) && DECL_DECOMPOSITION_P (range_decl)) + cp_finish_decomp (range_decl, decomp_first_name, decomp_cnt); return statement; } @@ -12528,6 +12592,8 @@ cp_parser_block_declaration (cp_parser *parser, simple-declaration: decl-specifier-seq [opt] init-declarator-list [opt] ; + decl-specifier-seq ref-qualifier [opt] [ identifier-list ] + brace-or-equal-initializer ; init-declarator-list: init-declarator @@ -12613,6 +12679,45 @@ cp_parser_simple_declaration (cp_parser* parser, && !cp_parser_error_occurred (parser)) cp_parser_commit_to_tentative_parse (parser); + /* Look for C++17 decomposition declaration. */ + for (size_t n = 1; ; n++) + if (cp_lexer_nth_token_is (parser->lexer, n, CPP_AND) + || cp_lexer_nth_token_is (parser->lexer, n, CPP_AND_AND)) + continue; + else if (cp_lexer_nth_token_is (parser->lexer, n, CPP_OPEN_SQUARE) + && !cp_lexer_nth_token_is (parser->lexer, n + 1, CPP_OPEN_SQUARE) + && decl_specifiers.any_specifiers_p) + { + tree decl + = cp_parser_decomposition_declaration (parser, &decl_specifiers, + maybe_range_for_decl, + &init_loc); + + /* The next token should be either a `,' or a `;'. */ + cp_token *token = cp_lexer_peek_token (parser->lexer); + /* If it's a `;', we are done. */ + if (token->type == CPP_SEMICOLON || maybe_range_for_decl) + goto finish; + /* Anything else is an error. */ + else + { + /* If we have already issued an error message we don't need + to issue another one. */ + if ((decl != error_mark_node + && DECL_INITIAL (decl) != error_mark_node) + || cp_parser_uncommitted_to_tentative_parse_p (parser)) + cp_parser_error (parser, "expected %<,%> or %<;%>"); + /* Skip tokens until we reach the end of the statement. */ + cp_parser_skip_to_end_of_statement (parser); + /* If the next token is now a `;', consume it. */ + if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)) + cp_lexer_consume_token (parser->lexer); + goto done; + } + } + else + break; + tree last_type; last_type = NULL_TREE; @@ -12765,6 +12870,7 @@ cp_parser_simple_declaration (cp_parser* parser, } /* Consume the `;'. */ + finish: if (!maybe_range_for_decl) cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON); else if (cp_lexer_next_token_is (parser->lexer, CPP_COLON)) @@ -12780,6 +12886,143 @@ cp_parser_simple_declaration (cp_parser* parser, pop_deferring_access_checks (); } +/* Helper of cp_parser_simple_declaration, parse a decomposition declaration. + decl-specifier-seq ref-qualifier [opt] [ identifier-list ] + brace-or-equal-initializer ; */ + +static tree +cp_parser_decomposition_declaration (cp_parser *parser, + cp_decl_specifier_seq *decl_specifiers, + tree *maybe_range_for_decl, + location_t *init_loc) +{ + cp_ref_qualifier ref_qual = cp_parser_ref_qualifier_opt (parser); + location_t loc = cp_lexer_peek_token (parser->lexer)->location; + cp_parser_require (parser, CPP_OPEN_SQUARE, RT_OPEN_SQUARE); + + /* Parse the identifier-list. */ + auto_vec<cp_expr, 10> v; + if (!cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_SQUARE)) + while (true) + { + cp_expr e = cp_parser_identifier (parser); + if (e.get_value () == error_mark_node) + break; + v.safe_push (e); + if (!cp_lexer_next_token_is (parser->lexer, CPP_COMMA)) + break; + cp_lexer_consume_token (parser->lexer); + } + + location_t end_loc = cp_lexer_peek_token (parser->lexer)->location; + if (!cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE)) + { + end_loc = UNKNOWN_LOCATION; + cp_parser_skip_to_closing_parenthesis_1 (parser, true, CPP_CLOSE_SQUARE, + false); + if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_SQUARE)) + cp_lexer_consume_token (parser->lexer); + else + { + cp_parser_skip_to_end_of_statement (parser); + return error_mark_node; + } + } + + if (cxx_dialect < cxx1z) + pedwarn (loc, 0, "decomposition declaration only available with " + "-std=c++1z or -std=gnu++1z"); + + tree pushed_scope; + cp_declarator *declarator = make_declarator (cdk_decomp); + loc = end_loc == UNKNOWN_LOCATION ? loc : make_location (loc, loc, end_loc); + declarator->id_loc = loc; + if (ref_qual != REF_QUAL_NONE) + declarator = make_reference_declarator (TYPE_UNQUALIFIED, declarator, + ref_qual == REF_QUAL_RVALUE, + NULL_TREE); + tree decl = start_decl (declarator, decl_specifiers, SD_INITIALIZED, + NULL_TREE, decl_specifiers->attributes, + &pushed_scope); + + unsigned int i; + cp_expr e; + cp_decl_specifier_seq decl_specs; + clear_decl_specs (&decl_specs); + decl_specs.type = make_auto (); + tree prev = decl; + FOR_EACH_VEC_ELT (v, i, e) + { + if (i == 0) + declarator = make_id_declarator (NULL_TREE, e.get_value (), sfk_none); + else + declarator->u.id.unqualified_name = e.get_value (); + declarator->id_loc = e.get_location (); + tree elt_pushed_scope; + tree decl2 = start_decl (declarator, &decl_specs, SD_INITIALIZED, + NULL_TREE, NULL_TREE, &elt_pushed_scope); + if (decl2 == error_mark_node) + decl = error_mark_node; + else if (decl != error_mark_node && DECL_CHAIN (decl2) != prev) + { + /* Ensure we've diagnosed redeclaration if we aren't creating + a new VAR_DECL. */ + gcc_assert (errorcount); + decl = error_mark_node; + } + else + prev = decl2; + if (elt_pushed_scope) + pop_scope (elt_pushed_scope); + } + + if (v.is_empty ()) + { + error_at (loc, "empty decomposition declaration"); + decl = error_mark_node; + } + + if (maybe_range_for_decl == NULL + || cp_lexer_next_token_is_not (parser->lexer, CPP_COLON)) + { + bool non_constant_p = false, is_direct_init = false; + tree initializer; + *init_loc = cp_lexer_peek_token (parser->lexer)->location; + /* Parse the initializer. */ + if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) + { + initializer = cp_parser_braced_list (parser, &non_constant_p); + CONSTRUCTOR_IS_DIRECT_INIT (initializer) = 1; + is_direct_init = true; + } + else + { + /* Consume the `='. */ + cp_parser_require (parser, CPP_EQ, RT_EQ); + initializer = cp_parser_initializer_clause (parser, &non_constant_p); + } + + if (decl != error_mark_node) + { + cp_finish_decl (decl, initializer, non_constant_p, NULL_TREE, + is_direct_init ? LOOKUP_NORMAL : LOOKUP_IMPLICIT); + cp_finish_decomp (decl, prev, v.length ()); + } + } + else if (decl != error_mark_node) + { + *maybe_range_for_decl = prev; + /* Ensure DECL_VALUE_EXPR is created for all the decls but + the underlying DECL. */ + cp_finish_decomp (decl, prev, v.length ()); + } + + if (pushed_scope) + pop_scope (pushed_scope); + + return decl; +} + /* Parse a decl-specifier-seq. decl-specifier-seq: @@ -17004,24 +17247,28 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, globalscope = cp_parser_global_scope_opt (parser, /*current_scope_valid_p=*/false); /* Look for the nested-name-specifier. */ + tree nested_name_specifier; if (tag_type == typename_type && !globalscope) { - if (!cp_parser_nested_name_specifier (parser, + nested_name_specifier + = cp_parser_nested_name_specifier (parser, /*typename_keyword_p=*/true, /*check_dependency_p=*/true, /*type_p=*/true, - is_declaration)) + is_declaration); + if (!nested_name_specifier) return error_mark_node; } else /* Even though `typename' is not present, the proposed resolution to Core Issue 180 says that in `class A<T>::B', `B' should be considered a type-name, even if `A<T>' is dependent. */ - cp_parser_nested_name_specifier_opt (parser, - /*typename_keyword_p=*/true, - /*check_dependency_p=*/true, - /*type_p=*/true, - is_declaration); + nested_name_specifier + = cp_parser_nested_name_specifier_opt (parser, + /*typename_keyword_p=*/true, + /*check_dependency_p=*/true, + /*type_p=*/true, + is_declaration); /* For everything but enumeration types, consider a template-id. For an enumeration type, consider only a plain identifier. */ if (tag_type != enum_type) @@ -17069,8 +17316,18 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, else if (tag_type == typename_type && TREE_CODE (decl) != TYPE_DECL) ; else if (TREE_CODE (decl) == TYPE_DECL) - type = check_elaborated_type_specifier (tag_type, decl, - /*allow_template_p=*/true); + { + type = check_elaborated_type_specifier (tag_type, decl, + /*allow_template_p=*/true); + + /* If the next token is a semicolon, this must be a specialization, + instantiation, or friend declaration. Check the scope while we + still know whether or not we had a nested-name-specifier. */ + if (type != error_mark_node + && !nested_name_specifier && !is_friend + && cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)) + check_unqualified_spec_or_inst (type, token->location); + } else if (decl == error_mark_node) type = error_mark_node; } @@ -18588,6 +18845,7 @@ strip_declarator_types (tree type, cp_declarator *declarator) switch (d->kind) { case cdk_id: + case cdk_decomp: case cdk_error: d = NULL; break; @@ -22336,6 +22594,11 @@ cp_parser_class_head (cp_parser* parser, { type = TREE_TYPE (id); type = maybe_process_partial_specialization (type); + + /* Check the scope while we still know whether or not we had a + nested-name-specifier. */ + if (type != error_mark_node) + check_unqualified_spec_or_inst (type, type_start_token->location); } if (nested_name_specifier) pushed_scope = push_scope (nested_name_specifier); @@ -25457,6 +25720,7 @@ cp_parser_check_declarator_template_parameters (cp_parser* parser, return (cp_parser_check_declarator_template_parameters (parser, declarator->declarator, declarator_location)); + case cdk_decomp: case cdk_error: return true; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d4855d5bc35..7eeb27ddd1c 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -772,28 +772,29 @@ check_specialization_namespace (tree tmpl) /* [tmpl.expl.spec] - An explicit specialization shall be declared in the namespace of - which the template is a member, or, for member templates, in the - namespace of which the enclosing class or enclosing class - template is a member. An explicit specialization of a member - function, member class or static data member of a class template - shall be declared in the namespace of which the class template is - a member. */ + An explicit specialization shall be declared in a namespace enclosing the + specialized template. An explicit specialization whose declarator-id is + not qualified shall be declared in the nearest enclosing namespace of the + template, or, if the namespace is inline (7.3.1), any namespace from its + enclosing namespace set. */ if (current_scope() != DECL_CONTEXT (tmpl) && !at_namespace_scope_p ()) { error ("specialization of %qD must appear at namespace scope", tmpl); return false; } - if (is_associated_namespace (current_namespace, tpl_ns)) - /* Same or super-using namespace. */ + + if (cxx_dialect < cxx11 + ? is_associated_namespace (current_namespace, tpl_ns) + : is_ancestor (current_namespace, tpl_ns)) + /* Same or enclosing namespace. */ return true; else { permerror (input_location, "specialization of %qD in different namespace", tmpl); - permerror (DECL_SOURCE_LOCATION (tmpl), - " from definition of %q#D", tmpl); + inform (DECL_SOURCE_LOCATION (tmpl), + " from definition of %q#D", tmpl); return false; } } @@ -2586,6 +2587,36 @@ check_template_variable (tree decl) } } +/* An explicit specialization whose declarator-id or class-head-name is not + qualified shall be declared in the nearest enclosing namespace of the + template, or, if the namespace is inline (7.3.1), any namespace from its + enclosing namespace set. + + If the name declared in the explicit instantiation is an unqualified name, + the explicit instantiation shall appear in the namespace where its template + is declared or, if that namespace is inline (7.3.1), any namespace from its + enclosing namespace set. */ + +void +check_unqualified_spec_or_inst (tree t, location_t loc) +{ + tree tmpl = most_general_template (t); + if (DECL_NAMESPACE_SCOPE_P (tmpl) + && !is_associated_namespace (current_namespace, + CP_DECL_CONTEXT (tmpl))) + { + if (processing_specialization) + permerror (loc, "explicit specialization of %qD outside its " + "namespace must use a nested-name-specifier", tmpl); + else if (processing_explicit_instantiation + && cxx_dialect >= cxx11) + /* This was allowed in C++98, so only pedwarn. */ + pedwarn (loc, OPT_Wpedantic, "explicit instantiation of %qD " + "outside its namespace must use a nested-name-" + "specifier", tmpl); + } +} + /* Check to see if the function just declared, as indicated in DECLARATOR, and in DECL, is a specialization of a function template. We may also discover that the declaration is an explicit @@ -2949,15 +2980,8 @@ check_explicit_specialization (tree declarator, return error_mark_node; else { - if (!ctype && !was_template_id - && (specialization || member_specialization - || explicit_instantiation) - && !is_associated_namespace (CP_DECL_CONTEXT (decl), - CP_DECL_CONTEXT (tmpl))) - error ("%qD is not declared in %qD", - tmpl, current_namespace); - else if (TREE_CODE (decl) == FUNCTION_DECL - && DECL_HIDDEN_FRIEND_P (tmpl)) + if (TREE_CODE (decl) == FUNCTION_DECL + && DECL_HIDDEN_FRIEND_P (tmpl)) { if (pedwarn (DECL_SOURCE_LOCATION (decl), 0, "friend declaration %qD is not visible to " @@ -2965,6 +2989,9 @@ check_explicit_specialization (tree declarator, inform (DECL_SOURCE_LOCATION (tmpl), "friend declaration here"); } + else if (!ctype && !is_friend + && CP_DECL_CONTEXT (decl) == current_namespace) + check_unqualified_spec_or_inst (tmpl, DECL_SOURCE_LOCATION (decl)); tree gen_tmpl = most_general_template (tmpl); @@ -15284,6 +15311,55 @@ tsubst_find_omp_teams (tree *tp, int *walk_subtrees, void *) return NULL_TREE; } +/* Helper function for tsubst_expr. For decomposition declaration + artificial base DECL, which is tsubsted PATTERN_DECL, tsubst + also the corresponding decls representing the identifiers + of the decomposition declaration. Return DECL if successful + or error_mark_node otherwise, set *FIRST to the first decl + in the list chained through DECL_CHAIN and *CNT to the number + of such decls. */ + +static tree +tsubst_decomp_names (tree decl, tree pattern_decl, tree args, + tsubst_flags_t complain, tree in_decl, tree *first, + unsigned int *cnt) +{ + tree decl2, decl3, prev = decl; + *cnt = 0; + gcc_assert (DECL_NAME (decl) == NULL_TREE); + for (decl2 = DECL_CHAIN (pattern_decl); + decl2 + && VAR_P (decl2) + && DECL_DECOMPOSITION_P (decl2) + && DECL_NAME (decl2); + decl2 = DECL_CHAIN (decl2)) + { + (*cnt)++; + gcc_assert (DECL_HAS_VALUE_EXPR_P (decl2)); + tree v = DECL_VALUE_EXPR (decl2); + DECL_HAS_VALUE_EXPR_P (decl2) = 0; + SET_DECL_VALUE_EXPR (decl2, NULL_TREE); + decl3 = tsubst (decl2, args, complain, in_decl); + SET_DECL_VALUE_EXPR (decl2, v); + DECL_HAS_VALUE_EXPR_P (decl2) = 1; + if (VAR_P (decl3)) + DECL_TEMPLATE_INSTANTIATED (decl3) = 1; + maybe_push_decl (decl3); + if (error_operand_p (decl3)) + decl = error_mark_node; + else if (decl != error_mark_node + && DECL_CHAIN (decl3) != prev) + { + gcc_assert (errorcount); + decl = error_mark_node; + } + else + prev = decl3; + } + *first = prev; + return decl; +} + /* Like tsubst_copy for expressions, etc. but also does semantic processing. */ @@ -15427,6 +15503,16 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl, const_init = (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (pattern_decl)); cp_finish_decl (decl, init, const_init, NULL_TREE, 0); + if (VAR_P (decl) && DECL_DECOMPOSITION_P (decl)) + { + unsigned int cnt; + tree first; + decl = tsubst_decomp_names (decl, pattern_decl, args, + complain, in_decl, &first, + &cnt); + if (decl != error_mark_node) + cp_finish_decomp (decl, first, cnt); + } } } } @@ -15454,7 +15540,18 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl, decl = tsubst (decl, args, complain, in_decl); maybe_push_decl (decl); expr = RECUR (RANGE_FOR_EXPR (t)); - stmt = cp_convert_range_for (stmt, decl, expr, RANGE_FOR_IVDEP (t)); + if (VAR_P (decl) && DECL_DECOMPOSITION_P (decl)) + { + unsigned int cnt; + tree first; + decl = tsubst_decomp_names (decl, RANGE_FOR_DECL (t), args, + complain, in_decl, &first, &cnt); + stmt = cp_convert_range_for (stmt, decl, expr, first, cnt, + RANGE_FOR_IVDEP (t)); + } + else + stmt = cp_convert_range_for (stmt, decl, expr, NULL_TREE, 0, + RANGE_FOR_IVDEP (t)); RECUR (RANGE_FOR_BODY (t)); finish_for_stmt (stmt); } @@ -24773,7 +24870,15 @@ do_auto_deduction (tree type, tree init, tree auto_node, init = resolve_nondeduced_context (init, complain); - if (AUTO_IS_DECLTYPE (auto_node)) + if (context == adc_decomp_type + && auto_node == type + && init != error_mark_node + && TREE_CODE (TREE_TYPE (init)) == ARRAY_TYPE) + /* [dcl.decomp]/1 - if decomposition declaration has no ref-qualifiers + and initializer has array type, deduce cv-qualified array type. */ + return cp_build_qualified_type_real (TREE_TYPE (init), TYPE_QUALS (type), + complain); + else if (AUTO_IS_DECLTYPE (auto_node)) { bool id = (DECL_P (init) || ((TREE_CODE (init) == COMPONENT_REF @@ -24858,6 +24963,7 @@ do_auto_deduction (tree type, tree init, tree auto_node, error("placeholder constraints not satisfied"); break; case adc_variable_type: + case adc_decomp_type: error ("deduced initializer does not satisfy " "placeholder constraints"); break; @@ -24866,7 +24972,7 @@ do_auto_deduction (tree type, tree init, tree auto_node, "placeholder constraints"); break; case adc_requirement: - error ("deduced expression type does not saatisy " + error ("deduced expression type does not satisfy " "placeholder constraints"); break; } diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 1a7c478d4ec..0164f2e5c74 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2259,7 +2259,7 @@ perform_koenig_lookup (cp_expr fn, vec<tree, va_gc> *args, } } - if (fn && template_id) + if (fn && template_id && fn != error_mark_node) fn = build2 (TEMPLATE_ID_EXPR, unknown_type_node, fn, tmpl_args); return fn; @@ -8873,6 +8873,9 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p, if (identifier_p (expr)) expr = lookup_name (expr); + if (VAR_P (expr) && DECL_HAS_VALUE_EXPR_P (expr)) + expr = DECL_VALUE_EXPR (expr); + if (INDIRECT_REF_P (expr)) /* This can happen when the expression is, e.g., "a.b". Just look at the underlying operand. */ diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 7872dd29cf8..c59543768a8 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -142,6 +142,9 @@ lvalue_kind (const_tree ref) return clk_none; /* FALLTHRU */ case VAR_DECL: + if (DECL_HAS_VALUE_EXPR_P (ref)) + return lvalue_kind (DECL_VALUE_EXPR (CONST_CAST_TREE (ref))); + if (TREE_READONLY (ref) && ! TREE_STATIC (ref) && DECL_LANG_SPECIFIC (ref) && DECL_IN_AGGR_P (ref)) @@ -1012,6 +1015,13 @@ tree cp_build_reference_type (tree to_type, bool rval) { tree lvalue_ref, t; + + if (TREE_CODE (to_type) == REFERENCE_TYPE) + { + rval = rval && TYPE_REF_IS_RVALUE (to_type); + to_type = TREE_TYPE (to_type); + } + lvalue_ref = build_reference_type (to_type); if (!rval) return lvalue_ref; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 211696cf029..2d8b7b10440 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1885,6 +1885,12 @@ is_bitfield_expr_with_lowered_type (const_tree exp) return DECL_BIT_FIELD_TYPE (field); } + case VAR_DECL: + if (DECL_HAS_VALUE_EXPR_P (exp)) + return is_bitfield_expr_with_lowered_type (DECL_VALUE_EXPR + (CONST_CAST_TREE (exp))); + return NULL_TREE; + CASE_CONVERT: if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (exp, 0))) == TYPE_MAIN_VARIANT (TREE_TYPE (exp))) @@ -3835,6 +3841,10 @@ convert_arguments (tree typelist, vec<tree, va_gc> **values, tree fndecl, { for (; typetail != void_list_node; ++i) { + /* After DR777, with explicit template args we can end up with a + default argument followed by no default argument. */ + if (!TREE_PURPOSE (typetail)) + break; tree parmval = convert_default_arg (TREE_VALUE (typetail), TREE_PURPOSE (typetail), @@ -3850,9 +3860,10 @@ convert_arguments (tree typelist, vec<tree, va_gc> **values, tree fndecl, break; } } - else + + if (typetail && typetail != void_list_node) { - if (complain & tf_error) + if (complain & tf_error) error_args_num (input_location, fndecl, /*too_many_p=*/false); return -1; } diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 4ec4dcd31e5..8e2f46617b8 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -292,7 +292,7 @@ Objective-C and Objective-C++ Dialects}. -Wparentheses -Wno-pedantic-ms-format @gol -Wplacement-new -Wplacement-new=@var{n} @gol -Wpointer-arith -Wno-pointer-to-int-cast @gol --Wno-pragmas -Wredundant-decls -Wno-return-local-addr @gol +-Wno-pragmas -Wredundant-decls -Wrestrict -Wno-return-local-addr @gol -Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar @gol -Wshadow=global, -Wshadow=local, -Wshadow=compatible-local @gol -Wshift-overflow -Wshift-overflow=@var{n} @gol @@ -650,7 +650,8 @@ Objective-C and Objective-C++ Dialects}. -mpure-code} @emph{AVR Options} -@gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol +@gccoptlist{-mmcu=@var{mcu} -mabsdata -maccumulate-args @gol +-mbranch-cost=@var{cost} @gol -mcall-prologues -mint8 -mn_flash=@var{size} -mno-interrupts @gol -mrelax -mrmw -mstrict-X -mtiny-stack -mfract-convert-truncate -nodevicelib @gol -Waddr-space-convert -Wmisspelled-isr} @@ -6194,6 +6195,12 @@ reduce the padding and so make the structure smaller. Warn if anything is declared more than once in the same scope, even in cases where multiple declaration is valid and changes nothing. +@item -Wrestrict +@opindex Wrestrict +@opindex Wno-restrict +Warn when an argument passed to a restrict-qualified parameter +aliases with another argument. + @item -Wnested-externs @r{(C and Objective-C only)} @opindex Wnested-externs @opindex Wno-nested-externs @@ -10504,13 +10511,18 @@ To optimize the program based on the collected profile information, use Alter the update method for an application instrumented for profile feedback based optimization. The @var{method} argument should be one of -@samp{single} or @samp{atomic}. The first one is useful for single-threaded -applications, while the second one prevents profile corruption by emitting -thread-safe code. +@samp{single}, @samp{atomic} or @samp{prefer-atomic}. +The first one is useful for single-threaded applications, +while the second one prevents profile corruption by emitting thread-safe code. @strong{Warning:} When an application does not properly join all threads (or creates an detached thread), a profile file can be still corrupted. +Using @samp{prefer-atomic} would be transformed either to @samp{atomic}, +when supported by a target, or to @samp{single} otherwise. The GCC driver +automatically selects @samp{prefer-atomic} when @option{-pthread} +is present in the command line. + @item -fsanitize=address @opindex fsanitize=address Enable AddressSanitizer, a fast memory error detector. @@ -15311,6 +15323,13 @@ GCC supports the following AVR devices and ISAs: @include avr-mmcu.texi +@item -mabsdata +@opindex mabsdata + +Assume that all data in static storage can be accessed by LDS / STS +instructions. This option has only an effect on reduced Tiny devices like +ATtiny40. + @item -maccumulate-args @opindex maccumulate-args Accumulate outgoing function arguments and acquire/release the needed diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi index 692d9b51b63..175f60dcf08 100644 --- a/gcc/doc/rtl.texi +++ b/gcc/doc/rtl.texi @@ -1882,7 +1882,7 @@ When used as an rvalue, the low-order bits of the @code{subreg} are taken from @var{reg} while the high-order bits may or may not be defined. -The high-order bits of rvalues are in the following circumstances: +The high-order bits of rvalues are defined in the following circumstances: @itemize @item @code{subreg}s of @code{mem} diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c index 2e0aae40827..922a0c1d589 100644 --- a/gcc/dwarf2asm.c +++ b/gcc/dwarf2asm.c @@ -622,53 +622,55 @@ dw2_asm_output_data_uleb128 (unsigned HOST_WIDE_INT value, va_start (ap, comment); -#ifdef HAVE_AS_LEB128 - fputs ("\t.uleb128 ", asm_out_file); - fprint_whex (asm_out_file, value); - - if (flag_debug_asm && comment) + if (HAVE_AS_LEB128) { - fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START); - vfprintf (asm_out_file, comment, ap); + fputs ("\t.uleb128 ", asm_out_file); + fprint_whex (asm_out_file, value); + + if (flag_debug_asm && comment) + { + fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START); + vfprintf (asm_out_file, comment, ap); + } } -#else - { - unsigned HOST_WIDE_INT work = value; - const char *byte_op = targetm.asm_out.byte_op; - - if (byte_op) - fputs (byte_op, asm_out_file); - do - { - int byte = (work & 0x7f); - work >>= 7; - if (work != 0) - /* More bytes to follow. */ - byte |= 0x80; - - if (byte_op) - { - fprintf (asm_out_file, "%#x", byte); - if (work != 0) - fputc (',', asm_out_file); - } - else - assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1); - } - while (work != 0); - - if (flag_debug_asm) + else { - fprintf (asm_out_file, "\t%s uleb128 " HOST_WIDE_INT_PRINT_HEX, - ASM_COMMENT_START, value); - if (comment) + unsigned HOST_WIDE_INT work = value; + const char *byte_op = targetm.asm_out.byte_op; + + if (byte_op) + fputs (byte_op, asm_out_file); + do { - fputs ("; ", asm_out_file); - vfprintf (asm_out_file, comment, ap); + int byte = (work & 0x7f); + work >>= 7; + if (work != 0) + /* More bytes to follow. */ + byte |= 0x80; + + if (byte_op) + { + fprintf (asm_out_file, "%#x", byte); + if (work != 0) + fputc (',', asm_out_file); + } + else + assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1); + } + while (work != 0); + + if (flag_debug_asm) + { + fprintf (asm_out_file, "\t%s uleb128 " HOST_WIDE_INT_PRINT_HEX, + ASM_COMMENT_START, value); + if (comment) + { + fputs ("; ", asm_out_file); + vfprintf (asm_out_file, comment, ap); + } } } - } -#endif + putc ('\n', asm_out_file); va_end (ap); @@ -707,55 +709,57 @@ dw2_asm_output_data_sleb128 (HOST_WIDE_INT value, va_start (ap, comment); -#ifdef HAVE_AS_LEB128 - fprintf (asm_out_file, "\t.sleb128 " HOST_WIDE_INT_PRINT_DEC, value); - - if (flag_debug_asm && comment) + if (HAVE_AS_LEB128) { - fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START); - vfprintf (asm_out_file, comment, ap); + fprintf (asm_out_file, "\t.sleb128 " HOST_WIDE_INT_PRINT_DEC, value); + + if (flag_debug_asm && comment) + { + fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START); + vfprintf (asm_out_file, comment, ap); + } } -#else - { - HOST_WIDE_INT work = value; - int more, byte; - const char *byte_op = targetm.asm_out.byte_op; - - if (byte_op) - fputs (byte_op, asm_out_file); - do - { - byte = (work & 0x7f); - /* arithmetic shift */ - work >>= 7; - more = !((work == 0 && (byte & 0x40) == 0) - || (work == -1 && (byte & 0x40) != 0)); - if (more) - byte |= 0x80; - - if (byte_op) - { - fprintf (asm_out_file, "%#x", byte); - if (more) - fputc (',', asm_out_file); - } - else - assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1); - } - while (more); - - if (flag_debug_asm) + else { - fprintf (asm_out_file, "\t%s sleb128 " HOST_WIDE_INT_PRINT_DEC, - ASM_COMMENT_START, value); - if (comment) + HOST_WIDE_INT work = value; + int more, byte; + const char *byte_op = targetm.asm_out.byte_op; + + if (byte_op) + fputs (byte_op, asm_out_file); + do { - fputs ("; ", asm_out_file); - vfprintf (asm_out_file, comment, ap); + byte = (work & 0x7f); + /* arithmetic shift */ + work >>= 7; + more = !((work == 0 && (byte & 0x40) == 0) + || (work == -1 && (byte & 0x40) != 0)); + if (more) + byte |= 0x80; + + if (byte_op) + { + fprintf (asm_out_file, "%#x", byte); + if (more) + fputc (',', asm_out_file); + } + else + assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1); + } + while (more); + + if (flag_debug_asm) + { + fprintf (asm_out_file, "\t%s sleb128 " HOST_WIDE_INT_PRINT_DEC, + ASM_COMMENT_START, value); + if (comment) + { + fputs ("; ", asm_out_file); + vfprintf (asm_out_file, comment, ap); + } } } - } -#endif + fputc ('\n', asm_out_file); va_end (ap); @@ -770,14 +774,12 @@ dw2_asm_output_delta_uleb128 (const char *lab1 ATTRIBUTE_UNUSED, va_start (ap, comment); -#ifdef HAVE_AS_LEB128 + gcc_assert (HAVE_AS_LEB128); + fputs ("\t.uleb128 ", asm_out_file); assemble_name (asm_out_file, lab1); putc ('-', asm_out_file); assemble_name (asm_out_file, lab2); -#else - gcc_unreachable (); -#endif if (flag_debug_asm && comment) { @@ -800,14 +802,12 @@ dw2_asm_output_delta_sleb128 (const char *lab1 ATTRIBUTE_UNUSED, va_start (ap, comment); -#ifdef HAVE_AS_LEB128 + gcc_assert (HAVE_AS_LEB128); + fputs ("\t.sleb128 ", asm_out_file); assemble_name (asm_out_file, lab1); putc ('-', asm_out_file); assemble_name (asm_out_file, lab2); -#else - gcc_unreachable (); -#endif if (flag_debug_asm && comment) { diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index f9ec0903b78..58a5e1ad2ff 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9550,10 +9550,8 @@ output_loc_list (dw_loc_list_ref list_head) ASM_OUTPUT_LABEL (asm_out_file, list_head->ll_symbol); dw_loc_list_ref curr = list_head; -#ifdef HAVE_AS_LEB128 const char *last_section = NULL; const char *base_label = NULL; -#endif /* Walk the location list, and output each range + expression. */ for (curr = list_head; curr != NULL; curr = curr->dw_loc_next) @@ -9588,8 +9586,7 @@ output_loc_list (dw_loc_list_ref list_head) "Location list length (%s)", list_head->ll_symbol); } -#ifdef HAVE_AS_LEB128 - else if (!have_multiple_function_sections) + else if (!have_multiple_function_sections && HAVE_AS_LEB128) { /* If all code is in .text section, the base address is already provided by the CU attributes. Use @@ -9605,7 +9602,7 @@ output_loc_list (dw_loc_list_ref list_head) "Location list end address (%s)", list_head->ll_symbol); } - else + else if (HAVE_AS_LEB128) { /* Otherwise, find out how many consecutive entries could share the same base entry. If just one, emit DW_LLE_start_length, @@ -9668,7 +9665,6 @@ output_loc_list (dw_loc_list_ref list_head) "(%s)", list_head->ll_symbol); } } -#else /* The assembler does not support .uleb128 directive. Emit DW_LLE_start_end with a pair of absolute addresses. */ else @@ -9683,7 +9679,6 @@ output_loc_list (dw_loc_list_ref list_head) "Location list end address (%s)", list_head->ll_symbol); } -#endif } else if (dwarf_split_debug_info) { @@ -11054,9 +11049,7 @@ output_rnglists (void) dw_ranges *r; char l1[MAX_ARTIFICIAL_LABEL_BYTES]; char l2[MAX_ARTIFICIAL_LABEL_BYTES]; -#ifdef HAVE_AS_LEB128 char basebuf[MAX_ARTIFICIAL_LABEL_BYTES]; -#endif switch_to_section (debug_ranges_section); ASM_OUTPUT_LABEL (asm_out_file, ranges_section_label); @@ -11090,10 +11083,8 @@ output_rnglists (void) } const char *lab = ""; -#ifdef HAVE_AS_LEB128 unsigned int len = vec_safe_length (ranges_table); const char *base = NULL; -#endif FOR_EACH_VEC_SAFE_ELT (ranges_table, i, r) { int block_num = r->num; @@ -11103,10 +11094,8 @@ output_rnglists (void) ASM_OUTPUT_LABEL (asm_out_file, r->label); lab = r->label; } -#ifdef HAVE_AS_LEB128 - if (r->label || r->maybe_new_sec) + if (HAVE_AS_LEB128 && (r->label || r->maybe_new_sec)) base = NULL; -#endif if (block_num > 0) { char blabel[MAX_ARTIFICIAL_LABEL_BYTES]; @@ -11115,62 +11104,65 @@ output_rnglists (void) ASM_GENERATE_INTERNAL_LABEL (blabel, BLOCK_BEGIN_LABEL, block_num); ASM_GENERATE_INTERNAL_LABEL (elabel, BLOCK_END_LABEL, block_num); -#ifdef HAVE_AS_LEB128 - /* If all code is in the text section, then the compilation - unit base address defaults to DW_AT_low_pc, which is the - base of the text section. */ - if (!have_multiple_function_sections) + if (HAVE_AS_LEB128) { - dw2_asm_output_data (1, DW_RLE_offset_pair, - "DW_RLE_offset_pair (%s)", lab); - dw2_asm_output_delta_uleb128 (blabel, text_section_label, - "Range begin address (%s)", lab); - dw2_asm_output_delta_uleb128 (elabel, text_section_label, - "Range end address (%s)", lab); - continue; - } - if (base == NULL) - { - dw_ranges *r2 = NULL; - if (i < len - 1) - r2 = &(*ranges_table)[i + 1]; - if (r2 - && r2->num != 0 - && r2->label == NULL - && !r2->maybe_new_sec) + /* If all code is in the text section, then the compilation + unit base address defaults to DW_AT_low_pc, which is the + base of the text section. */ + if (!have_multiple_function_sections) { - dw2_asm_output_data (1, DW_RLE_base_address, - "DW_RLE_base_address (%s)", lab); - dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, - "Base address (%s)", lab); - strcpy (basebuf, blabel); - base = basebuf; + dw2_asm_output_data (1, DW_RLE_offset_pair, + "DW_RLE_offset_pair (%s)", lab); + dw2_asm_output_delta_uleb128 (blabel, text_section_label, + "Range begin address (%s)", lab); + dw2_asm_output_delta_uleb128 (elabel, text_section_label, + "Range end address (%s)", lab); + continue; + } + if (base == NULL) + { + dw_ranges *r2 = NULL; + if (i < len - 1) + r2 = &(*ranges_table)[i + 1]; + if (r2 + && r2->num != 0 + && r2->label == NULL + && !r2->maybe_new_sec) + { + dw2_asm_output_data (1, DW_RLE_base_address, + "DW_RLE_base_address (%s)", lab); + dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, + "Base address (%s)", lab); + strcpy (basebuf, blabel); + base = basebuf; + } } + if (base) + { + dw2_asm_output_data (1, DW_RLE_offset_pair, + "DW_RLE_offset_pair (%s)", lab); + dw2_asm_output_delta_uleb128 (blabel, base, + "Range begin address (%s)", lab); + dw2_asm_output_delta_uleb128 (elabel, base, + "Range end address (%s)", lab); + continue; + } + dw2_asm_output_data (1, DW_RLE_start_length, + "DW_RLE_start_length (%s)", lab); + dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, + "Range begin address (%s)", lab); + dw2_asm_output_delta_uleb128 (elabel, blabel, + "Range length (%s)", lab); } - if (base) + else { - dw2_asm_output_data (1, DW_RLE_offset_pair, - "DW_RLE_offset_pair (%s)", lab); - dw2_asm_output_delta_uleb128 (blabel, base, - "Range begin address (%s)", lab); - dw2_asm_output_delta_uleb128 (elabel, base, - "Range end address (%s)", lab); - continue; + dw2_asm_output_data (1, DW_RLE_start_end, + "DW_RLE_start_end (%s)", lab); + dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, + "Range begin address (%s)", lab); + dw2_asm_output_addr (DWARF2_ADDR_SIZE, elabel, + "Range end address (%s)", lab); } - dw2_asm_output_data (1, DW_RLE_start_length, - "DW_RLE_start_length (%s)", lab); - dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, - "Range begin address (%s)", lab); - dw2_asm_output_delta_uleb128 (elabel, blabel, - "Range length (%s)", lab); -#else - dw2_asm_output_data (1, DW_RLE_start_end, - "DW_RLE_start_end (%s)", lab); - dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, - "Range begin address (%s)", lab); - dw2_asm_output_addr (DWARF2_ADDR_SIZE, elabel, - "Range end address (%s)", lab); -#endif } /* Negative block_num stands for an index into ranges_by_label. */ @@ -11182,21 +11174,24 @@ output_rnglists (void) if (!have_multiple_function_sections) gcc_unreachable (); -#ifdef HAVE_AS_LEB128 - dw2_asm_output_data (1, DW_RLE_start_length, - "DW_RLE_start_length (%s)", lab); - dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, - "Range begin address (%s)", lab); - dw2_asm_output_delta_uleb128 (elabel, blabel, - "Range length (%s)", lab); -#else - dw2_asm_output_data (1, DW_RLE_start_end, - "DW_RLE_start_end (%s)", lab); - dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, - "Range begin address (%s)", lab); - dw2_asm_output_addr (DWARF2_ADDR_SIZE, elabel, - "Range end address (%s)", lab); -#endif + if (HAVE_AS_LEB128) + { + dw2_asm_output_data (1, DW_RLE_start_length, + "DW_RLE_start_length (%s)", lab); + dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, + "Range begin address (%s)", lab); + dw2_asm_output_delta_uleb128 (elabel, blabel, + "Range length (%s)", lab); + } + else + { + dw2_asm_output_data (1, DW_RLE_start_end, + "DW_RLE_start_end (%s)", lab); + dw2_asm_output_addr (DWARF2_ADDR_SIZE, blabel, + "Range begin address (%s)", lab); + dw2_asm_output_addr (DWARF2_ADDR_SIZE, elabel, + "Range end address (%s)", lab); + } } else dw2_asm_output_data (1, DW_RLE_end_of_list, diff --git a/gcc/except.c b/gcc/except.c index e811b56074d..2379fb3c090 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -216,10 +216,8 @@ static int add_call_site (rtx, int, int); static void push_uleb128 (vec<uchar, va_gc> **, unsigned int); static void push_sleb128 (vec<uchar, va_gc> **, int); -#ifndef HAVE_AS_LEB128 static int dw2_size_of_call_site_table (int); static int sjlj_size_of_call_site_table (void); -#endif static void dw2_output_call_site_table (int, int); static void sjlj_output_call_site_table (void); @@ -2696,7 +2694,6 @@ push_sleb128 (vec<uchar, va_gc> **data_area, int value) } -#ifndef HAVE_AS_LEB128 static int dw2_size_of_call_site_table (int section) { @@ -2731,7 +2728,6 @@ sjlj_size_of_call_site_table (void) return size; } -#endif static void dw2_output_call_site_table (int cs_format, int section) @@ -2921,13 +2917,10 @@ static void output_one_function_exception_table (int section) { int tt_format, cs_format, lp_format, i; -#ifdef HAVE_AS_LEB128 char ttype_label[32]; char cs_after_size_label[32]; char cs_end_label[32]; -#else int call_site_len; -#endif int have_tt_data; int tt_format_size = 0; @@ -2942,11 +2935,11 @@ output_one_function_exception_table (int section) else { tt_format = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/1); -#ifdef HAVE_AS_LEB128 - ASM_GENERATE_INTERNAL_LABEL (ttype_label, - section ? "LLSDATTC" : "LLSDATT", - current_function_funcdef_no); -#endif + if (HAVE_AS_LEB128) + ASM_GENERATE_INTERNAL_LABEL (ttype_label, + section ? "LLSDATTC" : "LLSDATT", + current_function_funcdef_no); + tt_format_size = size_of_encoded_value (tt_format); assemble_align (tt_format_size * BITS_PER_UNIT); @@ -2972,86 +2965,93 @@ output_one_function_exception_table (int section) dw2_asm_output_data (1, tt_format, "@TType format (%s)", eh_data_format_name (tt_format)); -#ifndef HAVE_AS_LEB128 - if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ) - call_site_len = sjlj_size_of_call_site_table (); - else - call_site_len = dw2_size_of_call_site_table (section); -#endif + if (!HAVE_AS_LEB128) + { + if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ) + call_site_len = sjlj_size_of_call_site_table (); + else + call_site_len = dw2_size_of_call_site_table (section); + } /* A pc-relative 4-byte displacement to the @TType data. */ if (have_tt_data) { -#ifdef HAVE_AS_LEB128 - char ttype_after_disp_label[32]; - ASM_GENERATE_INTERNAL_LABEL (ttype_after_disp_label, - section ? "LLSDATTDC" : "LLSDATTD", - current_function_funcdef_no); - dw2_asm_output_delta_uleb128 (ttype_label, ttype_after_disp_label, - "@TType base offset"); - ASM_OUTPUT_LABEL (asm_out_file, ttype_after_disp_label); -#else - /* Ug. Alignment queers things. */ - unsigned int before_disp, after_disp, last_disp, disp; + if (HAVE_AS_LEB128) + { + char ttype_after_disp_label[32]; + ASM_GENERATE_INTERNAL_LABEL (ttype_after_disp_label, + section ? "LLSDATTDC" : "LLSDATTD", + current_function_funcdef_no); + dw2_asm_output_delta_uleb128 (ttype_label, ttype_after_disp_label, + "@TType base offset"); + ASM_OUTPUT_LABEL (asm_out_file, ttype_after_disp_label); + } + else + { + /* Ug. Alignment queers things. */ + unsigned int before_disp, after_disp, last_disp, disp; - before_disp = 1 + 1; - after_disp = (1 + size_of_uleb128 (call_site_len) - + call_site_len - + vec_safe_length (crtl->eh.action_record_data) - + (vec_safe_length (cfun->eh->ttype_data) - * tt_format_size)); + before_disp = 1 + 1; + after_disp = (1 + size_of_uleb128 (call_site_len) + + call_site_len + + vec_safe_length (crtl->eh.action_record_data) + + (vec_safe_length (cfun->eh->ttype_data) + * tt_format_size)); - disp = after_disp; - do - { - unsigned int disp_size, pad; + disp = after_disp; + do + { + unsigned int disp_size, pad; - last_disp = disp; - disp_size = size_of_uleb128 (disp); - pad = before_disp + disp_size + after_disp; - if (pad % tt_format_size) - pad = tt_format_size - (pad % tt_format_size); - else - pad = 0; - disp = after_disp + pad; - } - while (disp != last_disp); + last_disp = disp; + disp_size = size_of_uleb128 (disp); + pad = before_disp + disp_size + after_disp; + if (pad % tt_format_size) + pad = tt_format_size - (pad % tt_format_size); + else + pad = 0; + disp = after_disp + pad; + } + while (disp != last_disp); - dw2_asm_output_data_uleb128 (disp, "@TType base offset"); -#endif - } + dw2_asm_output_data_uleb128 (disp, "@TType base offset"); + } + } /* Indicate the format of the call-site offsets. */ -#ifdef HAVE_AS_LEB128 - cs_format = DW_EH_PE_uleb128; -#else - cs_format = DW_EH_PE_udata4; -#endif + if (HAVE_AS_LEB128) + cs_format = DW_EH_PE_uleb128; + else + cs_format = DW_EH_PE_udata4; + dw2_asm_output_data (1, cs_format, "call-site format (%s)", eh_data_format_name (cs_format)); -#ifdef HAVE_AS_LEB128 - ASM_GENERATE_INTERNAL_LABEL (cs_after_size_label, - section ? "LLSDACSBC" : "LLSDACSB", - current_function_funcdef_no); - ASM_GENERATE_INTERNAL_LABEL (cs_end_label, - section ? "LLSDACSEC" : "LLSDACSE", - current_function_funcdef_no); - dw2_asm_output_delta_uleb128 (cs_end_label, cs_after_size_label, - "Call-site table length"); - ASM_OUTPUT_LABEL (asm_out_file, cs_after_size_label); - if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ) - sjlj_output_call_site_table (); - else - dw2_output_call_site_table (cs_format, section); - ASM_OUTPUT_LABEL (asm_out_file, cs_end_label); -#else - dw2_asm_output_data_uleb128 (call_site_len, "Call-site table length"); - if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ) - sjlj_output_call_site_table (); + if (HAVE_AS_LEB128) + { + ASM_GENERATE_INTERNAL_LABEL (cs_after_size_label, + section ? "LLSDACSBC" : "LLSDACSB", + current_function_funcdef_no); + ASM_GENERATE_INTERNAL_LABEL (cs_end_label, + section ? "LLSDACSEC" : "LLSDACSE", + current_function_funcdef_no); + dw2_asm_output_delta_uleb128 (cs_end_label, cs_after_size_label, + "Call-site table length"); + ASM_OUTPUT_LABEL (asm_out_file, cs_after_size_label); + if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ) + sjlj_output_call_site_table (); + else + dw2_output_call_site_table (cs_format, section); + ASM_OUTPUT_LABEL (asm_out_file, cs_end_label); + } else - dw2_output_call_site_table (cs_format, section); -#endif + { + dw2_asm_output_data_uleb128 (call_site_len, "Call-site table length"); + if (targetm_common.except_unwind_info (&global_options) == UI_SJLJ) + sjlj_output_call_site_table (); + else + dw2_output_call_site_table (cs_format, section); + } /* ??? Decode and interpret the data for flag_debug_asm. */ { @@ -3070,10 +3070,8 @@ output_one_function_exception_table (int section) output_ttype (type, tt_format, tt_format_size); } -#ifdef HAVE_AS_LEB128 - if (have_tt_data) - ASM_OUTPUT_LABEL (asm_out_file, ttype_label); -#endif + if (HAVE_AS_LEB128 && have_tt_data) + ASM_OUTPUT_LABEL (asm_out_file, ttype_label); /* ??? Decode and interpret the data for flag_debug_asm. */ if (targetm.arm_eabi_unwinder) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ae8f661ff53..b5324f255fa 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,26 @@ +2016-11-13 Janus Weil <janus@gcc.gnu.org> + + PR fortran/60952 + * decl.c (match_procedure_in_type): Apply the FL_PROCEDURE attribute + to the target procedure. + +2016-11-13 Janus Weil <janus@gcc.gnu.org> + + PR fortran/66366 + * resolve.c (resolve_component): Move check for C437 + to ... + * decl.c (build_struct): ... here. Fix indentation. + +2016-11-12 Janus Weil <janus@gcc.gnu.org> + + PR fortran/77501 + * class.c (gfc_find_typebound_intrinsic_op): Remove an unnecessary + assert and nullification. + * decl.c (gfc_match_decl_type_spec): Use gfc_get_tbp_symtree, + fix indentation. + (gfc_match_generic): Remove an unnecessary assert. + Use gfc_get_tbp_symtree to avoid ICE. + 2016-11-10 Fritz O. Reese <fritzoreese@gmail.com> PR fortran/78277 diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index b7f68d2f19a..b42ec40578f 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -2963,15 +2963,6 @@ gfc_find_typebound_intrinsic_op (gfc_symbol* derived, bool* t, gfc_symtree* gfc_get_tbp_symtree (gfc_symtree **root, const char *name) { - gfc_symtree *result; - - result = gfc_find_symtree (*root, name); - if (!result) - { - result = gfc_new_symtree (root, name); - gcc_assert (result); - result->n.tb = NULL; - } - - return result; + gfc_symtree *result = gfc_find_symtree (*root, name); + return result ? result : gfc_new_symtree (root, name); } diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index bf6bc246709..21eaafe488f 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1866,9 +1866,18 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init, } else if (current_attr.allocatable == 0) { - gfc_error ("Component at %C must have the POINTER attribute"); - return false; + gfc_error ("Component at %C must have the POINTER attribute"); + return false; + } } + + /* F03:C437. */ + if (current_ts.type == BT_CLASS + && !(current_attr.pointer || current_attr.allocatable)) + { + gfc_error ("Component %qs with CLASS at %C must be allocatable " + "or pointer", name); + return false; } if (gfc_current_block ()->attr.pointer && (*as)->rank != 0) @@ -3198,13 +3207,11 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag) upe->attr.zero_comp = 1; if (!gfc_add_flavor (&upe->attr, FL_DERIVED, NULL, &gfc_current_locus)) - return MATCH_ERROR; - } + return MATCH_ERROR; + } else { - st = gfc_find_symtree (gfc_current_ns->sym_root, "STAR"); - if (st == NULL) - st = gfc_new_symtree (&gfc_current_ns->sym_root, "STAR"); + st = gfc_get_tbp_symtree (&gfc_current_ns->sym_root, "STAR"); st->n.sym = upe; upe->refs++; } @@ -9617,6 +9624,8 @@ match_procedure_in_type (void) false)) return MATCH_ERROR; gfc_set_sym_referenced (stree->n.tb->u.specific->n.sym); + gfc_add_flavor(&stree->n.tb->u.specific->n.sym->attr, FL_PROCEDURE, + target, &stree->n.tb->u.specific->n.sym->declared_at); if (gfc_match_eos () == MATCH_YES) return MATCH_YES; @@ -9731,14 +9740,7 @@ gfc_match_generic (void) gfc_symtree* st; st = gfc_find_symtree (is_op ? ns->tb_uop_root : ns->tb_sym_root, name); - if (st) - { - tb = st->n.tb; - gcc_assert (tb); - } - else - tb = NULL; - + tb = st ? st->n.tb : NULL; break; } @@ -9783,10 +9785,8 @@ gfc_match_generic (void) case INTERFACE_USER_OP: { const bool is_op = (op_type == INTERFACE_USER_OP); - gfc_symtree* st; - - st = gfc_new_symtree (is_op ? &ns->tb_uop_root : &ns->tb_sym_root, - name); + gfc_symtree* st = gfc_get_tbp_symtree (is_op ? &ns->tb_uop_root : + &ns->tb_sym_root, name); gcc_assert (st); st->n.tb = tb; diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index faf7dde4183..c85525aabb9 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -13587,19 +13587,6 @@ resolve_component (gfc_component *c, gfc_symbol *sym) return false; } - /* C437. */ - if (c->ts.type == BT_CLASS && c->attr.flavor != FL_PROCEDURE - && (!c->attr.class_ok - || !(CLASS_DATA (c)->attr.class_pointer - || CLASS_DATA (c)->attr.allocatable))) - { - gfc_error ("Component %qs with CLASS at %L must be allocatable " - "or pointer", c->name, &c->loc); - /* Prevent a recurrence of the error. */ - c->ts.type = BT_UNKNOWN; - return false; - } - /* If an allocatable component derived type is of the same type as the enclosing derived type, we need a vtable generating so that the __deallocate procedure is created. */ diff --git a/gcc/gcc.c b/gcc/gcc.c index 5213cb0fafa..f78acd68606 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1144,11 +1144,7 @@ static const char *cc1_options = %{coverage:-fprofile-arcs -ftest-coverage}\ %{fprofile-arcs|fprofile-generate*|coverage:\ %{!fprofile-update=single:\ - %{pthread:-fprofile-update=atomic}}}\ - %{fprofile-update=single:\ - %{fprofile-arcs|fprofile-generate*|coverage:\ - %{pthread:%n-fprofile-update=atomic should be used\ - for a multithreaded application}}}"; + %{pthread:-fprofile-update=prefer-atomic}}}"; static const char *asm_options = "%{-target-help:%:print-asm-header()} " diff --git a/gcc/gimple-ssa-backprop.c b/gcc/gimple-ssa-backprop.c index 53349e89658..6ef221817f9 100644 --- a/gcc/gimple-ssa-backprop.c +++ b/gcc/gimple-ssa-backprop.c @@ -728,6 +728,7 @@ backprop::prepare_change (tree var) { if (MAY_HAVE_DEBUG_STMTS) insert_debug_temp_for_var_def (NULL, var); + reset_flow_sensitive_info (var); } /* STMT has been changed. Give the fold machinery a chance to simplify diff --git a/gcc/gimple-ssa-isolate-paths.c b/gcc/gimple-ssa-isolate-paths.c index 9d2fc8a30c0..84048d3daf9 100644 --- a/gcc/gimple-ssa-isolate-paths.c +++ b/gcc/gimple-ssa-isolate-paths.c @@ -206,6 +206,124 @@ isolate_path (basic_block bb, basic_block duplicate, return duplicate; } +/* Return TRUE if STMT is a div/mod operation using DIVISOR as the divisor. + FALSE otherwise. */ + +static bool +is_divmod_with_given_divisor (gimple *stmt, tree divisor) +{ + /* Only assignments matter. */ + if (!is_gimple_assign (stmt)) + return false; + + /* Check for every DIV/MOD expression. */ + enum tree_code rhs_code = gimple_assign_rhs_code (stmt); + if (rhs_code == TRUNC_DIV_EXPR + || rhs_code == FLOOR_DIV_EXPR + || rhs_code == CEIL_DIV_EXPR + || rhs_code == EXACT_DIV_EXPR + || rhs_code == ROUND_DIV_EXPR + || rhs_code == TRUNC_MOD_EXPR + || rhs_code == FLOOR_MOD_EXPR + || rhs_code == CEIL_MOD_EXPR + || rhs_code == ROUND_MOD_EXPR) + { + /* Pointer equality is fine when DIVISOR is an SSA_NAME, but + not sufficient for constants which may have different types. */ + if (operand_equal_p (gimple_assign_rhs2 (stmt), divisor, 0)) + return true; + } + return false; +} + +/* NAME is an SSA_NAME that we have already determined has the value 0 or NULL. + + Return TRUE if USE_STMT uses NAME in a way where a 0 or NULL value results + in undefined behavior, FALSE otherwise + + LOC is used for issuing diagnostics. This case represents potential + undefined behavior exposed by path splitting and that's reflected in + the diagnostic. */ + +bool +stmt_uses_name_in_undefined_way (gimple *use_stmt, tree name, location_t loc) +{ + /* If we are working with a non pointer type, then see + if this use is a DIV/MOD operation using NAME as the + divisor. */ + if (!POINTER_TYPE_P (TREE_TYPE (name))) + { + if (!flag_non_call_exceptions) + return is_divmod_with_given_divisor (use_stmt, name); + return false; + } + + /* NAME is a pointer, so see if it's used in a context where it must + be non-NULL. */ + bool by_dereference + = infer_nonnull_range_by_dereference (use_stmt, name); + + if (by_dereference + || infer_nonnull_range_by_attribute (use_stmt, name)) + { + + if (by_dereference) + { + warning_at (loc, OPT_Wnull_dereference, + "potential null pointer dereference"); + if (!flag_isolate_erroneous_paths_dereference) + return false; + } + else + { + if (!flag_isolate_erroneous_paths_attribute) + return false; + } + return true; + } + return false; +} + +/* Return TRUE if USE_STMT uses 0 or NULL in a context which results in + undefined behavior, FALSE otherwise. + + These cases are explicit in the IL. */ + +bool +stmt_uses_0_or_null_in_undefined_way (gimple *stmt) +{ + if (!flag_non_call_exceptions + && is_divmod_with_given_divisor (stmt, integer_zero_node)) + return true; + + /* By passing null_pointer_node, we can use the + infer_nonnull_range functions to detect explicit NULL + pointer dereferences and other uses where a non-NULL + value is required. */ + + bool by_dereference + = infer_nonnull_range_by_dereference (stmt, null_pointer_node); + if (by_dereference + || infer_nonnull_range_by_attribute (stmt, null_pointer_node)) + { + if (by_dereference) + { + location_t loc = gimple_location (stmt); + warning_at (loc, OPT_Wnull_dereference, + "null pointer dereference"); + if (!flag_isolate_erroneous_paths_dereference) + return false; + } + else + { + if (!flag_isolate_erroneous_paths_attribute) + return false; + } + return true; + } + return false; +} + /* Look for PHI nodes which feed statements in the same block where the value of the PHI node implies the statement is erroneous. @@ -243,11 +361,6 @@ find_implicit_erroneous_behavior (void) gphi *phi = si.phi (); tree lhs = gimple_phi_result (phi); - /* If the result is not a pointer, then there is no need to - examine the arguments. */ - if (!POINTER_TYPE_P (TREE_TYPE (lhs))) - continue; - /* PHI produces a pointer result. See if any of the PHI's arguments are NULL. @@ -315,29 +428,12 @@ find_implicit_erroneous_behavior (void) if (gimple_bb (use_stmt) != bb) continue; - bool by_dereference - = infer_nonnull_range_by_dereference (use_stmt, lhs); + location_t loc = gimple_location (use_stmt) + ? gimple_location (use_stmt) + : gimple_phi_arg_location (phi, i); - if (by_dereference - || infer_nonnull_range_by_attribute (use_stmt, lhs)) + if (stmt_uses_name_in_undefined_way (use_stmt, lhs, loc)) { - location_t loc = gimple_location (use_stmt) - ? gimple_location (use_stmt) - : gimple_phi_arg_location (phi, i); - - if (by_dereference) - { - warning_at (loc, OPT_Wnull_dereference, - "potential null pointer dereference"); - if (!flag_isolate_erroneous_paths_dereference) - continue; - } - else - { - if (!flag_isolate_erroneous_paths_attribute) - continue; - } - duplicate = isolate_path (bb, duplicate, e, use_stmt, lhs, false); @@ -383,29 +479,8 @@ find_explicit_erroneous_behavior (void) { gimple *stmt = gsi_stmt (si); - /* By passing null_pointer_node, we can use the - infer_nonnull_range functions to detect explicit NULL - pointer dereferences and other uses where a non-NULL - value is required. */ - - bool by_dereference - = infer_nonnull_range_by_dereference (stmt, null_pointer_node); - if (by_dereference - || infer_nonnull_range_by_attribute (stmt, null_pointer_node)) + if (stmt_uses_0_or_null_in_undefined_way (stmt)) { - if (by_dereference) - { - warning_at (gimple_location (stmt), OPT_Wnull_dereference, - "null pointer dereference"); - if (!flag_isolate_erroneous_paths_dereference) - continue; - } - else - { - if (!flag_isolate_erroneous_paths_attribute) - continue; - } - insert_trap (&si, null_pointer_node); bb = gimple_bb (gsi_stmt (si)); diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index c25c2e48642..9634f00a66e 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -449e918b0f93d3e3339edcec21a5bc157f548e54 +3c8d91cff0ad3d233ebd268f88a3749d38a0aac1 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 79e621a174a..2ec671ffff6 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1219,13 +1219,19 @@ ipa_get_jf_pass_through_result (struct ipa_jump_func *jfunc, tree input) return NULL_TREE; if (TREE_CODE_CLASS (ipa_get_jf_pass_through_operation (jfunc)) - == tcc_comparison) - restype = boolean_type_node; + == tcc_unary) + res = fold_unary (ipa_get_jf_pass_through_operation (jfunc), + TREE_TYPE (input), input); else - restype = TREE_TYPE (input); - res = fold_binary (ipa_get_jf_pass_through_operation (jfunc), restype, - input, ipa_get_jf_pass_through_operand (jfunc)); - + { + if (TREE_CODE_CLASS (ipa_get_jf_pass_through_operation (jfunc)) + == tcc_comparison) + restype = boolean_type_node; + else + restype = TREE_TYPE (input); + res = fold_binary (ipa_get_jf_pass_through_operation (jfunc), restype, + input, ipa_get_jf_pass_through_operand (jfunc)); + } if (res && !is_gimple_ip_invariant (res)) return NULL_TREE; @@ -1857,13 +1863,32 @@ propagate_vr_accross_jump_function (cgraph_edge *cs, if (jfunc->type == IPA_JF_PASS_THROUGH) { struct ipa_node_params *caller_info = IPA_NODE_REF (cs->caller); - if (dest_lat->bottom_p ()) - return false; int src_idx = ipa_get_jf_pass_through_formal_id (jfunc); src_lats = ipa_get_parm_lattices (caller_info, src_idx); if (ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR) return dest_lat->meet_with (src_lats->m_value_range); + else if (param_type + && (TREE_CODE_CLASS (ipa_get_jf_pass_through_operation (jfunc)) + == tcc_unary)) + { + value_range vr; + memset (&vr, 0, sizeof (vr)); + tree operand_type = ipa_get_type (caller_info, src_idx); + enum tree_code operation = ipa_get_jf_pass_through_operation (jfunc); + + if (src_lats->m_value_range.bottom_p ()) + return dest_lat->set_to_bottom (); + + extract_range_from_unary_expr (&vr, + operation, + param_type, + &src_lats->m_value_range.m_vr, + operand_type); + if (vr.type == VR_RANGE + || vr.type == VR_ANTI_RANGE) + return dest_lat->meet_with (&vr); + } } else if (jfunc->type == IPA_JF_CONST) { diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index e8880cb4fe2..1ab67f316a4 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -1186,11 +1186,12 @@ sem_function::merge (sem_item *alias_item) fprintf (dump_file, "Wrapper cannot be created because of COMDAT\n"); } - else if (DECL_STATIC_CHAIN (alias->decl)) + else if (DECL_STATIC_CHAIN (alias->decl) + || DECL_STATIC_CHAIN (original->decl)) { if (dump_file) fprintf (dump_file, - "Can not create wrapper of nested functions.\n"); + "Cannot create wrapper of nested function.\n"); } /* TODO: We can also deal with variadic functions never calling VA_START. */ diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 74fe199ea71..6321fddb02c 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -446,6 +446,18 @@ ipa_set_jf_simple_pass_through (struct ipa_jump_func *jfunc, int formal_id, jfunc->value.pass_through.agg_preserved = agg_preserved; } +/* Set JFUNC to be an unary pass through jump function. */ + +static void +ipa_set_jf_unary_pass_through (struct ipa_jump_func *jfunc, int formal_id, + enum tree_code operation) +{ + jfunc->type = IPA_JF_PASS_THROUGH; + jfunc->value.pass_through.operand = NULL_TREE; + jfunc->value.pass_through.formal_id = formal_id; + jfunc->value.pass_through.operation = operation; + jfunc->value.pass_through.agg_preserved = false; +} /* Set JFUNC to be an arithmetic pass through jump function. */ static void @@ -849,21 +861,19 @@ parm_preserved_before_stmt_p (struct ipa_func_body_info *fbi, int index, return !modified; } -/* If STMT is an assignment that loads a value from an parameter declaration, - return the index of the parameter in ipa_node_params which has not been - modified. Otherwise return -1. */ +/* Main worker for load_from_unmodified_param and load_from_param. + If STMT is an assignment that loads a value from an parameter declaration, + return the index of the parameter in ipa_node_params. Otherwise return -1. */ static int -load_from_unmodified_param (struct ipa_func_body_info *fbi, - vec<ipa_param_descriptor> descriptors, - gimple *stmt) +load_from_param_1 (struct ipa_func_body_info *fbi, + vec<ipa_param_descriptor> descriptors, + gimple *stmt) { int index; tree op1; - if (!gimple_assign_single_p (stmt)) - return -1; - + gcc_checking_assert (is_gimple_assign (stmt)); op1 = gimple_assign_rhs1 (stmt); if (TREE_CODE (op1) != PARM_DECL) return -1; @@ -876,6 +886,40 @@ load_from_unmodified_param (struct ipa_func_body_info *fbi, return index; } +/* If STMT is an assignment that loads a value from an parameter declaration, + return the index of the parameter in ipa_node_params which has not been + modified. Otherwise return -1. */ + +static int +load_from_unmodified_param (struct ipa_func_body_info *fbi, + vec<ipa_param_descriptor> descriptors, + gimple *stmt) +{ + if (!gimple_assign_single_p (stmt)) + return -1; + + return load_from_param_1 (fbi, descriptors, stmt); +} + +/* If STMT is an assignment that loads a value from an parameter declaration, + return the index of the parameter in ipa_node_params. Otherwise return -1. */ + +static int +load_from_param (struct ipa_func_body_info *fbi, + vec<ipa_param_descriptor> descriptors, + gimple *stmt) +{ + if (!is_gimple_assign (stmt)) + return -1; + + enum tree_code rhs_code = gimple_assign_rhs_code (stmt); + if ((get_gimple_rhs_class (rhs_code) != GIMPLE_SINGLE_RHS) + && (get_gimple_rhs_class (rhs_code) != GIMPLE_UNARY_RHS)) + return -1; + + return load_from_param_1 (fbi, descriptors, stmt); +} + /* Return true if memory reference REF (which must be a load through parameter with INDEX) loads data that are known to be unmodified in this function before reaching statement STMT. */ @@ -1109,6 +1153,7 @@ compute_complex_assign_jump_func (struct ipa_func_body_info *fbi, tree op1, tc_ssa, base, ssa; bool reverse; int index; + gimple *stmt2 = stmt; op1 = gimple_assign_rhs1 (stmt); @@ -1117,13 +1162,16 @@ compute_complex_assign_jump_func (struct ipa_func_body_info *fbi, if (SSA_NAME_IS_DEFAULT_DEF (op1)) index = ipa_get_param_decl_index (info, SSA_NAME_VAR (op1)); else - index = load_from_unmodified_param (fbi, info->descriptors, - SSA_NAME_DEF_STMT (op1)); + { + index = load_from_param (fbi, info->descriptors, + SSA_NAME_DEF_STMT (op1)); + stmt2 = SSA_NAME_DEF_STMT (op1); + } tc_ssa = op1; } else { - index = load_from_unmodified_param (fbi, info->descriptors, stmt); + index = load_from_param (fbi, info->descriptors, stmt); tc_ssa = gimple_assign_lhs (stmt); } @@ -1147,6 +1195,11 @@ compute_complex_assign_jump_func (struct ipa_func_body_info *fbi, bool agg_p = parm_ref_data_pass_through_p (fbi, index, call, tc_ssa); ipa_set_jf_simple_pass_through (jfunc, index, agg_p); } + else if (is_gimple_assign (stmt2) + && (gimple_expr_code (stmt2) != NOP_EXPR) + && (TREE_CODE_CLASS (gimple_expr_code (stmt2)) == tcc_unary)) + ipa_set_jf_unary_pass_through (jfunc, index, + gimple_assign_rhs_code (stmt2)); return; } @@ -2518,6 +2571,12 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs, dst->value.ancestor.agg_preserved &= src->value.pass_through.agg_preserved; } + else if (src->type == IPA_JF_PASS_THROUGH + && TREE_CODE_CLASS (src->value.pass_through.operation) == tcc_unary) + { + dst->value.ancestor.formal_id = src->value.pass_through.formal_id; + dst->value.ancestor.agg_preserved = false; + } else if (src->type == IPA_JF_ANCESTOR) { dst->value.ancestor.formal_id = src->value.ancestor.formal_id; @@ -2583,6 +2642,8 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs, && ipa_get_jf_pass_through_agg_preserved (src); ipa_set_jf_simple_pass_through (dst, formal_id, agg_p); } + else if (TREE_CODE_CLASS (operation) == tcc_unary) + ipa_set_jf_unary_pass_through (dst, formal_id, operation); else { tree operand = ipa_get_jf_pass_through_operand (src); @@ -4666,6 +4727,9 @@ ipa_write_jump_function (struct output_block *ob, bp_pack_value (&bp, jump_func->value.pass_through.agg_preserved, 1); streamer_write_bitpack (&bp); } + else if (TREE_CODE_CLASS (jump_func->value.pass_through.operation) + == tcc_unary) + streamer_write_uhwi (ob, jump_func->value.pass_through.formal_id); else { stream_write_tree (ob, jump_func->value.pass_through.operand, true); @@ -4745,6 +4809,11 @@ ipa_read_jump_function (struct lto_input_block *ib, bool agg_preserved = bp_unpack_value (&bp, 1); ipa_set_jf_simple_pass_through (jump_func, formal_id, agg_preserved); } + else if (TREE_CODE_CLASS (operation) == tcc_unary) + { + int formal_id = streamer_read_uhwi (ib); + ipa_set_jf_unary_pass_through (jump_func, formal_id, operation); + } else { tree operand = stream_read_tree (ib, data_in); diff --git a/gcc/match.pd b/gcc/match.pd index 29ddcd82a18..79a418fa31e 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -2547,8 +2547,15 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (with { int equal = 2; - if (decl_in_symtab_p (base0) - && decl_in_symtab_p (base1)) + /* Punt in GENERIC on variables with value expressions; + the value expressions might point to fields/elements + of other vars etc. */ + if (GENERIC + && ((VAR_P (base0) && DECL_HAS_VALUE_EXPR_P (base0)) + || (VAR_P (base1) && DECL_HAS_VALUE_EXPR_P (base1)))) + ; + else if (decl_in_symtab_p (base0) + && decl_in_symtab_p (base1)) equal = symtab_node::get_create (base0) ->equal_address_to (symtab_node::get_create (base1)); else if ((DECL_P (base0) diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 74dda97e39c..4963e812fe4 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,8 @@ +2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com> + Richard Biener <rguenther@suse.de> + + * config-lang.in (gtfiles): Add c/c-parser.h. + 2016-09-27 Jakub Jelinek <jakub@redhat.com> * objc-act.c (continue_class): Remove break after return. diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index c6c7a3effcb..e275b3e8a2b 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,11 @@ +2016-11-12 Joseph Myers <joseph@codesourcery.com> + + * es.po: Update. + +2016-11-11 Joseph Myers <joseph@codesourcery.com> + + * fr.po: Update. + 2016-11-07 Joseph Myers <joseph@codesourcery.com> * es.po: Update. diff --git a/gcc/po/es.po b/gcc/po/es.po index 346cd9130fc..7a650ff048d 100644 --- a/gcc/po/es.po +++ b/gcc/po/es.po @@ -8,6 +8,7 @@ # # Glosario # +# array - TBD # asan - asan # bug - error # callback - callback @@ -20,6 +21,7 @@ # iv optimization - optimización iv # omp (OpenMP) - omp # OS - S.O. +# reallocate - reubicar # report - informe TODO # scheduler - planificador # SSA - SSA @@ -31,7 +33,7 @@ msgstr "" "Project-Id-Version: gcc 6.2.0\n" "Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" "POT-Creation-Date: 2016-08-19 21:03+0000\n" -"PO-Revision-Date: 2016-11-06 21:49+0100\n" +"PO-Revision-Date: 2016-11-12 12:35+0100\n" "Last-Translator: Antonio Ceballos <aceballos@gmail.com>\n" "Language-Team: Spanish <es@tp.org.es>\n" "Language: es\n" @@ -5915,226 +5917,157 @@ msgid "Warn about most implicit conversions." msgstr "Avisa sobre la mayorÃa de las conversiones implÃcitas." #: fortran/lang.opt:242 -#, fuzzy -#| msgid "Warn about function call elimination" msgid "Warn about function call elimination." -msgstr "Avisa sobre la eliminación de llamadas de función" +msgstr "Avisa sobre la eliminación de llamadas de función." #: fortran/lang.opt:246 -#, fuzzy -#| msgid "Warn about calls with implicit interface" msgid "Warn about calls with implicit interface." -msgstr "Avisa sobre llamadas con interfaz implÃcita" +msgstr "Avisa sobre llamadas con interfaz implÃcita." #: fortran/lang.opt:250 -#, fuzzy -#| msgid "Warn about called procedures not explicitly declared" msgid "Warn about called procedures not explicitly declared." -msgstr "Avisa sobre procedimientos llamados que no están declarados explÃcitamente" +msgstr "Avisa sobre procedimientos llamados que no están declarados explÃcitamente." #: fortran/lang.opt:254 -#, fuzzy -#| msgid "Warn about compile-time integer division by zero" msgid "Warn about constant integer divisions with truncated results." -msgstr "Avisa sobre la división entera por cero en tiempo de compilación" +msgstr "Avisa sobre divisiones enteras constantes con resultados truncados." #: fortran/lang.opt:258 -#, fuzzy -#| msgid "Warn about truncated source lines" msgid "Warn about truncated source lines." -msgstr "Avisa sobre lÃneas de código truncadas" +msgstr "Avisa sobre lÃneas de código truncadas." #: fortran/lang.opt:262 -#, fuzzy -#| msgid "Warn on intrinsics not part of the selected standard" msgid "Warn on intrinsics not part of the selected standard." -msgstr "Avisa sobre intrÃnsecos que no son parte del estándar seleccionado" +msgstr "Avisa sobre intrÃnsecos que no son parte del estándar seleccionado." #: fortran/lang.opt:274 -#, fuzzy -#| msgid "Warn about format strings that are not literals" msgid "Warn about USE statements that have no ONLY qualifier." -msgstr "Avisa sobre el uso de cadenas de formato que no son literales" +msgstr "Avisa sobre sentencias USE sin cualificador ONLY." #: fortran/lang.opt:286 -#, fuzzy -#| msgid "Warn about real-literal-constants with 'q' exponent-letter" msgid "Warn about real-literal-constants with 'q' exponent-letter." -msgstr "Avisa sobre constantes-literales-reales con letra-exponente 'q'" +msgstr "Avisa sobre constantes-literales-reales con letra-exponente 'q'." #: fortran/lang.opt:290 -#, fuzzy -#| msgid "Warn when a register variable is declared volatile" msgid "Warn when a left-hand-side array variable is reallocated." -msgstr "Avisa cuando una variable de registro se declara volatile" +msgstr "Avisa cuando una variable de array al lado izquierdo es reubicada." #: fortran/lang.opt:294 -#, fuzzy -#| msgid "Warn when a register variable is declared volatile" msgid "Warn when a left-hand-side variable is reallocated." -msgstr "Avisa cuando una variable de registro se declara volatile" +msgstr "Avisa cuando una variable al lado izquierdo es reubicada." #: fortran/lang.opt:298 -#, fuzzy -#| msgid "Target expression in pointer assignment at %L must deliver a pointer result" msgid "Warn if the pointer in a pointer assignment might outlive its target." -msgstr "La expresión objetivo en la asignación de puntero en %L debe entregar un resultado puntero" +msgstr "Avisa si el puntero en una asignación a puntero podrÃa sobrevivir a lo apuntado." #: fortran/lang.opt:306 -#, fuzzy -#| msgid "Warn about \"suspicious\" constructs" msgid "Warn about \"suspicious\" constructs." -msgstr "Avisa sobre construcciones \"sospechosas\" " +msgstr "Avisa sobre construcciones \"sospechosas\"." #: fortran/lang.opt:310 -#, fuzzy -#| msgid "Permit nonconforming uses of the tab character" msgid "Permit nonconforming uses of the tab character." -msgstr "Permite usos no conformes del carácter tabulador" +msgstr "Permite usos no conformes del carácter tabulador." #: fortran/lang.opt:314 -#, fuzzy -#| msgid "Warn about underflow of numerical constant expressions" msgid "Warn about underflow of numerical constant expressions." -msgstr "Avisa sobre desbordamiento por debajo de expresiones numéricas constantes" +msgstr "Avisa sobre desbordamiento por debajo de expresiones numéricas constantes." #: fortran/lang.opt:322 -#, fuzzy -#| msgid "Warn if a user-procedure has the same name as an intrinsic" msgid "Warn if a user-procedure has the same name as an intrinsic." -msgstr "Avisa si un procedimiento de usuario tiene el mismo nombre que un intrÃnseco" +msgstr "Avisa si un procedimiento de usuario tiene el mismo nombre que un intrÃnseco." #: fortran/lang.opt:330 msgid "Warn about unused dummy arguments." msgstr "Avisa sobre posibles argumentos de relleno sin uso." #: fortran/lang.opt:334 -#, fuzzy -#| msgid "Warn about zero-length formats" msgid "Warn about zero-trip DO loops." -msgstr "Avisa sobre formatos de longitud cero" +msgstr "Avisa sobre bucles DO de cero vueltas." #: fortran/lang.opt:338 -#, fuzzy -#| msgid "Enable preprocessing" msgid "Enable preprocessing." -msgstr "Habilita el preprocesamiento" +msgstr "Habilita el preprocesamiento." #: fortran/lang.opt:346 -#, fuzzy -#| msgid "Disable preprocessing" msgid "Disable preprocessing." -msgstr "Desactiva el preprocesamiento" +msgstr "Desactiva el preprocesamiento." #: fortran/lang.opt:354 -#, fuzzy -#| msgid "Eliminate multiple function invokations also for impure functions" msgid "Eliminate multiple function invokations also for impure functions." -msgstr "También elimina invocaciones múltiples de función para funciones impure" +msgstr "También elimina invocaciones múltiples de función para funciones impure." #: fortran/lang.opt:358 -#, fuzzy -#| msgid "Enable alignment of COMMON blocks" msgid "Enable alignment of COMMON blocks." -msgstr "Activa la alineación de bloques COMMON" +msgstr "Activa la alineación de bloques COMMON." #: fortran/lang.opt:362 -#, fuzzy -#| msgid "All intrinsics procedures are available regardless of selected standard" msgid "All intrinsics procedures are available regardless of selected standard." -msgstr "Todos los procedimientos intrÃnsecos están disponibles sin importar el estándar seleccionado" +msgstr "Todos los procedimientos intrÃnsecos están disponibles sin importar el estándar seleccionado." #: fortran/lang.opt:370 -#, fuzzy -#| msgid "Do not treat local variables and COMMON blocks as if they were named in SAVE statements" msgid "Do not treat local variables and COMMON blocks as if they were named in SAVE statements." -msgstr "No trata las variables locales y los bloques COMMON como si fueran nombrados en declaraciones SAVE" +msgstr "No trata las variables locales y los bloques COMMON como si fueran nombrados en declaraciones SAVE." #: fortran/lang.opt:374 -#, fuzzy -#| msgid "Specify that backslash in string introduces an escape character" msgid "Specify that backslash in string introduces an escape character." -msgstr "Especifica que la barra invertida en una cadena introduce un carácter de escape" +msgstr "Especifica que la barra invertida en una cadena introduce un carácter de escape." #: fortran/lang.opt:378 -#, fuzzy -#| msgid "Produce a backtrace when a runtime error is encountered" msgid "Produce a backtrace when a runtime error is encountered." -msgstr "Produce un rastreo hacia atrás cuando se encuentra un error en tiempo de ejecución" +msgstr "Produce un rastreo hacia atrás cuando se encuentra un error en tiempo de ejecución." #: fortran/lang.opt:382 -#, fuzzy -#| msgid "-fblas-matmul-limit=<n>\tSize of the smallest matrix for which matmul will use BLAS" msgid "-fblas-matmul-limit=<n>\tSize of the smallest matrix for which matmul will use BLAS." -msgstr "-fblas-matmul-limit=<n>\tTamaño de la matriz más pequeña para la cual matmul usará BLAS" +msgstr "-fblas-matmul-limit=<n>\tTamaño de la matriz más pequeña para la cual matmul usará BLAS." #: fortran/lang.opt:386 -#, fuzzy -#| msgid "Produce a warning at runtime if a array temporary has been created for a procedure argument" msgid "Produce a warning at runtime if a array temporary has been created for a procedure argument." -msgstr "Produce un aviso en tiempo de ejecución si se ha creado una matriz temporal para un argumento de procedimiento" +msgstr "Produce un aviso en tiempo de ejecución si se ha creado una matriz temporal para un argumento de procedimiento." #: fortran/lang.opt:390 msgid "-fconvert=<big-endian|little-endian|native|swap> The endianness used for unformatted files." -msgstr "" +msgstr "-fconvert=<big-endian|little-endian|native|swap> El endianness empleado en ficheros sin formato." #: fortran/lang.opt:393 -#, fuzzy, c-format -#| msgid "Unrecognized option to -finit-real: %s" +#, c-format msgid "Unrecognized option to endianess value: %qs" -msgstr "No se reconoce la opción para -finit-real: %s" +msgstr "No se reconoce la opción como valor de endianess: %qs" #: fortran/lang.opt:409 -#, fuzzy -#| msgid "Use the Cray Pointer extension" msgid "Use the Cray Pointer extension." -msgstr "Usa la extensión Puntero Cray" +msgstr "Usa la extensión Puntero Cray." #: fortran/lang.opt:413 -#, fuzzy -#| msgid "Ignore 'D' in column one in fixed form" msgid "Ignore 'D' in column one in fixed form." -msgstr "Ignora 'D' en la columna uno en formato fija" +msgstr "Ignora 'D' en la columna uno en formato fija." #: fortran/lang.opt:417 -#, fuzzy -#| msgid "Treat lines with 'D' in column one as comments" msgid "Treat lines with 'D' in column one as comments." -msgstr "Trata las lÃneas con 'D' en la columna uno como comentarios" +msgstr "Trata las lÃneas con 'D' en la columna uno como comentarios." #: fortran/lang.opt:421 -#, fuzzy -#| msgid "Enable Plan 9 language extensions" msgid "Enable all DEC language extensions." -msgstr "Activa las extensiones de lenguaje de Plan9" +msgstr "Activa todas las extensiones del lenguaje DEC." #: fortran/lang.opt:425 msgid "Enable support for DEC STRUCTURE/RECORD." -msgstr "" +msgstr "Activa el soporte para STRUCTURE/RECORD de DEC." #: fortran/lang.opt:429 -#, fuzzy -#| msgid "Set the default double precision kind to an 8 byte wide type" msgid "Set the default double precision kind to an 8 byte wide type." -msgstr "Establece el género de doble precisión por defecto a un tipo de 8 bytes de anchura" +msgstr "Establece el género de doble precisión por defecto a un tipo de 8 bytes de tamaño." #: fortran/lang.opt:433 -#, fuzzy -#| msgid "Set the default integer kind to an 8 byte wide type" msgid "Set the default integer kind to an 8 byte wide type." -msgstr "Establece el género entero por defecto a un tipo de 8 bytes de anchura" +msgstr "Establece el género entero por defecto a un tipo de 8 bytes de tamaño." #: fortran/lang.opt:437 -#, fuzzy -#| msgid "Set the default real kind to an 8 byte wide type" msgid "Set the default real kind to an 8 byte wide type." -msgstr "Establece el género real por defecto a un tipo de 8 bytes de anchura" +msgstr "Establece el género real por defecto a un tipo de 8 bytes de tamaño." #: fortran/lang.opt:441 -#, fuzzy -#| msgid "Allow dollar signs in entity names" msgid "Allow dollar signs in entity names." -msgstr "Permite signos de dólar en nombres de entidades" +msgstr "Permite signos de dólar en nombres de entidades." #: fortran/lang.opt:445 config/alpha/alpha.opt:31 common.opt:732 #: common.opt:920 common.opt:924 common.opt:928 common.opt:932 common.opt:1421 @@ -6144,172 +6077,117 @@ msgid "Does nothing. Preserved for backward compatibility." msgstr "No hace nada. Preservado por compatibilidad hacia atrás." #: fortran/lang.opt:449 -#, fuzzy -#| msgid "Display the code tree after parsing" msgid "Display the code tree after parsing." -msgstr "Muestra el árbol del código después de la decodificación" +msgstr "Muestra el árbol del código después de analizar." #: fortran/lang.opt:453 -#, fuzzy -#| msgid "Display the code tree after front end optimization" msgid "Display the code tree after front end optimization." -msgstr "Muestra el árbol del código después de la optimización del frente" +msgstr "Muestra el árbol del código después de la optimización del frente." #: fortran/lang.opt:457 -#, fuzzy -#| msgid "Display the code tree after parsing; deprecated option" msgid "Display the code tree after parsing; deprecated option." -msgstr "Muestra el árbol del código después de la decodificación; opción obsoleta" +msgstr "Muestra el árbol del código después de analizar; opción obsoleta." #: fortran/lang.opt:461 -#, fuzzy -#| msgid "Specify that an external BLAS library should be used for matmul calls on large-size arrays" msgid "Specify that an external BLAS library should be used for matmul calls on large-size arrays." -msgstr "Especifica que se debe usar una librerÃa BLAS externa para llamadas matmul en matrices de gran tamaño" +msgstr "Especifica que se debe usar una librerÃa BLAS externa para llamadas matmul en matrices de gran tamaño." #: fortran/lang.opt:465 -#, fuzzy -#| msgid "Use f2c calling convention" msgid "Use f2c calling convention." -msgstr "Usar la convención de llamada f2c" +msgstr "Usar el convenio de llamada f2c." #: fortran/lang.opt:469 -#, fuzzy -#| msgid "Assume that the source file is fixed form" msgid "Assume that the source file is fixed form." -msgstr "Asume que el fichero fuente es de formato fijo" +msgstr "Asume que el fichero fuente es de formato fijo." #: fortran/lang.opt:473 -#, fuzzy -#| msgid "Interpret any INTEGER(4) as an INTEGER(8)" msgid "Interpret any INTEGER(4) as an INTEGER(8)." -msgstr "Interpreta cualquier INTEGER(4) como INTEGER(8)" +msgstr "Interpreta cualquier INTEGER(4) como INTEGER(8)." #: fortran/lang.opt:477 fortran/lang.opt:481 -#, fuzzy -#| msgid "Specify where to find the compiled intrinsic modules" msgid "Specify where to find the compiled intrinsic modules." -msgstr "Especifica dónde se encuentran los módulos intrÃnsecos compilados" +msgstr "Especifica dónde se encuentran los módulos intrÃnsecos compilados." #: fortran/lang.opt:485 -#, fuzzy -#| msgid "Allow arbitrary character line width in fixed mode" msgid "Allow arbitrary character line width in fixed mode." -msgstr "Permite ancho de lÃnea de carácter arbitrario en formato fijo" +msgstr "Permite ancho de lÃnea de carácter arbitrario en formato fijo." #: fortran/lang.opt:489 -#, fuzzy -#| msgid "-ffixed-line-length-<n>\tUse n as character line width in fixed mode" msgid "-ffixed-line-length-<n>\tUse n as character line width in fixed mode." -msgstr "-ffixed-line-length-<n>\tUsa n como ancho de lÃnea de carácter en modo fijo" +msgstr "-ffixed-line-length-<n>\tUsa n como ancho de lÃnea de carácter en modo fijo." #: fortran/lang.opt:493 -#, fuzzy -#| msgid "-ffpe-trap=[...]\tStop on following floating point exceptions" msgid "-ffpe-trap=[...]\tStop on following floating point exceptions." -msgstr "-ffpe-trap=[...]\tPara en las siguientes excepciones de coma flotante" +msgstr "-ffpe-trap=[...]\tPara en las siguientes excepciones de coma flotante." #: fortran/lang.opt:497 -#, fuzzy -#| msgid "-ffpe-trap=[...]\tStop on following floating point exceptions" msgid "-ffpe-summary=[...]\tPrint summary of floating point exceptions." -msgstr "-ffpe-trap=[...]\tPara en las siguientes excepciones de coma flotante" +msgstr "-ffpe-summary=[...]\tImprime el resumen de las siguientes excepciones de coma flotante." #: fortran/lang.opt:501 -#, fuzzy -#| msgid "Assume that the source file is free form" msgid "Assume that the source file is free form." -msgstr "Asume que el fichero fuente es de formato libre" +msgstr "Asume que el fichero fuente es de formato libre." #: fortran/lang.opt:505 -#, fuzzy -#| msgid "Allow arbitrary character line width in free mode" msgid "Allow arbitrary character line width in free mode." -msgstr "Permite ancho de lÃnea de carácter arbitrario en formato libre" +msgstr "Permite ancho de lÃnea de carácter arbitrario en formato libre." #: fortran/lang.opt:509 -#, fuzzy -#| msgid "-ffree-line-length-<n>\tUse n as character line width in free mode" msgid "-ffree-line-length-<n>\tUse n as character line width in free mode." -msgstr "-ffree-line-length-<n>\tUsa n como ancho de lÃnea de carácter en modo libre" +msgstr "-ffree-line-length-<n>\tUsa n como ancho de lÃnea de carácter en modo libre." #: fortran/lang.opt:513 -#, fuzzy -#| msgid "Enable front end optimization" msgid "Enable front end optimization." -msgstr "Activa las optimizaciones del frente" +msgstr "Activa las optimizaciones del frente." #: fortran/lang.opt:517 -#, fuzzy -#| msgid "Specify that no implicit typing is allowed, unless overridden by explicit IMPLICIT statements" msgid "Specify that no implicit typing is allowed, unless overridden by explicit IMPLICIT statements." -msgstr "Especifica que no se permiten tipos implÃcitos, a menos que se sobreescriban con sentencias IMPLICIT explÃcitas" +msgstr "Especifica que no se permiten tipos implÃcitos, a menos que se sobreescriban con sentencias IMPLICIT explÃcitas." #: fortran/lang.opt:521 -#, fuzzy -#| msgid "-finit-character=<n>\tInitialize local character variables to ASCII value n" msgid "-finit-character=<n>\tInitialize local character variables to ASCII value n." -msgstr "-finit-character=<n>\tInicializa las variables de carácter locales al valor ASCII n" +msgstr "-finit-character=<n>\tInicializa las variables de carácter locales al valor ASCII n." #: fortran/lang.opt:525 -#, fuzzy -#| msgid "-finit-integer=<n>\tInitialize local integer variables to n" msgid "-finit-integer=<n>\tInitialize local integer variables to n." -msgstr "-finit-integer=<n>\tInicializa las variables enteras locales a n" +msgstr "-finit-integer=<n>\tInicializa las variables enteras locales a n." #: fortran/lang.opt:529 -#, fuzzy -#| msgid "Initialize local variables to zero (from g77)" msgid "Initialize local variables to zero (from g77)." -msgstr "Inicializa las variables locales a cero (de g77)" +msgstr "Inicializa las variables locales a cero (de g77)." #: fortran/lang.opt:533 -#, fuzzy -#| msgid "-finit-logical=<true|false>\tInitialize local logical variables" msgid "-finit-logical=<true|false>\tInitialize local logical variables." -msgstr "-finit-logical=<true|false>\tInicializa las variables lógicas locales" +msgstr "-finit-logical=<true|false>\tInicializa las variables lógicas locales." #: fortran/lang.opt:537 -#, fuzzy -#| msgid "-finit-real=<zero|nan|inf|-inf>\tInitialize local real variables" msgid "-finit-real=<zero|snan|nan|inf|-inf>\tInitialize local real variables." -msgstr "-finit-real=<zero|nan|inf|-inf>\tInicializa las variables reales locales" +msgstr "-finit-real=<zero|nan|inf|-inf>\tInicializa las variables reales locales." #: fortran/lang.opt:540 -#, fuzzy, c-format -#| msgid "Unrecognized option to -finit-real: %s" +#, c-format msgid "Unrecognized option to floating-point init value: %qs" -msgstr "No se reconoce la opción para -finit-real: %s" +msgstr "No se reconoce la opción para para valor inicial de coma flotante: %qs" #: fortran/lang.opt:559 -#, fuzzy -#| msgid "-fblas-matmul-limit=<n>\tSize of the smallest matrix for which matmul will use BLAS" msgid "-finline-matmul-limit=<n>\tSpecify the size of the largest matrix for which matmul will be inlined." -msgstr "-fblas-matmul-limit=<n>\tTamaño de la matriz más pequeña para la cual matmul usará BLAS" +msgstr "-finline-matmul-limit=<n>\tEspecifica el tamaño de la matriz más grande para la cual matmul se usará en linea." #: fortran/lang.opt:563 -#, fuzzy -#| msgid "-fmax-array-constructor=<n>\tMaximum number of objects in an array constructor" msgid "-fmax-array-constructor=<n>\tMaximum number of objects in an array constructor." -msgstr "-fmax-array-constructor=<n>\tNúmero máximo de objetos en un constructor de matriz" +msgstr "-fmax-array-constructor=<n>\tNúmero máximo de objetos en un constructor de matriz." #: fortran/lang.opt:567 -#, fuzzy -#| msgid "-fmax-identifier-length=<n>\tMaximum identifier length" msgid "-fmax-identifier-length=<n>\tMaximum identifier length." -msgstr "-fmax-identifier-length=<n>\tLongitud máxima de identificador" +msgstr "-fmax-identifier-length=<n>\tLongitud máxima de identificador." #: fortran/lang.opt:571 -#, fuzzy -#| msgid "-fmax-subrecord-length=<n>\tMaximum length for subrecords" msgid "-fmax-subrecord-length=<n>\tMaximum length for subrecords." -msgstr "-fmax-subrecord-length=<n>\tLongitud máxima de los subregistros" +msgstr "-fmax-subrecord-length=<n>\tLongitud máxima de los subregistros." #: fortran/lang.opt:575 -#, fuzzy -#| msgid "-fmax-stack-var-size=<n>\tSize in bytes of the largest array that will be put on the stack" msgid "-fmax-stack-var-size=<n>\tSize in bytes of the largest array that will be put on the stack." -msgstr "-fmax-stack-var-size=<n>\tTamaño en bytes de la matriz más grande que se colocará en la pila" +msgstr "-fmax-stack-var-size=<n>\tTamaño en bytes de la matriz más grande que se colocará en la pila." #: fortran/lang.opt:579 msgid "Put all local arrays on stack." @@ -6320,124 +6198,85 @@ msgid "Set default accessibility of module entities to PRIVATE." msgstr "Establece la accesibilidad por defecto de las entidades de módulo a PRIVATE." #: fortran/lang.opt:603 -#, fuzzy -#| msgid "Try to lay out derived types as compactly as possible" msgid "Try to lay out derived types as compactly as possible." -msgstr "Trata de acomodar los tipos derivados tan compactos como sea posible" +msgstr "Trata de acomodar los tipos derivados tan compactos como sea posible." #: fortran/lang.opt:611 -#, fuzzy -#| msgid "Protect parentheses in expressions" msgid "Protect parentheses in expressions." -msgstr "Protege paréntesis en las expresiones" +msgstr "Protege paréntesis en las expresiones." #: fortran/lang.opt:615 -#, fuzzy -#| msgid "Enable range checking during compilation" msgid "Enable range checking during compilation." -msgstr "Permite la revisión de rango durante la compilación" +msgstr "Permite la revisión de rango durante la compilación." #: fortran/lang.opt:619 -#, fuzzy -#| msgid "Interpret any REAL(4) as a REAL(8)" msgid "Interpret any REAL(4) as a REAL(8)." -msgstr "Interpreta cualquier REAL(4) como un REAL(8)" +msgstr "Interpreta cualquier REAL(4) como un REAL(8)." #: fortran/lang.opt:623 -#, fuzzy -#| msgid "Interpret any REAL(4) as a REAL(10)" msgid "Interpret any REAL(4) as a REAL(10)." -msgstr "Interpreta cualquier REAL(4) como un REAL(10)" +msgstr "Interpreta cualquier REAL(4) como un REAL(10)." #: fortran/lang.opt:627 -#, fuzzy -#| msgid "Interpret any REAL(4) as a REAL(16)" msgid "Interpret any REAL(4) as a REAL(16)." -msgstr "Interpreta cualquier REAL(4) como un REAL(16)" +msgstr "Interpreta cualquier REAL(4) como un REAL(16)." #: fortran/lang.opt:631 -#, fuzzy -#| msgid "Interpret any REAL(8) as a REAL(4)" msgid "Interpret any REAL(8) as a REAL(4)." -msgstr "Interpreta cualquier REAL(8) como un REAL(4)" +msgstr "Interpreta cualquier REAL(8) como un REAL(4)." #: fortran/lang.opt:635 -#, fuzzy -#| msgid "Interpret any REAL(8) as a REAL(10)" msgid "Interpret any REAL(8) as a REAL(10)." -msgstr "Interpreta cualquier REAL(8) como un REAL(10)" +msgstr "Interpreta cualquier REAL(8) como un REAL(10)." #: fortran/lang.opt:639 -#, fuzzy -#| msgid "Interpret any REAL(8) as a REAL(16)" msgid "Interpret any REAL(8) as a REAL(16)." -msgstr "Interpreta cualquier REAL(8) como un REAL(16)" +msgstr "Interpreta cualquier REAL(8) como un REAL(16)." #: fortran/lang.opt:643 -#, fuzzy -#| msgid "Reallocate the LHS in assignments" msgid "Reallocate the LHS in assignments." -msgstr "Reubica el lado derecho en las asignaciones" +msgstr "Reubica el lado derecho en las asignaciones." #: fortran/lang.opt:647 -#, fuzzy -#| msgid "Use a 4-byte record marker for unformatted files" msgid "Use a 4-byte record marker for unformatted files." -msgstr "Usa un marcador de registro de 4-byte para los ficheros sin formato" +msgstr "Usa un marcador de registro de 4 bytes para los ficheros sin formato." #: fortran/lang.opt:651 -#, fuzzy -#| msgid "Use an 8-byte record marker for unformatted files" msgid "Use an 8-byte record marker for unformatted files." -msgstr "Usa un marcador de registro de 8-byte para los ficheros sin formato" +msgstr "Usa un marcador de registro de 8 bytes para los ficheros sin formato." #: fortran/lang.opt:655 -#, fuzzy -#| msgid "Allocate local variables on the stack to allow indirect recursion" msgid "Allocate local variables on the stack to allow indirect recursion." -msgstr "Almacena las variables locales en la pila para permitir la recursión indirecta" +msgstr "Almacena las variables locales en la pila para permitir recursividad indirecta." #: fortran/lang.opt:659 -#, fuzzy -#| msgid "Copy array sections into a contiguous block on procedure entry" msgid "Copy array sections into a contiguous block on procedure entry." -msgstr "Copia las secciones de matriz en un bloque contiguo en la entrada de procedimiento" +msgstr "Copia las secciones de matriz en un bloque contiguo en la entrada de procedimiento." #: fortran/lang.opt:663 -#, fuzzy -#| msgid "-fcoarray=[...]\tSpecify which coarray parallelization should be used" msgid "-fcoarray=<none|single|lib>\tSpecify which coarray parallelization should be used." -msgstr "-fcoarray=[...]\tEspecifica cuál paralelización de comatriz se debe usar" +msgstr "-fcoarray=[...]\tEspecifica qué paralelización de comatriz se debe usar." #: fortran/lang.opt:666 -#, fuzzy, c-format -#| msgid "unrecognized option %<-%s%>" +#, c-format msgid "Unrecognized option: %qs" -msgstr "no se reconoce la opción %<-%s%>" +msgstr "No se reconoce la opción: %qs" #: fortran/lang.opt:679 -#, fuzzy -#| msgid "-fcheck=[...]\tSpecify which runtime checks are to be performed" msgid "-fcheck=[...]\tSpecify which runtime checks are to be performed." -msgstr "-fcheck=[...]\tEspecifica cuáles revisiones de tiempo de ejecución se realizarán" +msgstr "-fcheck=[...]\tEspecifica qué revisiones de tiempo de ejecución se realizarán." #: fortran/lang.opt:683 -#, fuzzy -#| msgid "Append a second underscore if the name already contains an underscore" msgid "Append a second underscore if the name already contains an underscore." -msgstr "Agrega un segundo guión bajo si el nombre ya tiene un guión bajo" +msgstr "Agrega un segundo guión bajo si el nombre ya tiene un guión bajo." #: fortran/lang.opt:691 -#, fuzzy -#| msgid "Apply negative sign to zero values" msgid "Apply negative sign to zero values." -msgstr "Aplica signo negativo a valores cero" +msgstr "Aplica signo negativo a valores cero." #: fortran/lang.opt:695 -#, fuzzy -#| msgid "Append underscores to externally visible names" msgid "Append underscores to externally visible names." -msgstr "Agrega subrayado a los nombres visibles externamente" +msgstr "Agrega subrayado a los nombres visibles externamente." #: fortran/lang.opt:699 c-family/c.opt:1155 c-family/c.opt:1179 #: c-family/c.opt:1409 config/pa/pa.opt:42 config/pa/pa.opt:66 @@ -6449,46 +6288,32 @@ msgid "Does nothing. Preserved for backward compatibility." msgstr "No hace nada. Se preserva por compatibilidad hacia atrás." #: fortran/lang.opt:739 -#, fuzzy -#| msgid "Statically link the GNU Fortran helper library (libgfortran)" msgid "Statically link the GNU Fortran helper library (libgfortran)." -msgstr "Enlaza estáticamente la biblioteca de ayuda de GNU Fortran (libgfortran)" +msgstr "Enlaza estáticamente la biblioteca de ayuda de GNU Fortran (libgfortran)." #: fortran/lang.opt:743 -#, fuzzy -#| msgid "Conform to the ISO Fortran 2003 standard" msgid "Conform to the ISO Fortran 2003 standard." -msgstr "Conforma al estándar ISO Fortran 2003" +msgstr "Conforma al estándar ISO Fortran 2003." #: fortran/lang.opt:747 -#, fuzzy -#| msgid "Conform to the ISO Fortran 2008 standard" msgid "Conform to the ISO Fortran 2008 standard." -msgstr "Conforma al estándar ISO Fortran 2008" +msgstr "Conforma al estándar ISO Fortran 2008." #: fortran/lang.opt:751 -#, fuzzy -#| msgid "Conform to the ISO Fortran 2008 standard including TS 29113" msgid "Conform to the ISO Fortran 2008 standard including TS 29113." -msgstr "Conforma al estándar ISO Fortran 2008 incluyendo TS 29113" +msgstr "Conforma al estándar ISO Fortran 2008 incluyendo TS 29113." #: fortran/lang.opt:755 -#, fuzzy -#| msgid "Conform to the ISO Fortran 95 standard" msgid "Conform to the ISO Fortran 95 standard." -msgstr "Conforma al estándar ISO Fortran 95" +msgstr "Conforma al estándar ISO Fortran 95." #: fortran/lang.opt:759 -#, fuzzy -#| msgid "Conform to nothing in particular" msgid "Conform to nothing in particular." -msgstr "Conforma a nada en particular" +msgstr "No conforma a nada en particular." #: fortran/lang.opt:763 -#, fuzzy -#| msgid "Accept extensions to support legacy code" msgid "Accept extensions to support legacy code." -msgstr "Acepta las extensiones para dar soporte a código de legado" +msgstr "Acepta las extensiones para dar soporte a código heredado." #: c-family/c.opt:43 c-family/c.opt:46 c-family/c.opt:181 #, c-format @@ -6517,88 +6342,60 @@ msgid "missing path after %qs" msgstr "falta una ruta después de %qs" #: c-family/c.opt:182 -#, fuzzy -#| msgid "-A<question>=<answer>\tAssert the <answer> to <question>. Putting '-' before <question> disables the <answer> to <question>" msgid "-A<question>=<answer>\tAssert the <answer> to <question>. Putting '-' before <question> disables the <answer> to <question>." -msgstr "-A<pregunta>=<resp>\tRelaciona la <resp>uesta a la <pregunta>. Al colocar '-' antes de la <pregunta> desactiva la <resp>uesta a la <pregunta>" +msgstr "-A<pregunta>=<resp>\tRelaciona la <resp>uesta a la <pregunta>. Al colocar '-' antes de la <pregunta> desactiva la <resp>uesta a la <pregunta>." #: c-family/c.opt:186 -#, fuzzy -#| msgid "Do not discard comments" msgid "Do not discard comments." -msgstr "No descarta comentarios" +msgstr "No descarta comentarios." #: c-family/c.opt:190 -#, fuzzy -#| msgid "Do not discard comments in macro expansions" msgid "Do not discard comments in macro expansions." -msgstr "No descarta comentarios en expansiones de macro" +msgstr "No descarta comentarios en expansiones de macro." #: c-family/c.opt:194 -#, fuzzy -#| msgid "-D<macro>[=<val>]\tDefine a <macro> with <val> as its value. If just <macro> is given, <val> is taken to be 1" msgid "-D<macro>[=<val>]\tDefine a <macro> with <val> as its value. If just <macro> is given, <val> is taken to be 1." -msgstr "-D<macro>[=<val>]\tDefine una <macro> con <val> como su valor. Si sólo se da la <macro>, <val> se toma como 1" +msgstr "-D<macro>[=<val>]\tDefine una <macro> con <val> como su valor. Si sólo se da la <macro>, <val> se toma como 1." #: c-family/c.opt:201 -#, fuzzy -#| msgid "-F <dir>\tAdd <dir> to the end of the main framework include path" msgid "-F <dir>\tAdd <dir> to the end of the main framework include path." -msgstr "-F <dir>\tAgrega el <dir>ectorio al final de la ruta de inclusión del marco de trabajo principal" +msgstr "-F <dir>\tAgrega el <dir>ectorio al final de la ruta de inclusión del marco de trabajo principal." #: c-family/c.opt:205 -#, fuzzy -#| msgid "Print the name of header files as they are used" msgid "Print the name of header files as they are used." -msgstr "Muestra los nombres de los ficheros de encabezado mientras se utilizan" +msgstr "Muestra los nombres de los ficheros de cabecera mientras se utilizan." #: c-family/c.opt:209 -#, fuzzy -#| msgid "-I <dir>\tAdd <dir> to the end of the main include path" msgid "-I <dir>\tAdd <dir> to the end of the main include path." -msgstr "-I <dir>\tAgrega el <dir>ectorio al final de la ruta de inclusión principal" +msgstr "-I <dir>\tAgrega el <dir>ectorio al final de la ruta de inclusión principal." #: c-family/c.opt:213 -#, fuzzy -#| msgid "Generate make dependencies" msgid "Generate make dependencies." -msgstr "Genera dependencias de make" +msgstr "Genera dependencias de make." #: c-family/c.opt:217 -#, fuzzy -#| msgid "Generate make dependencies and compile" msgid "Generate make dependencies and compile." -msgstr "Genera dependencias de make y compila" +msgstr "Genera dependencias de make y compila." #: c-family/c.opt:221 -#, fuzzy -#| msgid "-MF <file>\tWrite dependency output to the given file" msgid "-MF <file>\tWrite dependency output to the given file." -msgstr "-MF <fichero>\tEscribe la salida de dependencias al fichero dado" +msgstr "-MF <fichero>\tEscribe la salida de dependencias al fichero dado." #: c-family/c.opt:225 -#, fuzzy -#| msgid "Treat missing header files as generated files" msgid "Treat missing header files as generated files." -msgstr "Trata los ficheros de encabezado faltantes como ficheros generados" +msgstr "Trata los ficheros de cabecera faltantes como ficheros generados" #: c-family/c.opt:229 -#, fuzzy -#| msgid "Like -M but ignore system header files" msgid "Like -M but ignore system header files." -msgstr "Como -M pero descarta los ficheros de encabezado del sistema" +msgstr "Como -M pero descarta los ficheros de cabecera del sistema." #: c-family/c.opt:233 -#, fuzzy -#| msgid "Like -MD but ignore system header files" msgid "Like -MD but ignore system header files." -msgstr "Como -MD pero descarta los ficheros de encabezado del sistema" +msgstr "Como -MD pero descarta los ficheros de cabecera del sistema." #: c-family/c.opt:237 -#, fuzzy -#| msgid "Generate phony targets for all headers" msgid "Generate phony targets for all headers." -msgstr "Genera objetivos de prueba para todos los encabezados" +msgstr "Genera objetivos de prueba para todas las cabecerasa." #: c-family/c.opt:240 c-family/c.opt:244 #, c-format @@ -6606,522 +6403,376 @@ msgid "missing makefile target after %qs" msgstr "falta un fichero make objetivo después de %qs" #: c-family/c.opt:241 -#, fuzzy -#| msgid "-MQ <target>\tAdd a MAKE-quoted target" msgid "-MQ <target>\tAdd a MAKE-quoted target." -msgstr "-MQ <objetivo>\tAgrega un objetivo tipo-MAKE" +msgstr "-MQ <objetivo>\tAgrega un objetivo tipo-MAKE." #: c-family/c.opt:245 -#, fuzzy -#| msgid "-MT <target>\tAdd an unquoted target" msgid "-MT <target>\tAdd an unquoted target." -msgstr "-MT <objetivo>\tAgrega un objetivo no citado" +msgstr "-MT <objetivo>\tAgrega un objetivo no citado." #: c-family/c.opt:249 -#, fuzzy -#| msgid "Do not generate #line directives" msgid "Do not generate #line directives." -msgstr "No genera directivas #line" +msgstr "No genera directivas #line." #: c-family/c.opt:253 -#, fuzzy -#| msgid "-U<macro>\tUndefine <macro>" msgid "-U<macro>\tUndefine <macro>." -msgstr "-U<macro>\tBorra la definición de <macro>" +msgstr "-U<macro>\tBorra la definición de <macro>." #: c-family/c.opt:257 -#, fuzzy -#| msgid "Warn about things that will change when compiling with an ABI-compliant compiler" msgid "Warn about things that will change when compiling with an ABI-compliant compiler." -msgstr "Avisa sobre cosas que cambiarán cuando se compile con un compilador que cumpla con la ABI" +msgstr "Avisa sobre cosas que cambiarán cuando se compile con un compilador que cumpla con la ABI." #: c-family/c.opt:261 msgid "Warn about things that change between the current -fabi-version and the specified version." -msgstr "" +msgstr "Avisa sobre cosas que varÃan entre la -fabi-version actual y la versión especificada." #: c-family/c.opt:265 msgid "Warn if a subobject has an abi_tag attribute that the complete object type does not have." -msgstr "" +msgstr "Avisa si un subojeto tiene un atributo abi_tag que el objeto completo no tiene." #: c-family/c.opt:272 -#, fuzzy -#| msgid "Warn about suspicious uses of memory addresses" msgid "Warn about suspicious uses of memory addresses." -msgstr "Avisa sobre usos sospechosos de direcciones de memoria" +msgstr "Avisa sobre usos sospechosos de direcciones de memoria." #: c-family/c.opt:276 ada/gcc-interface/lang.opt:57 -#, fuzzy -#| msgid "Enable most warning messages" msgid "Enable most warning messages." -msgstr "Activa casi todos los mensajes de aviso" +msgstr "Activa casi todos los mensajes de aviso." #: c-family/c.opt:288 -#, fuzzy -#| msgid "Warn whenever an Objective-C assignment is being intercepted by the garbage collector" msgid "Warn whenever an Objective-C assignment is being intercepted by the garbage collector." -msgstr "Avisa cuando se intercepte una asignación Objective-C por el recolector de basura" +msgstr "Avisa cuando se intercepte una asignación Objective-C por el recolector de basura." #: c-family/c.opt:292 -#, fuzzy -#| msgid "Warn about casting functions to incompatible types" msgid "Warn about casting functions to incompatible types." -msgstr "Avisa por funciones de conversión a tipos incompatibles" +msgstr "Advierte de funciones de conversión a tipos incompatibles." #: c-family/c.opt:296 msgid "Warn about boolean expression compared with an integer value different from true/false." -msgstr "" +msgstr "Advierte de expresiones booleanas comparadas con valores enteros distintos de verdadero/falso." #: c-family/c.opt:300 msgid "Warn when __builtin_frame_address or __builtin_return_address is used unsafely." -msgstr "" +msgstr "Avisa cuando __builtin_frame_address o __builtin_return_address se usan de forma no segura." #: c-family/c.opt:304 -#, fuzzy -#| msgid "Warn when a built-in preprocessor macro is undefined or redefined" msgid "Warn when a built-in preprocessor macro is undefined or redefined." -msgstr "Avisa cuando una macro de preprocesador interna está sin definir o redefinida" +msgstr "Avisa cuando una macro de preprocesador interna está sin definir o redefinida." #: c-family/c.opt:308 -#, fuzzy -#| msgid "Warn about features not present in traditional C" msgid "Warn about features not present in ISO C90, but present in ISO C99." -msgstr "Avisa sobre caracterÃsticas no presentes en C tradicional" +msgstr "Avisa sobre caracterÃsticas no presentes en ISO C90, pero presentes en ISO C99." #: c-family/c.opt:312 -#, fuzzy -#| msgid "Warn about features not present in traditional C" msgid "Warn about features not present in ISO C99, but present in ISO C11." -msgstr "Avisa sobre caracterÃsticas no presentes en C tradicional" +msgstr "Avisa sobre caracterÃsticas no presentes en ISO C99, pero presentes en ISO C11." #: c-family/c.opt:316 -#, fuzzy -#| msgid "Warn about C constructs that are not in the common subset of C and C++" msgid "Warn about C constructs that are not in the common subset of C and C++." -msgstr "Avisa sobre construcciones C que no están en el subconjunto común de C y C++" +msgstr "Avisa sobre construcciones C que no están en el subconjunto común de C y C++." #: c-family/c.opt:323 -#, fuzzy -#| msgid "Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011" msgid "Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011." -msgstr "Avisa sobre constructores de C++ cuyos significados difieren entre ISO C++ 1998 e ISO C++ 2011" +msgstr "Avisa sobre constructores de C++ cuyos significados difieren entre ISO C++ 1998 e ISO C++ 2011." #: c-family/c.opt:327 -#, fuzzy -#| msgid "Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011" msgid "Warn about C++ constructs whose meaning differs between ISO C++ 2011 and ISO C++ 2014." -msgstr "Avisa sobre constructores de C++ cuyos significados difieren entre ISO C++ 1998 e ISO C++ 2011" +msgstr "Avisa sobre constructores de C++ cuyos significados difieren entre ISO C++ 2011 e ISO C++ 2014." #: c-family/c.opt:331 -#, fuzzy -#| msgid "Warn about casts which discard qualifiers" msgid "Warn about casts which discard qualifiers." -msgstr "Avisa sobre conversiones que descartan calificadores" +msgstr "Avisa sobre conversiones que descartan calificadores." #: c-family/c.opt:335 -#, fuzzy -#| msgid "Warn about subscripts whose type is \"char\"" msgid "Warn about subscripts whose type is \"char\"." -msgstr "Avisa sobre subÃndices cuyo tipo es \"char\"" +msgstr "Avisa sobre subÃndices cuyo tipo es \"char\"." #: c-family/c.opt:339 msgid "Warn about memory access errors found by Pointer Bounds Checker." -msgstr "" +msgstr "Advierte de errores de acceso a memoria encontrados por el Comprobador de LÃmites de Punteros." #: c-family/c.opt:343 -#, fuzzy -#| msgid "Warn about variables that might be changed by \"longjmp\" or \"vfork\"" msgid "Warn about variables that might be changed by \"longjmp\" or \"vfork\"." -msgstr "Avisa sobre variables que pueden cambiar por \"longjmp\" o \"vfork\"" +msgstr "Avisa sobre variables que pueden cambiar por \"longjmp\" o \"vfork\"." #: c-family/c.opt:347 -#, fuzzy -#| msgid "Warn about possibly nested block comments, and C++ comments spanning more than one physical line" msgid "Warn about possibly nested block comments, and C++ comments spanning more than one physical line." -msgstr "Avisa sobre la posibilidad de bloques de comentarios anidados, y comentarios de C++ que abarquen más de una lÃnea fÃsica" +msgstr "Avisa sobre la posibilidad de bloques de comentarios anidados y comentarios de C++ que abarquen más de una lÃnea fÃsica." #: c-family/c.opt:351 -#, fuzzy -#| msgid "Synonym for -Wcomment" msgid "Synonym for -Wcomment." -msgstr "Sinónimo de -Wcomment" +msgstr "Sinónimo de -Wcomment." #: c-family/c.opt:355 msgid "Warn for conditionally-supported constructs." -msgstr "" +msgstr "Advierte de construcciones admitidas de forma condicional." #: c-family/c.opt:359 -#, fuzzy -#| msgid "Warn for implicit type conversions that may change a value" msgid "Warn for implicit type conversions that may change a value." -msgstr "Avisa cuando hay conversiones de tipo implÃcitas que pueden cambiar un valor" +msgstr "Avisa cuando hay conversiones de tipo implÃcitas que pueden cambiar un valor." #: c-family/c.opt:363 -#, fuzzy -#| msgid "Warn for converting NULL from/to a non-pointer type" msgid "Warn for converting NULL from/to a non-pointer type." -msgstr "Avisa cuando se convierte NULL de/a un tipo que no es puntero" +msgstr "Avisa cuando se convierte NULL de/a un tipo que no es puntero." #: c-family/c.opt:371 -#, fuzzy -#| msgid "Warn when all constructors and destructors are private" msgid "Warn when all constructors and destructors are private." -msgstr "Avisa cuando todos los constructores y destructores son privados" +msgstr "Avisa cuando todos los constructores y destructores son privados." #: c-family/c.opt:375 msgid "Warn about __TIME__, __DATE__ and __TIMESTAMP__ usage." -msgstr "" +msgstr "Advierte del uso de __TIME__, __DATE__ y __TIMESTAMP__." #: c-family/c.opt:379 -#, fuzzy -#| msgid "Warn when a declaration is found after a statement" msgid "Warn when a declaration is found after a statement." -msgstr "Avisa cuando se encuentra una declaración después de una declaración" +msgstr "Avisa cuando se encuentra una declaración después de una sentencia." #: c-family/c.opt:383 -#, fuzzy -#| msgid "dereferencing pointer to incomplete type" msgid "Warn when deleting a pointer to incomplete type." -msgstr "puntero deferenciado a tipo de dato incompleto" +msgstr "Avisa cuando se borra un puntero a un tipo incompleto." #: c-family/c.opt:387 -#, fuzzy -#| msgid "Warn about deleting polymorphic objects with non-virtual destructors" msgid "Warn about deleting polymorphic objects with non-virtual destructors." -msgstr "Avisa al borrar objetos polimórficos con destructores que no son virtuales" +msgstr "Avisa al borrar objetos polimórficos con destructores que no son virtuales." #: c-family/c.opt:391 -#, fuzzy -#| msgid "Warn if a deprecated compiler feature, class, method, or field is used" msgid "Warn if a deprecated compiler feature, class, method, or field is used." -msgstr "Avisa si se usa una opción de compilador, clase, método o campo obsoletos" +msgstr "Avisa si se usa una opción de compilador, clase, método o campo obsoletos." #: c-family/c.opt:395 -#, fuzzy -#| msgid "Warn about possibly missing braces around initializers" msgid "Warn about positional initialization of structs requiring designated initializers." -msgstr "Avisa sobre posibles llaves faltantes alrededor de los inicializadores" +msgstr "Advierte de inicializaciones posicionales de estructuras que requieren inicializadores designados." #: c-family/c.opt:399 msgid "Warn if qualifiers on arrays which are pointer targets are discarded." -msgstr "" +msgstr "Avisa si se descartan los cualificadores de arrays que son destinos de punteros." #: c-family/c.opt:403 -#, fuzzy -#| msgid "Warn whenever type qualifiers are ignored." msgid "Warn if type qualifiers on pointers are discarded." -msgstr "Avisa cada vez que se ignoran los calificadores de tipo." +msgstr "Avisa si se ignoran los calificadores de tipo sobre punteros." #: c-family/c.opt:407 -#, fuzzy -#| msgid "Warn about compile-time integer division by zero" msgid "Warn about compile-time integer division by zero." -msgstr "Avisa sobre la división entera por cero en tiempo de compilación" +msgstr "Avisa sobre la división entera por cero en tiempo de compilación." #: c-family/c.opt:411 msgid "Warn about duplicated conditions in an if-else-if chain." -msgstr "" +msgstr "Advierte de condiciones duplicadas en cadenas if-else-if." #: c-family/c.opt:415 -#, fuzzy -#| msgid "Warn about violations of Effective C++ style rules" msgid "Warn about violations of Effective C++ style rules." -msgstr "Avisa sobre violaciones de reglas de estilo de Effective C++" +msgstr "Avisa sobre violaciones de reglas de estilo de Effective C++." #: c-family/c.opt:419 -#, fuzzy -#| msgid "Warn about an empty body in an if or else statement" msgid "Warn about an empty body in an if or else statement." -msgstr "Avisa sobre un cuerpo vacÃo en una declaración if o else" +msgstr "Avisa sobre un cuerpo vacÃo en una declaración if o else." #: c-family/c.opt:423 -#, fuzzy -#| msgid "Warn about stray tokens after #elif and #endif" msgid "Warn about stray tokens after #elif and #endif." -msgstr "Avisa sobre elementos sobrantes después de #elif y #endif" +msgstr "Avisa sobre elementos sobrantes después de #elif y #endif." #: c-family/c.opt:427 -#, fuzzy -#| msgid "Warn about comparison of different enum types" msgid "Warn about comparison of different enum types." -msgstr "Avisar sobre comparación de tipos enum diferentes" +msgstr "Avisar sobre comparación de tipos enum diferentes." #: c-family/c.opt:435 -#, fuzzy -#| msgid "This switch is deprecated; use -Werror=implicit-function-declaration instead" msgid "This switch is deprecated; use -Werror=implicit-function-declaration instead." -msgstr "Esta opción es obsoleta; utilice en su lugar -Werror=implicit-function-declaration" +msgstr "Esta opción es obsoleta; utilice en su lugar -Werror=implicit-function-declaration." #: c-family/c.opt:439 -#, fuzzy -#| msgid "Warn for implicit type conversions that may change a value" msgid "Warn for implicit type conversions that cause loss of floating point precision." -msgstr "Avisa cuando hay conversiones de tipo implÃcitas que pueden cambiar un valor" +msgstr "Avisa cuando hay conversiones de tipo implÃcitas que provocan pérdida de precisión en coma flotante." #: c-family/c.opt:443 -#, fuzzy -#| msgid "Warn if testing floating point numbers for equality" msgid "Warn if testing floating point numbers for equality." -msgstr "Avisa si se prueban números de coma flotante para equidad" +msgstr "Avisa si se está probando la igualdad de números de coma flotante." #: c-family/c.opt:447 c-family/c.opt:479 -#, fuzzy -#| msgid "Warn about printf/scanf/strftime/strfmon format string anomalies" msgid "Warn about printf/scanf/strftime/strfmon format string anomalies." -msgstr "Avisa sobre anomalÃas de cadena de formato de printf/scanf/strftime/strfmon" +msgstr "Advierte de anomalÃas de cadena de formato de printf/scanf/strftime/strfmon." #: c-family/c.opt:451 -#, fuzzy -#| msgid "Warn about format strings that contain NUL bytes" msgid "Warn about format strings that contain NUL bytes." -msgstr "Avisa sobre las cadenas de formato que contengan bytes NUL" +msgstr "Advierte de cadenas de formato que contengan bytes NUL." #: c-family/c.opt:455 -#, fuzzy -#| msgid "Warn if passing too many arguments to a function for its format string" msgid "Warn if passing too many arguments to a function for its format string." -msgstr "Avisa si se pasan demasiados argumentos a una función para su cadena de formato" +msgstr "Avisa si se pasan demasiados argumentos a una función para su cadena de formato." #: c-family/c.opt:459 -#, fuzzy -#| msgid "Warn about format strings that are not literals" msgid "Warn about format strings that are not literals." -msgstr "Avisa sobre el uso de cadenas de formato que no son literales" +msgstr "Avisa sobre el uso de cadenas de formato que no son literales." #: c-family/c.opt:463 -#, fuzzy -#| msgid "Warn about possible security problems with format functions" msgid "Warn about possible security problems with format functions." -msgstr "Avisa sobre posibles problemas de seguridad con funciones de formato" +msgstr "Avisa sobre posibles problemas de seguridad con funciones de formato." #: c-family/c.opt:467 -#, fuzzy -#| msgid "Warn about possible security problems with format functions" msgid "Warn about sign differences with format functions." -msgstr "Avisa sobre posibles problemas de seguridad con funciones de formato" +msgstr "Advierte de diferencias de signo en funciones de formato." #: c-family/c.opt:471 -#, fuzzy -#| msgid "Warn about strftime formats yielding 2-digit years" msgid "Warn about strftime formats yielding 2-digit years." -msgstr "Avisa sobre formatos de strftime que producen dos dÃgitos para el año" +msgstr "Avisa sobre formatos de strftime que producen dos dÃgitos para el año." #: c-family/c.opt:475 -#, fuzzy -#| msgid "Warn about zero-length formats" msgid "Warn about zero-length formats." -msgstr "Avisa sobre formatos de longitud cero" +msgstr "Avisa sobre formatos de longitud cero." #: c-family/c.opt:483 msgid "Warn whenever type qualifiers are ignored." msgstr "Avisa cada vez que se ignoran los calificadores de tipo." #: c-family/c.opt:487 -#, fuzzy -#| msgid "Warn whenever type qualifiers are ignored." msgid "Warn whenever attributes are ignored." -msgstr "Avisa cada vez que se ignoran los calificadores de tipo." +msgstr "Avisa cada vez que se ignoran los atributos." #: c-family/c.opt:491 msgid "Warn when there is a conversion between pointers that have incompatible types." -msgstr "" +msgstr "Avisa cuando hay conversión entre punteros de tipos incompatibles." #: c-family/c.opt:495 -#, fuzzy -#| msgid "Warn about variables which are initialized to themselves" msgid "Warn about variables which are initialized to themselves." -msgstr "Avisa sobre variables que se inicialicen ellas mismas" +msgstr "Avisa sobre variables que se inicialicen ellas mismas." #: c-family/c.opt:499 -#, fuzzy -#| msgid "Warn about implicit declarations" msgid "Warn about implicit declarations." -msgstr "Avisa sobre declaraciones implÃcitas" +msgstr "Avisa sobre declaraciones implÃcitas." #: c-family/c.opt:503 -#, fuzzy -#| msgid "Warn about implicit conversions from \"float\" to \"double\"" msgid "Warn about implicit conversions from \"float\" to \"double\"." -msgstr "Avisa sobre conversiones implÃcitas de \"float\" a \"double\"" +msgstr "Avisa sobre conversiones implÃcitas de \"float\" a \"double\"." #: c-family/c.opt:507 -#, fuzzy -#| msgid "Warn about implicit function declarations" msgid "Warn about implicit function declarations." -msgstr "Avisa sobre la declaración implÃcita de funciones" +msgstr "Avisa sobre la declaración implÃcita de funciones." #: c-family/c.opt:511 -#, fuzzy -#| msgid "Warn when a declaration does not specify a type" msgid "Warn when a declaration does not specify a type." -msgstr "Avisa cuando una declaración no especifique un tipo" +msgstr "Avisa cuando una declaración no especifique un tipo." #: c-family/c.opt:518 msgid "Warn about C++11 inheriting constructors when the base has a variadic constructor." -msgstr "" +msgstr "Advierte de constructores heredados de C++11 cuando la base tiene constructor variádico." #: c-family/c.opt:522 msgid "Warn about incompatible integer to pointer and pointer to integer conversions." -msgstr "" +msgstr "Advierte de conversiones de entero a puntero y viceversa incompatibles." #: c-family/c.opt:526 -#, fuzzy -#| msgid "Warn when there is a cast to a pointer from an integer of a different size" msgid "Warn when there is a cast to a pointer from an integer of a different size." -msgstr "Avisa cuando hay una conversión a puntero desde un entero de tamaño diferente" +msgstr "Avisa cuando hay una conversión a puntero desde un entero de tamaño diferente." #: c-family/c.opt:530 -#, fuzzy -#| msgid "Warn about invalid uses of the \"offsetof\" macro" msgid "Warn about invalid uses of the \"offsetof\" macro." -msgstr "Avisa sobre usos inválidos de la macro \"offsetof\"" +msgstr "Advierte de usos no válidos de la macro \"offsetof\"." #: c-family/c.opt:534 -#, fuzzy -#| msgid "Warn about PCH files that are found but not used" msgid "Warn about PCH files that are found but not used." -msgstr "Avisa sobre ficheros PCH que se encuentran pero no se usan" +msgstr "Avisa sobre ficheros PCH que se encuentran pero no se usan." #: c-family/c.opt:538 -#, fuzzy -#| msgid "Warn when a jump misses a variable initialization" msgid "Warn when a jump misses a variable initialization." -msgstr "Avisa cuando un salto pierde una inicialización de variable" +msgstr "Avisa cuando un salto pierde la inicialización de una variable." #: c-family/c.opt:542 msgid "Warn when a string or character literal is followed by a ud-suffix which does not begin with an underscore." -msgstr "" +msgstr "Avisa cuando una cadena o un carácter literal va seguido de un sufijo ud que no empieza por guión bajo." #: c-family/c.opt:546 -#, fuzzy -#| msgid "Warn when a logical operator is suspiciously always evaluating to true or false" msgid "Warn when a logical operator is suspiciously always evaluating to true or false." -msgstr "Avisa cuando un operador lógico sospechosamente evalúa siempre como verdadero o falso" +msgstr "Avisa cuando un operador lógico sospechosamente evalúa siempre como verdadero o falso." #: c-family/c.opt:550 msgid "Warn when logical not is used on the left hand side operand of a comparison." -msgstr "" +msgstr "Avisa cuando el no lógico se utiliza en el operando izquierdo de una comparación." #: c-family/c.opt:554 -#, fuzzy -#| msgid "Do not warn about using \"long long\" when -pedantic" msgid "Do not warn about using \"long long\" when -pedantic." -msgstr "No avisa sobre el uso de \"long long\" cuando se use -pedantic" +msgstr "No avisa sobre el uso de \"long long\" cuando se use -pedantic." #: c-family/c.opt:558 -#, fuzzy -#| msgid "Warn about suspicious declarations of \"main\"" msgid "Warn about suspicious declarations of \"main\"." -msgstr "Avisa sobre declaraciones sospechosas de \"main\"" +msgstr "Avisa sobre declaraciones sospechosas de \"main\"." #: c-family/c.opt:566 msgid "Warn about suspicious calls to memset where the third argument is constant literal zero and the second is not." -msgstr "" +msgstr "Advierte de llamadas sospechosas a memset en las que el tercer argumento es el cero literal constante y el segundo no lo es." #: c-family/c.opt:570 -#, fuzzy -#| msgid "Warn when the packed attribute has no effect on struct layout" msgid "Warn when the indentation of the code does not reflect the block structure." -msgstr "Avisa cuando el atributo packed no tiene efecto en la disposición de un struct" +msgstr "Avisa cuando el sangrado del código no refleja la estructura de bloque." #: c-family/c.opt:574 -#, fuzzy -#| msgid "Warn about possibly missing braces around initializers" msgid "Warn about possibly missing braces around initializers." -msgstr "Avisa sobre posibles llaves faltantes alrededor de los inicializadores" +msgstr "Avisa sobre posibles llaves faltantes alrededor de los inicializadores." #: c-family/c.opt:578 -#, fuzzy -#| msgid "Warn about global functions without previous declarations" msgid "Warn about global functions without previous declarations." -msgstr "Avisa sobre funciones globales sin declaraciones previas" +msgstr "Avisa sobre funciones globales sin declaraciones previas." #: c-family/c.opt:582 -#, fuzzy -#| msgid "Warn about missing fields in struct initializers" msgid "Warn about missing fields in struct initializers." -msgstr "Avisa sobre campos faltantes en los inicializadores de struct" +msgstr "Avisa sobre campos faltantes en los inicializadores de struct." #: c-family/c.opt:586 msgid "Warn on direct multiple inheritance." -msgstr "" +msgstr "Advierte de la herencia múltiple directa." #: c-family/c.opt:590 -#, fuzzy -#| msgid "Warn on calls to these functions" msgid "Warn on namespace definition." -msgstr "Avisa en las llamadas a estas funciones" +msgstr "Advierta de la definición de espacios de nombres." #: c-family/c.opt:594 -#, fuzzy -#| msgid "Warn about missing fields in struct initializers" msgid "Warn about missing sized deallocation functions." -msgstr "Avisa sobre campos faltantes en los inicializadores de struct" +msgstr "Advierte de funciones de desasignación con tamaño ausentes." #: c-family/c.opt:598 msgid "Warn about suspicious length parameters to certain string functions if the argument uses sizeof." -msgstr "" +msgstr "Advierte de parámetros de longitud sospechosa para determinadas funciones de cadenas si el argumento utiliza sizeof." #: c-family/c.opt:602 msgid "Warn when sizeof is applied on a parameter declared as an array." -msgstr "" +msgstr "Avisa cuando se aplica sizeof a parámetros declarados como array." #: c-family/c.opt:606 -#, fuzzy -#| msgid "Warn about functions which might be candidates for format attributes" msgid "Warn about functions which might be candidates for format attributes." -msgstr "Avisa por funciones que pueden ser candidatas para atributos de formato" +msgstr "Advierte de funciones que pueden ser candidatas para atributos de formato." #: c-family/c.opt:610 msgid "Suggest that the override keyword be used when the declaration of a virtual" -msgstr "" +msgstr "Sugiere utilizar la palabra reservada override cuando en la declaración de una virtual." #: c-family/c.opt:615 -#, fuzzy -#| msgid "Warn about enumerated switches, with no default, missing a case" msgid "Warn about enumerated switches, with no default, missing a case." -msgstr "Avisa sobre switches enumerados, sin valor por defecto, que carezcan de un case" +msgstr "Avisa sobre switches enumerados, sin valor por defecto, en los que falte un case." #: c-family/c.opt:619 -#, fuzzy -#| msgid "Warn about enumerated switches missing a \"default:\" statement" msgid "Warn about enumerated switches missing a \"default:\" statement." -msgstr "Avisa sobre switches enumerados que carezcan de una declaración \"default:\"" +msgstr "Avisa sobre switches enumerados que carezcan de una declaración \"default:\"." #: c-family/c.opt:623 -#, fuzzy -#| msgid "Warn about all enumerated switches missing a specific case" msgid "Warn about all enumerated switches missing a specific case." -msgstr "Avisa sobre todos los switches enumerados que carezcan de un case especÃfico" +msgstr "Avisa sobre todos los switches enumerados que carezcan de un case especÃfico." #: c-family/c.opt:627 -#, fuzzy -#| msgid "Warn about truncated character expressions" msgid "Warn about switches with boolean controlling expression." -msgstr "Avisa sobre expresiones de carácter truncadas" +msgstr "Avisa sobre switches cuya expresión de control sea booleana." #: c-family/c.opt:631 -#, fuzzy -#| msgid "for template declaration %q+D" msgid "Warn on primary template declaration." -msgstr "para la declaración de plantilla %q+D" +msgstr "Avisa en la declaración de la plantilla primeraria." #: c-family/c.opt:639 -#, fuzzy -#| msgid "Warn about user-specified include directories that do not exist" msgid "Warn about user-specified include directories that do not exist." -msgstr "Avisa sobre directorios de inclusión definidos por el usuario que no existen" +msgstr "Avisa sobre directorios de inclusión definidos por el usuario que no existen." #: c-family/c.opt:643 -#, fuzzy -#| msgid "Warn about function parameters declared without a type specifier in K&R-style functions" msgid "Warn about function parameters declared without a type specifier in K&R-style functions." -msgstr "Avisa sobre parámetros de función declarados sin un especificador de tipo en funciones de estilo K&R" +msgstr "Avisa sobre parámetros de función declarados sin un especificador de tipo en funciones de estilo K&R." #: c-family/c.opt:647 -#, fuzzy -#| msgid "Warn about global functions without prototypes" msgid "Warn about global functions without prototypes." -msgstr "Avisa sobre funciones globales sin prototipos" +msgstr "Avisa sobre funciones globales sin prototipos." #: c-family/c.opt:650 c-family/c.opt:1024 c-family/c.opt:1031 #: c-family/c.opt:1205 c-family/c.opt:1224 c-family/c.opt:1247 @@ -7136,16 +6787,12 @@ msgid "switch %qs is no longer supported" msgstr "la opción %qs ya no se admite" #: c-family/c.opt:654 -#, fuzzy -#| msgid "Warn about use of multi-character character constants" msgid "Warn about use of multi-character character constants." -msgstr "Avisa sobre el uso de constantes de carácter multicaracteres" +msgstr "Avisa sobre el uso de constantes de carácter multicaracteres." #: c-family/c.opt:658 -#, fuzzy -#| msgid "Warn about narrowing conversions within { } that are ill-formed in C++11" msgid "Warn about narrowing conversions within { } that are ill-formed in C++11." -msgstr "Avisa sobre conversiones que estrechan dentro de { } que están mal formadas en C++11" +msgstr "Avisa sobre conversiones que estrechan dentro de { } que están mal formadas en C++11." #: c-family/c.opt:662 #, fuzzy diff --git a/gcc/po/fr.po b/gcc/po/fr.po index 9ce8382869d..900e126d526 100644 --- a/gcc/po/fr.po +++ b/gcc/po/fr.po @@ -6,46 +6,47 @@ # Michel Robitaille <robitail@IRO.UMontreal.CA>, traducteur depuis/since 1996. # François-Xavier Coudert <fxcoudert@gmail.com>, 2008. # Stéphane Aulery <lkppo@free.fr>, 2015, 2016. +# Frédéric Marchal <fmarchal@perso.be>, 2016. # # Vocabulaire utilisé -# lvalue = membre gauche -# deprecated = obsolète -# out of range = hors des limites -# range = gamme -# scope = porté, champ -# shadowing = masquer -# embedded PIC = PIC enchâssé -# CPU = processeur -# structure with -# flexible member = structure ayant un membre flexible -# flag = fanion -# forward -# declaration = déclaration anticipée -# token = élément lexical (dans le contexte du parsing) -# to subscript = indicer -# top-level = hors de toute fonction -# member function = fonction membre -# template = patron (apparaît dans plusieurs dictionnaires) +# lvalue = membre gauche +# deprecated = obsolète +# out of range = hors des limites +# range = gamme +# scope = porté, champ +# shadowing = masquer +# embedded PIC = PIC enchâssé +# CPU = processeur +# structure with +# flexible member = structure ayant un membre flexible +# flag = fanion +# forward +# declaration = déclaration anticipée +# token = élément lexical (dans le contexte du parsing) +# to subscript = indicer +# top-level = hors de toute fonction +# member function = fonction membre +# template = patron (apparaît dans plusieurs dictionnaires) # # Pas traduit: -# thread +# thread # # J'ai des doutes pour : -# inline = enligne (pas systématiquement) +# inline = enligne (pas systématiquement) # oui dans le contexte du langage C par exemple MR # non autrement ...de manière générale MR -# section attribute attribut de section OK MR -# wide char caractère long ...non mieux caractère large MR -# plus conforme à l'esprit. +# section attribute = attribut de section OK MR +# wide char = caractère long ...non mieux caractère large MR +# plus conforme à l'esprit. # # ------ -# literals littéral, ou mot composé ? +# literals = littéral, ou mot composé ? # msgid "ISO C89 forbids compound literals" # msgstr "le C89 ISO interdit les mots composés" # -# symbol table table des symboles ou table de symbole -# command map carte des commandes -# Combiner combinateur +# symbol table = table des symboles ou table de symbole +# command map = carte des commandes +# Combiner = combinateur # msgid "" # ";; Combiner statistics: %d attempts, %d substitutions (%d requiring new space),\n" # ";; %d successes.\n" @@ -55,33 +56,33 @@ # ";; %d succès.\n" # "\n" # -# promote promouvoir +# promote = promouvoir # msgid "the left operand of \"%s\" changes sign when promoted" # msgstr "L'opérande gauche de « %s » change de signe lors de sa promotion" # -# include guards ??? +# include guards = ??? # msgid "Multiple include guards may be useful for:\n" # msgstr "De multiples balises pour les inclusions peuvent être utiles pour :\n" # # -# universal-character-name ??? +# universal-character-name = ??? # msgid "incomplete universal-character-name" # msgid "non-hex digit '%c' in universal-character-name" # msgid "universal-character-name on EBCDIC target" # -# poisoning empoisonnement +# poisoning = empoisonnement # msgid "poisoning existing macro \"%s\"" # msgstr "empoisonnement de la macro existente « %s »" # MR 9-jan 2004: poisoning etc... transformé par corruption corrompu etc.. # MR 24-mai 2004: poison etc...suite au msg concernant le #pragma once et #pragma poison # # Autres règles: -# - j'ai ajouté un adjectif par rapport à l'anglais si le message est -# une phrase avec verbe conjugé. -# - ISO est considéré comme un adjectif dans « C ISO » +# - j'ai ajouté un adjectif par rapport à l'anglais si le message est +# une phrase avec verbe conjugé. +# - ISO est considéré comme un adjectif dans « C ISO » # # Erreurs corrigées: -# librairies, assumer +# librairies, assumer # # A faire: # - s/en ligne/en-ligne/ modifié 9-janv-2004 MR @@ -122,16 +123,17 @@ # msgid "" msgstr "" -"Project-Id-Version: gcc 6.1.0\n" +"Project-Id-Version: gcc 6.2.0\n" "Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" "POT-Creation-Date: 2016-08-19 21:03+0000\n" -"PO-Revision-Date: 2016-06-02 00:10+0200\n" -"Last-Translator: Stéphane Aulery <lkppo@free.fr>\n" +"PO-Revision-Date: 2016-11-11 19:21+0100\n" +"Last-Translator: Frédéric Marchal <fmarchal@perso.be>\n" "Language-Team: French <traduc@traduc.org>\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: cfgrtl.c:2656 @@ -212,12 +214,12 @@ msgstr "propagation de const / copie désactivée" #: diagnostic.c:210 #, c-format msgid "%s: all warnings being treated as errors" -msgstr "%s : les avertissements sont traités comme des erreurs" +msgstr "%s : tous les avertissements sont traités comme des erreurs" #: diagnostic.c:215 #, c-format msgid "%s: some warnings being treated as errors" -msgstr "%s : les avertissements sont traités comme des erreurs" +msgstr "%s : certains avertissements sont traités comme des erreurs" #: diagnostic.c:290 input.c:169 c-family/c-opts.c:1310 cp/error.c:1196 #: fortran/cpp.c:576 fortran/error.c:996 fortran/error.c:1016 @@ -260,9 +262,9 @@ msgstr "%s:%d: embrouillé par les erreurs précédentes, abandon\n" # FIXME #: diagnostic.c:1309 -#, c-format +#, fuzzy, c-format msgid "Internal compiler error: Error reporting routines re-entered.\n" -msgstr "erreur interne au compilateur : routine de rapport d’erreur préemptée.\n" +msgstr "Erreur interne du compilateur : Erreur en rapportant les routines ré-entrées.\n" #: final.c:1192 msgid "negative insn length" @@ -274,7 +276,7 @@ msgstr "n'a pu séparer insn" #: final.c:3402 msgid "invalid 'asm': " -msgstr "asm invalide : " +msgstr "« asm » invalide : " #: final.c:3531 #, c-format @@ -304,7 +306,7 @@ msgstr "%%-code invalide" #: final.c:3804 #, c-format msgid "'%%l' operand isn't a label" -msgstr "l’opérande « %%l » n'est pas une étiquette" +msgstr "l'opérande « %%l » n'est pas une étiquette" #. We can't handle floating point constants; #. PRINT_OPERAND must handle them. @@ -412,15 +414,15 @@ msgstr " Afficher les types spécifiques des options d #: gcc.c:3390 msgid " (Use '-v --help' to display command line options of sub-processes).\n" -msgstr " (Utiliser « -v --help » pour afficher les options de la ligne de commande des sous-processus).\n" +msgstr " (Utilisez « -v --help » pour afficher les options de la ligne de commande des sous-processus).\n" #: gcc.c:3391 msgid " --version Display compiler version information.\n" -msgstr " --help Afficher des informations sur la version du compilateur.\n" +msgstr " --version Afficher des informations sur la version du compilateur.\n" #: gcc.c:3392 msgid " -dumpspecs Display all of the built in spec strings.\n" -msgstr " -dumpspecs Afficher tous les chaînes de specs internes.\n" +msgstr " -dumpspecs Afficher toutes les chaînes de specs internes.\n" #: gcc.c:3393 msgid " -dumpversion Display the version of the compiler.\n" @@ -440,11 +442,11 @@ msgstr " -print-libgcc-file-name Afficher le nom de la bibliothèque accompagn #: gcc.c:3397 msgid " -print-file-name=<lib> Display the full path to library <lib>.\n" -msgstr " -print-file-name=<lib> Afficher le chemin d’accès complet vers la bibliothèque <lib>.\n" +msgstr " -print-file-name=<lib> Afficher le chemin complet vers la bibliothèque <lib>.\n" #: gcc.c:3398 msgid " -print-prog-name=<prog> Display the full path to compiler component <prog>.\n" -msgstr " -print-prog-name=<prog> Afficher le chemin d’accès complet vers le composant du compilateur <prog>.\n" +msgstr " -print-prog-name=<prog> Afficher le chemin complet vers le composant <prog> du compilateur.\n" #: gcc.c:3399 msgid "" @@ -469,7 +471,7 @@ msgstr "" #: gcc.c:3406 msgid " -print-multi-os-directory Display the relative path to OS libraries.\n" -msgstr " -print-multi-os-directory Afficher le chemin relatif du répertoire vers les bibliothèques de l’OS.\n" +msgstr " -print-multi-os-directory Afficher le chemin relatif vers les bibliothèques de l’OS.\n" #: gcc.c:3407 msgid " -print-sysroot Display the target libraries directory.\n" @@ -481,7 +483,7 @@ msgstr " -print-sysroot-headers-suffix Afficher le suffixe de la racine systèm #: gcc.c:3409 msgid " -Wa,<options> Pass comma-separated <options> on to the assembler.\n" -msgstr " -Wa,<options> Passer les <options> séparées par des virgules à l’assembleur.\n" +msgstr " -Wa,<options> Passer les <options> séparées par des virgules à l'assembleur.\n" #: gcc.c:3410 msgid " -Wp,<options> Pass comma-separated <options> on to the preprocessor.\n" @@ -493,15 +495,15 @@ msgstr " -Wl,<options> Passer les <options> séparées par des virgu #: gcc.c:3412 msgid " -Xassembler <arg> Pass <arg> on to the assembler.\n" -msgstr " -Xassembler <argument> Passer l’<argument> à l’assembleur.\n" +msgstr " -Xassembler <argument> Passer l'<argument> à l'assembleur.\n" #: gcc.c:3413 msgid " -Xpreprocessor <arg> Pass <arg> on to the preprocessor.\n" -msgstr " -Xpreprocessor <argument> Passer l’<argument> au préprocesseur.\n" +msgstr " -Xpreprocessor <argument> Passer l'<argument> au préprocesseur.\n" #: gcc.c:3414 msgid " -Xlinker <arg> Pass <arg> on to the linker.\n" -msgstr " -Xlinker <argument> Passer l’<argument> à l’éditeur de liens.\n" +msgstr " -Xlinker <argument> Passer l’<argument> à l'éditeur de liens.\n" #: gcc.c:3415 msgid " -save-temps Do not delete intermediate files.\n" @@ -509,13 +511,15 @@ msgstr " -save-temps Ne pas détruire les fichiers intermédiaires #: gcc.c:3416 msgid " -save-temps=<arg> Do not delete intermediate files.\n" -msgstr " -save-temps=<arg> Ne pas détruire les fichiers intermédiaires.\n" +msgstr " -save-temps=<arg> Ne pas effacer les fichiers intermédiaires.\n" #: gcc.c:3417 msgid "" " -no-canonical-prefixes Do not canonicalize paths when building relative\n" " prefixes to other gcc components.\n" msgstr "" +" -no-canonical-prefixes Ne pas normaliser les chemins lors de la compilation\n" +" de préfixes relatifs à d'autres composants de gcc.\n" #: gcc.c:3420 msgid " -pipe Use pipes rather than intermediate files.\n" @@ -527,17 +531,19 @@ msgstr " -time Mesurer le temps d'exécution de chaque sous- #: gcc.c:3422 msgid " -specs=<file> Override built-in specs with the contents of <file>.\n" -msgstr " -specs=<fichier> Écraser les specs internes à l'aide du contenu du <fichier>.\n" +msgstr " -specs=<fichier> Remplacer les specs internes par le contenu du <fichier>.\n" #: gcc.c:3423 msgid " -std=<standard> Assume that the input sources are for <standard>.\n" -msgstr " -std=<standard> Présumer que les fichiers sources respectent le <standard>.\n" +msgstr " -std=<standard> Supposer que les fichiers sources respectent le <standard>.\n" #: gcc.c:3424 msgid "" " --sysroot=<directory> Use <directory> as the root directory for headers\n" " and libraries.\n" msgstr "" +" --sysroot=<répertoire> Utiliser <répertoire> comme répertoire racine pour les\n" +" en-têtes et les bibliothèques.\n" #: gcc.c:3427 msgid " -B <directory> Add <directory> to the compiler's search paths.\n" @@ -553,15 +559,15 @@ msgstr " -### Identique à -v mais les options et les comma #: gcc.c:3430 msgid " -E Preprocess only; do not compile, assemble or link.\n" -msgstr " -E Pré-traiter seulement ; ne pas compiler, assembler ou éditer les liens.\n" +msgstr " -E Pré-traitement seul ; ne pas compiler, assembler ou éditer les liens.\n" #: gcc.c:3431 msgid " -S Compile only; do not assemble or link.\n" -msgstr " -S Compiler seulement ; ne pas assembler ou éditer les liens.\n" +msgstr " -S Compilation seule ; ne pas assembler ou éditer les liens.\n" #: gcc.c:3432 msgid " -c Compile and assemble, but do not link.\n" -msgstr " -S Compiler et assembler, mais ne pas éditer les liens.\n" +msgstr " -c Compiler et assembler, mais ne pas éditer les liens.\n" #: gcc.c:3433 msgid " -o <file> Place the output into <file>.\n" @@ -569,11 +575,11 @@ msgstr " -o <fichier> Placer la sortie dans le <fichier>.\n" #: gcc.c:3434 msgid " -pie Create a position independent executable.\n" -msgstr " -pipe Créer un exécutable à chargement aléatoire en mémoire (PIE).\n" +msgstr " -pie Créer un exécutable indépendant de la position en mémoire (PIE).\n" #: gcc.c:3435 msgid " -shared Create a shared library.\n" -msgstr " -shared Créer une bibliothèque partagée.\n" +msgstr " -shared Créer une bibliothèque partagée.\n" #: gcc.c:3436 msgid "" @@ -582,7 +588,7 @@ msgid "" " 'none' means revert to the default behavior of\n" " guessing the language based on the file's extension.\n" msgstr "" -" -x <langage> Spécifier le langage des fichiers suivants d'entrée.\n" +" -x <langage> Spécifier le langage des fichiers d'entrée suivants.\n" " Les langages permis sont: c c++ assembler none\n" " « none » signifiant d'utiliser le comportement par défaut\n" " en tentant d'identifier le langage par l'extension du fichier.\n" @@ -597,7 +603,7 @@ msgid "" msgstr "" "\n" "Options débutant par -g, -f, -m, -O, -W, ou --param sont automatiquement\n" -" passés aux divers sous-processus invoqués par %s. Afin de passer\n" +" passées aux divers sous-processus invoqués par %s. Afin de passer\n" " les autres options à ces processus l'option -W<lettre> doit être utilisé.\n" #: gcc.c:5877 @@ -628,17 +634,17 @@ msgstr "gcc version %s %s\n" #: gcc.c:6610 #, c-format msgid "gcc driver version %s %sexecuting gcc version %s\n" -msgstr "version du pilote gcc %s %s exécutant le version %s de gcc\n" +msgstr "pilote gcc version %s %sexécutant gcc version %s\n" #: gcc.c:6683 gcc.c:6895 #, c-format msgid "The bug is not reproducible, so it is likely a hardware or OS problem.\n" -msgstr "" +msgstr "Le bogue n'est pas reproductible, donc c'est probablement un problème matériel ou dans l'OS.\n" #: gcc.c:6819 #, c-format msgid "Preprocessed source stored into %s file, please attach this to your bugreport.\n" -msgstr "" +msgstr "La source convertie par le préprocesseur a été stockée dans le fichier %s, veuillez l'attacher à votre rapport d'anomalie.\n" #: gcc.c:7761 #, c-format @@ -648,12 +654,12 @@ msgstr "installés: %s%s\n" #: gcc.c:7764 #, c-format msgid "programs: %s\n" -msgstr "programmes : %s\n" +msgstr "programmes: %s\n" #: gcc.c:7766 #, c-format msgid "libraries: %s\n" -msgstr "libraries : %s\n" +msgstr "bibliothèques: %s\n" #: gcc.c:7883 #, c-format @@ -662,7 +668,7 @@ msgid "" "For bug reporting instructions, please see:\n" msgstr "" "\n" -"Pour les instructions afin de rapporter des anomales, SVP consulter :\n" +"Pour les instructions afin de rapporter des anomalies, consultez :\n" #: gcc.c:7899 gcov-tool.c:525 #, c-format @@ -681,8 +687,8 @@ msgid "" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" "\n" msgstr "" -"Ce logiciel est libre; voir les sources pour les conditions de copie. Il n'y a PAS\n" -"GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.\n" +"Ce logiciel est libre; voir les sources pour les conditions de copie. Il n'y a\n" +"AUCUNE GARANTIE, pas même pour la COMMERCIALISATION ni L'ADÉQUATION À UNE TÂCHE PARTICULIÈRE.\n" "\n" #: gcc.c:8208 @@ -693,6 +699,10 @@ msgid "" "==============\n" "\n" msgstr "" +"\n" +"Options du lieur\n" +"================\n" +"\n" #: gcc.c:8209 #, c-format @@ -700,6 +710,8 @@ msgid "" "Use \"-Wl,OPTION\" to pass \"OPTION\" to the linker.\n" "\n" msgstr "" +"Utilisez « -Wl,OPTION » pour passer « OPTION » au lieur.\n" +"\n" #: gcc.c:9501 #, c-format @@ -708,7 +720,7 @@ msgid "" "=================\n" "\n" msgstr "" -"Options de l’assembleur\n" +"Options de l'assembleur\n" "=======================\n" "\n" @@ -718,11 +730,13 @@ msgid "" "Use \"-Wa,OPTION\" to pass \"OPTION\" to the assembler.\n" "\n" msgstr "" +"Utilisez « -Wa,OPTION » pour passer « OPTION » à l'assembleur.\n" +"\n" #: gcov-tool.c:166 #, c-format msgid " merge [options] <dir1> <dir2> Merge coverage file contents\n" -msgstr "" +msgstr " merge [options] <rép1> <rép2> Fusionner les contenus des fichiers de couverture\n" #: gcov-tool.c:167 gcov-tool.c:261 gcov-tool.c:417 #, c-format @@ -732,87 +746,87 @@ msgstr " -v, --verbose Mode verbeux\n" #: gcov-tool.c:168 gcov-tool.c:262 #, c-format msgid " -o, --output <dir> Output directory\n" -msgstr " -o, --output <dir> Répertoire de sortie\n" +msgstr " -o, --output <rép> Répertoire de sortie\n" #: gcov-tool.c:169 #, c-format msgid " -w, --weight <w1,w2> Set weights (float point values)\n" -msgstr "" +msgstr " -w, --weight <p1,p2> Définir les poids (valeurs décimales)\n" #: gcov-tool.c:185 #, c-format msgid "Merge subcomand usage:" -msgstr "" +msgstr "Utilisation de la sous-commande de fusion:" #: gcov-tool.c:260 #, c-format msgid " rewrite [options] <dir> Rewrite coverage file contents\n" -msgstr "" +msgstr " rewrite [options] <rép> Réécrire le contenu des fichiers de couverture\n" #: gcov-tool.c:263 #, c-format msgid " -s, --scale <float or simple-frac> Scale the profile counters\n" -msgstr "" +msgstr " -s, --scale <décimal ou frac simple> Met à l'échelle les compteurs de profils\n" #: gcov-tool.c:264 #, c-format msgid " -n, --normalize <long long> Normalize the profile\n" -msgstr "" +msgstr " -n, --normalize <long long> Normalise le profil\n" #: gcov-tool.c:281 #, c-format msgid "Rewrite subcommand usage:" -msgstr "" +msgstr "Utilisation de la sous-commande de réécriture:" #: gcov-tool.c:326 #, c-format msgid "scaling cannot co-exist with normalization, skipping\n" -msgstr "" +msgstr "la mise à l'échelle s'oppose à la normalisation, ignoré\n" #: gcov-tool.c:339 gcov-tool.c:349 #, c-format msgid "incorrect format in scaling, using 1/1\n" -msgstr "" +msgstr "format incorrect dans la mise à l'échelle, utilise 1/1\n" #: gcov-tool.c:359 #, c-format msgid "normalization cannot co-exist with scaling\n" -msgstr "" +msgstr "la normalisation s'oppose à la mise à l'échelle\n" #: gcov-tool.c:416 #, c-format msgid " overlap [options] <dir1> <dir2> Compute the overlap of two profiles\n" -msgstr "" +msgstr " overlap [options] <rép1> <rép2> Calcule le recouvrement de deux profils\n" #: gcov-tool.c:418 #, c-format msgid " -h, --hotonly Only print info for hot objects/functions\n" -msgstr " -h, --hotonly afficher seulement les informations sur les fonctions/objets chargés (hot)\n" +msgstr " -h, --hotonly Afficher seulement les informations sur les fonctions/objets chargés (hot)\n" #: gcov-tool.c:419 #, c-format msgid " -f, --function Print function level info\n" -msgstr " -f, --function afficher les informations sur le niveau de fonction\n" +msgstr " -f, --function Afficher les informations au niveau de la fonction\n" #: gcov-tool.c:420 #, c-format msgid " -F, --fullname Print full filename\n" -msgstr " -F, --fullname afficher les noms de fichier au complet\n" +msgstr " -F, --fullname Afficher le nom complet du fichier\n" #: gcov-tool.c:421 #, c-format msgid " -o, --object Print object level info\n" -msgstr " -o, --object afficher les informations sur le niveau d'objet\n" +msgstr " -o, --object Afficher les informations au niveau de l'objet\n" #: gcov-tool.c:422 #, c-format msgid " -t <float>, --hot_threshold <float> Set the threshold for hotness\n" -msgstr "" +msgstr " -t <décimal>, --hot_threshold <décimal> Change le seuil pour déclarer une fonction ou objet « hot »\n" #: gcov-tool.c:442 #, c-format msgid "Overlap subcomand usage:" -msgstr "" +msgstr "Utilisation de la sous-commande de recouvrement:" #: gcov-tool.c:508 #, c-format @@ -829,16 +843,18 @@ msgid "" "Offline tool to handle gcda counts\n" "\n" msgstr "" +"Outil hors ligne pour gérer les décomptes gcda\n" +"\n" #: gcov-tool.c:510 #, c-format msgid " -h, --help Print this help, then exit\n" -msgstr " -h, --help afficher cette aide, et quitter\n" +msgstr " -h, --help Afficher cette aide, et quitter\n" #: gcov-tool.c:511 #, c-format msgid " -v, --version Print version number, then exit\n" -msgstr " -v, --version afficher le numéro de version, et quitter\n" +msgstr " -v, --version Afficher le numéro de version, et quitter\n" #: gcov-tool.c:515 gcov.c:492 #, c-format @@ -848,7 +864,7 @@ msgid "" "%s.\n" msgstr "" "\n" -"Pour les instructions afin de rapporter des anomales, SVP consulter :\n" +"Pour les instructions afin de rapporter des anomalies, consultez :\n" "%s.\n" #: gcov-tool.c:526 @@ -864,9 +880,9 @@ msgid "" "FITNESS FOR A PARTICULAR PURPOSE.\n" "\n" msgstr "" -"Ce logiciel est libre; voir les sources pour les conditions de copie. \n" -"Il n'y a PAS GARANTIE; ni implicite pour le MARCHANDAGE ou\n" -"pour un BUT PARTICULIER.\n" +"Ce logiciel est libre; voir les sources pour les conditions de copie.\n" +"Il n'y a AUCUNE GARANTIE; pas même pour la COMMERCIALISATION ni\n" +"L'ADÉQUATION À UNE TÂCHE PARTICULIÈRE.\n" "\n" #: gcov.c:472 @@ -884,23 +900,23 @@ msgid "" "Print code coverage information.\n" "\n" msgstr "" -"Produire les informations de la couverture du code.\n" +"Afficher les informations de couverture du code.\n" "\n" #: gcov.c:474 #, c-format msgid " -h, --help Print this help, then exit\n" -msgstr " -h, --help afficher l'aide mémoire\n" +msgstr " -h, --help Afficher cette aide puis quitter\n" #: gcov.c:475 #, c-format msgid " -a, --all-blocks Show information for every basic block\n" -msgstr " -a, --all-blocks afficher l'information pour chaque bloc de base\n" +msgstr " -a, --all-blocks Afficher l'information pour chaque bloc de base\n" #: gcov.c:476 #, c-format msgid " -b, --branch-probabilities Include branch probabilities in output\n" -msgstr " -b, --branch-probabilities inclure les probabilités de branchement dans la sortie\n" +msgstr " -b, --branch-probabilities Inclure les probabilités de branchement dans la sortie\n" #: gcov.c:477 #, c-format @@ -908,23 +924,23 @@ msgid "" " -c, --branch-counts Output counts of branches taken\n" " rather than percentages\n" msgstr "" -" -c, --branch-counts donner le décompte de branchements pris\n" +" -c, --branch-counts Afficher le décompte des branchements pris\n" " plutôt que les pourcentages\n" #: gcov.c:479 #, c-format msgid " -d, --display-progress Display progress information\n" -msgstr " -d, --display-progress afficher les informations de progression\n" +msgstr " -d, --display-progress Afficher les informations de progression\n" #: gcov.c:480 #, c-format msgid " -f, --function-summaries Output summaries for each function\n" -msgstr " -f, --function-summaries produire un sommaire pour chaque fonction\n" +msgstr " -f, --function-summaries Produire des résumés pour chaque fonction\n" #: gcov.c:481 #, c-format msgid " -i, --intermediate-format Output .gcov file in intermediate text format\n" -msgstr "" +msgstr " -i, --intermediate-format Sortir le fichier .gcov dans un format texte intermédiaire\n" #: gcov.c:482 #, c-format @@ -932,48 +948,48 @@ msgid "" " -l, --long-file-names Use long output file names for included\n" " source files\n" msgstr "" -" -l, --long-file-names utiliser des longs noms de fichiers pour\n" -" les fichier sources d'inclusion\n" +" -l, --long-file-names Utiliser des noms longs pour les fichiers de\n" +" sortie des fichiers sources inclus\n" #: gcov.c:484 #, c-format msgid " -m, --demangled-names Output demangled function names\n" -msgstr "" +msgstr " -m, --demangled-names Afficher les noms de fonctions sans la décoration des noms\n" #: gcov.c:485 #, c-format msgid " -n, --no-output Do not create an output file\n" -msgstr " -n, --no-output ne créer de fichier de sortie\n" +msgstr " -n, --no-output Ne pas créer de fichier de sortie\n" #: gcov.c:486 #, c-format msgid " -o, --object-directory DIR|FILE Search for object files in DIR or called FILE\n" -msgstr " -o, --object-directory RÉP|FICHIERS rechercher les fichiers objets dans le RÉPertoire ou appelés FICHIERS\n" +msgstr " -o, --object-directory RÉP|FICHIERS Rechercher les fichiers objets dans le RÉPertoire ou appelés FICHIERS\n" #: gcov.c:487 #, c-format msgid " -p, --preserve-paths Preserve all pathname components\n" -msgstr " -p, --preserve-paths préserver tous les composants des chemins d'accès\n" +msgstr " -p, --preserve-paths Préserver tous les composants des chemins d'accès\n" #: gcov.c:488 #, c-format msgid " -r, --relative-only Only show data for relative sources\n" -msgstr " -r, --relative-only afficher seulement les données relatives aux sources\n" +msgstr " -r, --relative-only Afficher seulement les données des sources relatives\n" #: gcov.c:489 #, c-format msgid " -s, --source-prefix DIR Source prefix to elide\n" -msgstr "" +msgstr " -s, --source-prefix RÉP Préfixe a retirer des sources\n" #: gcov.c:490 #, c-format msgid " -u, --unconditional-branches Show unconditional branch counts too\n" -msgstr " -u, --unconditional-branches afficher les compteurs de branchement inconditionnel aussi\n" +msgstr " -u, --unconditional-branches Afficher aussi les compteurs de branchements inconditionnels\n" #: gcov.c:491 #, c-format msgid " -v, --version Print version number, then exit\n" -msgstr " -v, --version exécuter le numéro de <version> de gcc, si installée\n" +msgstr " -v, --version Afficher le numéro de version puis quitter\n" #: gcov.c:502 #, c-format @@ -1010,17 +1026,17 @@ msgstr "\n" #: gcov.c:856 #, c-format msgid "Cannot open intermediate output file %s\n" -msgstr "Impossible d'ouvrir le fichier intermédiaire de sortie « %s »\n" +msgstr "Impossible d'ouvrir le fichier de sortie intermédiaire %s\n" #: gcov.c:1139 #, c-format msgid "%s:source file is newer than notes file '%s'\n" -msgstr "%s : fichier source est plus récent que le fichier de notes « %s »\n" +msgstr "%s: fichier source est plus récent que le fichier de notes « %s »\n" #: gcov.c:1144 #, c-format msgid "(the message is displayed only once per source file)\n" -msgstr "" +msgstr "(le message est affiché une seule fois par fichier source)\n" #: gcov.c:1169 #, c-format @@ -1030,87 +1046,87 @@ msgstr "%s: Impossible d'ouvrir le fichier de notes\n" #: gcov.c:1175 #, c-format msgid "%s:not a gcov notes file\n" -msgstr "%s : n'est pas un fichier de notes gcov\n" +msgstr "%s: n'est pas un fichier de notes gcov\n" #: gcov.c:1188 #, c-format msgid "%s:version '%.4s', prefer '%.4s'\n" -msgstr "%s : version « %.4s », préfère « %.4s »\n" +msgstr "%s: version « %.4s », préférée « %.4s »\n" #: gcov.c:1234 #, c-format msgid "%s:already seen blocks for '%s'\n" -msgstr "%s : blocs déjà vus pour « %s »\n" +msgstr "%s: blocs déjà vus pour « %s »\n" #: gcov.c:1365 #, c-format msgid "%s:corrupted\n" -msgstr "%s : corrompu\n" +msgstr "%s: corrompu\n" #: gcov.c:1372 #, c-format msgid "%s:no functions found\n" -msgstr "%s: aucune fonction repérée\n" +msgstr "%s: aucune fonction trouvée\n" #: gcov.c:1391 #, c-format msgid "%s:cannot open data file, assuming not executed\n" -msgstr "%s : ne peut ouvrir le fichier de données, supposé non exécuté\n" +msgstr "%s: ne peut ouvrir le fichier de données, supposé non exécuté\n" #: gcov.c:1398 #, c-format msgid "%s:not a gcov data file\n" -msgstr "%s : n'est pas un fichier de données gcov\n" +msgstr "%s: pas un fichier de données gcov\n" #: gcov.c:1411 #, c-format msgid "%s:version '%.4s', prefer version '%.4s'\n" -msgstr "%s : version « %.4s », préfère la version « %.4s »\n" +msgstr "%s: version « %.4s », version préférée « %.4s »\n" #: gcov.c:1417 #, c-format msgid "%s:stamp mismatch with notes file\n" -msgstr "%s : estampille ne concorde par avec le fichier de notes\n" +msgstr "%s: l'estampille ne concorde par avec le fichier de notes\n" #: gcov.c:1452 #, c-format msgid "%s:unknown function '%u'\n" -msgstr "%s : fonction inconnue « %u »\n" +msgstr "%s: fonction inconnue « %u »\n" #: gcov.c:1466 #, c-format msgid "%s:profile mismatch for '%s'\n" -msgstr "%s : profile ne concorde pas pour « %s »\n" +msgstr "%s: profile ne concorde pas pour « %s »\n" #: gcov.c:1485 #, c-format msgid "%s:overflowed\n" -msgstr "%s : débordement\n" +msgstr "%s: débordement\n" #: gcov.c:1531 #, c-format msgid "%s:'%s' lacks entry and/or exit blocks\n" -msgstr "%s : « %s » manque de blocs d'entrée et/ou de sortie\n" +msgstr "%s: il manque les blocs d'entrée ou de sortie de « %s »\n" #: gcov.c:1536 #, c-format msgid "%s:'%s' has arcs to entry block\n" -msgstr "%s : « %s » possède des arcs vers un bloc d'entrée\n" +msgstr "%s: « %s » possède des arcs vers un bloc d'entrée\n" #: gcov.c:1544 #, c-format msgid "%s:'%s' has arcs from exit block\n" -msgstr "%s : « %s » possèdes des arcs à partir du bloc de sortie\n" +msgstr "%s: « %s » possède des arcs à partir du bloc de sortie\n" #: gcov.c:1752 #, c-format msgid "%s:graph is unsolvable for '%s'\n" -msgstr "%s : graphe n'a pas de solution pour « %s »\n" +msgstr "%s: le graphe n'a pas de solution pour « %s »\n" #: gcov.c:1860 #, c-format msgid "Lines executed:%s of %d\n" -msgstr "Lignes exécutées: %s de %d\n" +msgstr "Lignes exécutées: %s sur %d\n" #: gcov.c:1863 #, c-format @@ -1125,12 +1141,12 @@ msgstr "%s « %s »\n" #: gcov.c:1878 #, c-format msgid "Branches executed:%s of %d\n" -msgstr "Branchements exécutés : %s de %d\n" +msgstr "Branchements exécutés: %s sur %d\n" #: gcov.c:1882 #, c-format msgid "Taken at least once:%s of %d\n" -msgstr "Branchements pris au moins une fois : %s de %d\n" +msgstr "Pris au moins une fois: %s sur %d\n" #: gcov.c:1888 #, c-format @@ -1140,7 +1156,7 @@ msgstr "Pas de branchement\n" #: gcov.c:1890 #, c-format msgid "Calls executed:%s of %d\n" -msgstr "Appels exécutés : %s de %d\n" +msgstr "Appels exécutés: %s sur %d\n" #: gcov.c:1894 #, c-format @@ -1150,39 +1166,37 @@ msgstr "Pas d'appel\n" #: gcov.c:2142 #, c-format msgid "%s:no lines for '%s'\n" -msgstr "%s : pas de ligne pour « %s »\n" +msgstr "%s: pas de ligne pour « %s »\n" #: gcov.c:2336 #, c-format msgid "call %2d returned %s\n" msgstr "appel %2d a retourné %s\n" -# FIXME: c'est de l'assembleur ? #: gcov.c:2341 #, c-format msgid "call %2d never executed\n" -msgstr "call %2d n'est jamais été exécuté\n" +msgstr "appel %2d jamais exécuté\n" #: gcov.c:2346 #, c-format msgid "branch %2d taken %s%s\n" -msgstr "branchement %2d a pris %s%s\n" +msgstr "branchement %2d pris %s%s\n" #: gcov.c:2351 #, c-format msgid "branch %2d never executed\n" -msgstr "branchement %2d n'a jamais été exécuté\n" +msgstr "branchement %2d jamais exécuté\n" #: gcov.c:2356 #, c-format msgid "unconditional %2d taken %s\n" -msgstr "inconditionnel %2d a pris %s\n" +msgstr "inconditionnel %2d pris %s\n" -# FIXME: c'est de l'assembleur ? #: gcov.c:2359 #, c-format msgid "unconditional %2d never executed\n" -msgstr "inconditionnel %2d n'a jamais été exécuté\n" +msgstr "inconditionnel %2d jamais exécuté\n" #: gcov.c:2424 #, c-format @@ -1200,12 +1214,12 @@ msgstr "GCSE désactivé" #: gimple-ssa-isolate-paths.c:440 c/c-typeck.c:9773 #, gcc-internal-format msgid "function returns address of local variable" -msgstr "cette fonction retourne l'adresse d'une variable locale" +msgstr "la fonction retourne l'adresse d'une variable locale" #: gimple-ssa-isolate-paths.c:442 gimple-ssa-isolate-paths.c:287 #, gcc-internal-format msgid "function may return address of local variable" -msgstr "cette fonction peut retourner l'adresse d'une variable locale" +msgstr "la fonction peut retourner l'adresse d'une variable locale" #: incpath.c:72 #, c-format @@ -1240,24 +1254,24 @@ msgstr "Fin de la liste de recherche.\n" #. Opening quotation mark. #: intl.c:62 msgid "`" -msgstr "" +msgstr "« " #. Closing quotation mark. #: intl.c:65 msgid "'" -msgstr "" +msgstr " »" #: ipa-pure-const.c:187 msgid "function might be candidate for attribute %<%s%>" -msgstr "fonction peut être une candidate pour l'attribut %<%s%>" +msgstr "la fonction peut être une candidate pour l'attribut %<%s%>" #: ipa-pure-const.c:188 msgid "function might be candidate for attribute %<%s%> if it is known to return normally" -msgstr "fonction peut être une candidate possible pour l'attribut %<%s%> si elle connue pour returner normallement" +msgstr "la fonction pourrait être une candidate pour l'attribut %<%s%> si elle est connue pour retourner normalement" #: langhooks.c:373 msgid "At top level:" -msgstr "Hors de toute fonction :" +msgstr "Au plus haut niveau:" #: langhooks.c:393 cp/error.c:3315 #, c-format @@ -1271,33 +1285,33 @@ msgstr "Dans la fonction %qs" #: langhooks.c:448 cp/error.c:3268 msgid " inlined from %qs at %r%s:%d:%d%R" -msgstr "" +msgstr " mis en ligne depuis %qs à %r%s:%d:%d%R" # FRONT #: langhooks.c:453 cp/error.c:3273 msgid " inlined from %qs at %r%s:%d%R" -msgstr "" +msgstr " mis en ligne depuis %qs à %r%s:%d%R" #: langhooks.c:459 cp/error.c:3279 #, c-format msgid " inlined from %qs" -msgstr "" +msgstr " mis en ligne depuis %qs" #: loop-iv.c:3041 tree-ssa-loop-niter.c:2319 msgid "assuming that the loop is not infinite" -msgstr "" +msgstr "suppose que la boucle n'est pas infinie" #: loop-iv.c:3042 tree-ssa-loop-niter.c:2320 msgid "cannot optimize possibly infinite loops" -msgstr "" +msgstr "impossible d'optimiser des boucles peut-être infinies" #: loop-iv.c:3050 tree-ssa-loop-niter.c:2324 msgid "assuming that the loop counter does not overflow" -msgstr "" +msgstr "suppose que le compteur de la boucle ne déborde pas" #: loop-iv.c:3051 tree-ssa-loop-niter.c:2325 msgid "cannot optimize loop, the loop counter may overflow" -msgstr "" +msgstr "impossible d'optimiser la boucle car le compteur de la boucle peut déborder" #: lra-assigns.c:1417 reload1.c:2089 msgid "this is the insn:" @@ -1310,34 +1324,34 @@ msgstr "incapable de générer des recharges pour:" #. What to print when a switch has no documentation. #: opts.c:184 msgid "This option lacks documentation." -msgstr "Cette option manque de documentation." +msgstr "Il manque la documentation pour cette option." #: opts.c:185 msgid "Uses of this option are diagnosed." -msgstr "" +msgstr "Les utilisations de cette option sont diagnostiquées." #: opts.c:1061 #, c-format msgid "default %d minimum %d maximum %d" -msgstr "" +msgstr "par défaut %d minimum %d maximum %d" #: opts.c:1128 #, c-format msgid "Same as %s. Use the latter option instead." -msgstr "" +msgstr "Comme %s. Utilisez plutôt cette dernière option." #: opts.c:1136 #, c-format msgid "%s Same as %s." -msgstr "" +msgstr "%s Comme %s." #: opts.c:1207 msgid "[default]" -msgstr "" +msgstr "[par défaut]" #: opts.c:1218 msgid "[enabled]" -msgstr "" +msgstr "[activé]" #: opts.c:1218 msgid "[disabled]" @@ -1346,17 +1360,17 @@ msgstr "[désactivé]" #: opts.c:1237 #, c-format msgid " No options with the desired characteristics were found\n" -msgstr "" +msgstr " Aucune option avec les caractéristiques désirées a été trouvée\n" #: opts.c:1246 #, c-format msgid " None found. Use --help=%s to show *all* the options supported by the %s front-end.\n" -msgstr "" +msgstr " Aucune trouvée. Utilisez --help=%s pour voir *toutes* les options acceptées par l'interface %s.\n" #: opts.c:1252 #, c-format msgid " All options with the desired characteristics have already been displayed\n" -msgstr "" +msgstr " Toutes les options avec les caractéristiques désirées ont déjà été affichées\n" #: opts.c:1337 msgid "The following options are target specific" @@ -1380,15 +1394,15 @@ msgstr "L'option --param reconnaît les paramètres suivant" #: opts.c:1355 msgid "The following options are specific to just the language " -msgstr "Les options suivantes sont spécifiques au langage " +msgstr "Les options suivantes sont uniquement spécifiques au langage " #: opts.c:1357 msgid "The following options are supported by the language " -msgstr "Les options suivantes sont prises en charge pour le langage " +msgstr "Les options suivantes sont prises en charge par le langage " #: opts.c:1368 msgid "The following options are not documented" -msgstr "Les options suivantes sont non documentées" +msgstr "Les options suivantes ne sont pas documentées" #: opts.c:1370 msgid "The following options take separate arguments" @@ -1396,11 +1410,11 @@ msgstr "Les options suivantes prennent des arguments séparées" #: opts.c:1372 msgid "The following options take joined arguments" -msgstr "Les options suivantes prennent des arguments communs" +msgstr "Les options suivantes prennent des arguments groupés" #: opts.c:1383 msgid "The following options are language-related" -msgstr "Les options suivantes concernent les langages" +msgstr "Les options suivantes concernent des langages" #: plugin.c:796 msgid "Event" @@ -1413,12 +1427,12 @@ msgstr "Extensions" #: plugin.c:828 #, c-format msgid "*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.\n" -msgstr "" +msgstr "*** ATTENTION *** il y a des extensions actives, ne rapportez pas ceci comme un bogue à moins de savoir le reproduire sans activer les extensions.\n" #. It's the compiler's fault. #: reload1.c:6113 msgid "could not find a spill register" -msgstr "ne peut repérer un registre de déversement" +msgstr "n'a pu trouver un registre de déversement" #. It's the compiler's fault. #: reload1.c:8009 @@ -1427,7 +1441,7 @@ msgstr "mode VOID sur une sortie" #: reload1.c:8770 msgid "failure trying to reload:" -msgstr "" +msgstr "échec en essayant de recharger:" #: rtl-error.c:116 msgid "unrecognizable insn:" @@ -1463,7 +1477,7 @@ msgstr "collect: recompilation de %s\n" #: tlink.c:627 #, c-format msgid "collect: tweaking %s in %s\n" -msgstr "collect: tordage de %s dans %s\n" +msgstr "collect: ajuste %s dans %s\n" #: tlink.c:844 #, c-format @@ -1497,7 +1511,7 @@ msgstr "GMP version %s, MPFR version %s, MPC version %s, isl version %s\n" #: toplev.c:646 #, c-format msgid "%s%swarning: %s header version %s differs from library version %s.\n" -msgstr "" +msgstr "%s%savertissement: l'en-tête %s version %s diffère de la version %s de la bibliothèque.\n" #: toplev.c:648 #, c-format @@ -1510,41 +1524,41 @@ msgstr "options passées : " #: toplev.c:850 msgid "options enabled: " -msgstr "options autorisées : " +msgstr "options activées : " #: tree-diagnostic.c:295 c/c-decl.c:5203 c/c-typeck.c:6818 cp/error.c:682 #: cp/error.c:995 c-family/c-pretty-print.c:408 #, gcc-internal-format msgid "<anonymous>" -msgstr "<anonymous>" +msgstr "<anonyme>" #: cif-code.def:39 msgid "function not considered for inlining" -msgstr "fonction n'a pas été retenue pour l'enlignage" +msgstr "fonction pas retenue pour être mise en ligne" #: cif-code.def:43 msgid "caller is not optimized" -msgstr "" +msgstr "l'appelant n'est pas optimisé" #: cif-code.def:47 msgid "function body not available" -msgstr "corps de la fonction n'est pas disponible" +msgstr "le corps de la fonction n'est pas disponible" #: cif-code.def:51 msgid "redefined extern inline functions are not considered for inlining" -msgstr "fonctions externes enlignes redéfinies n'ont pas été retenues pour l'enlignage" +msgstr "les fonctions externes enlignes redéfinies ne sont pas retenues pour être mises en ligne" #: cif-code.def:56 msgid "function not inlinable" -msgstr "fonction ne peut être enligne" +msgstr "la fonction ne peut être mise en ligne" #: cif-code.def:60 msgid "function body can be overwritten at link time" -msgstr "le corps de la fonction peut être remplacé durant l’édition de liaison" +msgstr "le corps de la fonction peut être écrasé durant l'édition de liens" #: cif-code.def:64 msgid "function not inline candidate" -msgstr "la fonction n’est pas une candidate à l'enlignage" +msgstr "la fonction n’est pas une candidate à la mise en ligne" #: cif-code.def:68 msgid "--param large-function-growth limit reached" @@ -1568,51 +1582,47 @@ msgstr "--param inline-unit-growth limite atteinte" #: cif-code.def:80 msgid "recursive inlining" -msgstr "enlignage récursif" +msgstr "mise en ligne récursive" #: cif-code.def:84 msgid "call is unlikely and code size would grow" -msgstr "" +msgstr "l'appel est improbable et la taille du code augmenterait" #: cif-code.def:88 msgid "function not declared inline and code size would grow" -msgstr "" +msgstr "la fonction n'est pas déclarée en ligne et la taille du code augmenterait" #: cif-code.def:92 msgid "mismatched arguments" msgstr "arguments non concordantes" #: cif-code.def:96 -#, fuzzy -#| msgid "redefined extern inline functions are not considered for inlining" msgid "originally indirect function call not considered for inlining" -msgstr "fonctions externes enlignes redéfinies n'ont pas été retenues pour l'enlignage" +msgstr "l'appel de fonction initialement indirect n'est pas pris en compte pour la mise en ligne" #: cif-code.def:100 msgid "indirect function call with a yet undetermined callee" -msgstr "" +msgstr "appel de fonction indirect vers un appelé encore à déterminer" #: cif-code.def:104 msgid "exception handling personality mismatch" -msgstr "" +msgstr "désaccord sur la personnalité du traitement de l'exception" #: cif-code.def:109 -#, fuzzy -#| msgid "Enable exception handling" msgid "non-call exception handling mismatch" -msgstr "Autoriser le traitement des exceptions" +msgstr "désaccord sur le traitement de l'exception sans appel" #: cif-code.def:113 msgid "target specific option mismatch" -msgstr "option spécifique de cible incohérente" +msgstr "option spécifique à la cible incohérente" #: cif-code.def:117 msgid "optimization level attribute mismatch" -msgstr "attribut de niveau d’optimisation incohérent" +msgstr "incohérence d'un attribut au niveau de l'optimisation" #: cif-code.def:121 msgid "callee refers to comdat-local symbols" -msgstr "" +msgstr "l'appelé fait référence à des symboles locaux à comdat" #: cif-code.def:125 msgid "function attribute mismatch" @@ -1620,13 +1630,12 @@ msgstr "attribut de fonction incohérent" #: cif-code.def:129 #, fuzzy -#| msgid "your function will be miscompiled" msgid "caller function contains cilk spawn" -msgstr "votre fonction sera mal compilée" +msgstr "la fonction appelante contient du généré cilk" #: cif-code.def:133 msgid "unreachable" -msgstr "introuvable" +msgstr "inatteignable" #. The remainder are real diagnostic types. #: diagnostic.def:33 @@ -1678,86 +1687,82 @@ msgstr "permerreur : " #: params.def:49 #, no-c-format msgid "Maximal estimated outcome of branch considered predictable." -msgstr "" +msgstr "Estimation maximale de la conclusion de branches considérées prévisibles." #: params.def:54 #, no-c-format msgid "The minimal estimated speedup allowing inliner to ignore inline-insns-single and inline-isnsns-auto." -msgstr "" +msgstr "L'estimation de l'accélération minimale permettant au code de mise en ligne d'ignorer inline-insns-single et inline-isnsns-auto." #: params.def:71 #, no-c-format msgid "The maximum number of instructions in a single function eligible for inlining." -msgstr "Le nombre maximum d'instructions dans une fonction simple éligible au type enligne." +msgstr "Le nombre maximum d'instructions dans une seule fonction éligible à la mise en ligne." #: params.def:83 #, no-c-format msgid "The maximum number of instructions when automatically inlining." -msgstr "Le nombre maximum d'instructions lorsqu'automatiquement de type enligne." +msgstr "Le nombre maximum d'instructions lors de la mise en ligne automatique." #: params.def:88 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions in a single function eligible for inlining" +#, no-c-format msgid "The maximum number of instructions inline function can grow to via recursive inlining." -msgstr "Le nombre maximum d'instructions dans une fonction simple éligible au type enligne" +msgstr "Le nombre maximum d'instructions auquel une fonction en ligne peut grandir par la mise en ligne récursive." #: params.def:93 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions in a single function eligible for inlining" +#, no-c-format msgid "The maximum number of instructions non-inline function can grow to via recursive inlining." -msgstr "Le nombre maximum d'instructions dans une fonction simple éligible au type enligne" +msgstr "Le nombre maximum d'instructions auquel une fonction pas en ligne peut grandir par la mise en ligne récursive." #: params.def:98 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions for the RTL inliner" +#, no-c-format msgid "The maximum depth of recursive inlining for inline functions." -msgstr "Le nombre maximum d'instructions pour la fonction d'enlignage RTL" +msgstr "La profondeur maximum de mise en ligne récursive pour les fonctions en ligne." #: params.def:103 #, no-c-format msgid "The maximum depth of recursive inlining for non-inline functions." -msgstr "" +msgstr "La profondeur maximum de mise en ligne récursive pour les fonctions pas en ligne." #: params.def:108 #, no-c-format msgid "Inline recursively only when the probability of call being executed exceeds the parameter." -msgstr "" +msgstr "Mettre en ligne récursif uniquement quand la probabilité que l'appel soit exécuté dépasse le paramètre." #: params.def:116 -#, fuzzy, no-c-format -#| msgid "The maximum number of instructions for the RTL inliner" +#, no-c-format msgid "The maximum number of nested indirect inlining performed by early inliner." -msgstr "Le nombre maximum d'instructions pour la fonction d'enlignage RTL" +msgstr "Le nombre maximum de mises en ligne indirectes imbriquées réalisées par les premiers mis en ligne." #: params.def:122 #, no-c-format msgid "Probability that COMDAT function will be shared with different compilation unit." -msgstr "" +msgstr "Probabilité qu'une fonction COMDAT soit partagée avec des unités de compilation différentes." #: params.def:128 #, no-c-format msgid "Maximum probability of the entry BB of split region (in percent relative to entry BB of the function) to make partial inlining happen." -msgstr "" +msgstr "Probabilité maximum que l'entrée B8 d'une région scindée (en pourcent relatif à l'entrée B8 de la fonction) pour réaliser la mise en ligne partielle." #: params.def:135 #, no-c-format msgid "If -fvariable-expansion-in-unroller is used, the maximum number of times that an individual variable will be expanded during loop unrolling." -msgstr "" +msgstr "Si -fvariable-expansion-in-unroller est utilisé, le nombre maximum de fois qu'une variable individuelle sera développée pendant le dépliage de la boucle." #: params.def:141 #, no-c-format msgid "If -ftree-vectorize is used, the minimal loop bound of a loop to be considered for vectorization." -msgstr "" +msgstr "Si -ftree-vectorize est utilisé, la limite minimale de boucle d'une boucle prise en compte pour la vectorisation." #: params.def:152 #, no-c-format msgid "The maximum number of instructions to consider to fill a delay slot." -msgstr "Le nombre maximum d'instructions à considérer pour remplir une slot délai." +msgstr "Le nombre maximum d'instructions à considérer pour remplir un créneau de délai." #: params.def:163 #, no-c-format msgid "The maximum number of instructions to consider to find accurate live register information." -msgstr "Le nombre maximum d'instructions à considérer pour repérer un registre d'information actif et précis." +msgstr "Le nombre maximum d'instructions à considérer pour trouver les informations correctes d'un registre actif." #: params.def:173 #, no-c-format diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c index a39815ea511..e58619dcda7 100644 --- a/gcc/pretty-print.c +++ b/gcc/pretty-print.c @@ -294,6 +294,8 @@ pp_indent (pretty_printer *pp) integer. %Ns: likewise, but length specified as constant in the format string. Flag 'q': quote formatted text (must come immediately after '%'). + %Z: Requires two arguments - array of int, and len. Prints elements + of the array. Arguments can be used sequentially, or through %N$ resp. *N$ notation Nth argument after the format string. If %N$ / *N$ @@ -610,6 +612,23 @@ pp_format (pretty_printer *pp, text_info *text) (pp, *text->args_ptr, precision, unsigned, "u"); break; + case 'Z': + { + int *v = va_arg (*text->args_ptr, int *); + unsigned len = va_arg (*text->args_ptr, unsigned); + + for (unsigned i = 0; i < len; ++i) + { + pp_scalar (pp, "%i", v[i]); + if (i < len - 1) + { + pp_comma (pp); + pp_space (pp); + } + } + break; + } + case 'x': if (wide) pp_scalar (pp, HOST_WIDE_INT_PRINT_HEX, @@ -1424,6 +1443,13 @@ test_pp_format () "`\33[01m\33[Kfoo\33[m\33[K' 12345678", "%qs %x", "foo", 0x12345678); + /* Verify %Z. */ + int v[] = { 1, 2, 3 }; + ASSERT_PP_FORMAT_3 ("1, 2, 3 12345678", "%Z %x", v, 3, 0x12345678); + + int v2[] = { 0 }; + ASSERT_PP_FORMAT_3 ("0 12345678", "%Z %x", v2, 1, 0x12345678); + /* Verify that combinations work, along with unformatted text. */ assert_pp_format (SELFTEST_LOCATION, "the quick brown fox jumps over the lazy dog", diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 4d7aad0dff0..4617e8ee449 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -4256,7 +4256,7 @@ cached_nonzero_bits (const_rtx x, machine_mode mode, const_rtx known_x, /* Given an expression, X, compute which bits in X can be nonzero. We don't care about bits outside of those defined in MODE. - For most X this is simply GET_MODE_MASK (GET_MODE (MODE)), but if X is + For most X this is simply GET_MODE_MASK (GET_MODE (X)), but if X is an arithmetic operation, we can do better. */ static unsigned HOST_WIDE_INT @@ -4563,18 +4563,17 @@ nonzero_bits1 (const_rtx x, machine_mode mode, const_rtx known_x, /* If this is a SUBREG formed for a promoted variable that has been zero-extended, we know that at least the high-order bits are zero, though others might be too. */ - if (SUBREG_PROMOTED_VAR_P (x) && SUBREG_PROMOTED_UNSIGNED_P (x)) nonzero = GET_MODE_MASK (GET_MODE (x)) & cached_nonzero_bits (SUBREG_REG (x), GET_MODE (x), known_x, known_mode, known_ret); - inner_mode = GET_MODE (SUBREG_REG (x)); /* If the inner mode is a single word for both the host and target machines, we can compute this from which bits of the inner object might be nonzero. */ + inner_mode = GET_MODE (SUBREG_REG (x)); if (GET_MODE_PRECISION (inner_mode) <= BITS_PER_WORD - && (GET_MODE_PRECISION (inner_mode) <= HOST_BITS_PER_WIDE_INT)) + && GET_MODE_PRECISION (inner_mode) <= HOST_BITS_PER_WIDE_INT) { nonzero &= cached_nonzero_bits (SUBREG_REG (x), mode, known_x, known_mode, known_ret); @@ -4582,19 +4581,17 @@ nonzero_bits1 (const_rtx x, machine_mode mode, const_rtx known_x, /* On many CISC machines, accessing an object in a wider mode causes the high-order bits to become undefined. So they are not known to be zero. */ - if (!WORD_REGISTER_OPERATIONS - /* If this is a typical RISC machine, we only have to worry - about the way loads are extended. */ - || ((LOAD_EXTEND_OP (inner_mode) == SIGN_EXTEND - ? val_signbit_known_set_p (inner_mode, nonzero) - : LOAD_EXTEND_OP (inner_mode) != ZERO_EXTEND) - || !MEM_P (SUBREG_REG (x)))) - { - if (GET_MODE_PRECISION (GET_MODE (x)) + if ((!WORD_REGISTER_OPERATIONS + /* If this is a typical RISC machine, we only have to worry + about the way loads are extended. */ + || (LOAD_EXTEND_OP (inner_mode) == SIGN_EXTEND + ? val_signbit_known_set_p (inner_mode, nonzero) + : LOAD_EXTEND_OP (inner_mode) != ZERO_EXTEND) + || (!MEM_P (SUBREG_REG (x)) && !REG_P (SUBREG_REG (x)))) + && GET_MODE_PRECISION (GET_MODE (x)) > GET_MODE_PRECISION (inner_mode)) - nonzero |= (GET_MODE_MASK (GET_MODE (x)) - & ~GET_MODE_MASK (inner_mode)); - } + nonzero + |= (GET_MODE_MASK (GET_MODE (x)) & ~GET_MODE_MASK (inner_mode)); } break; @@ -4799,6 +4796,7 @@ num_sign_bit_copies1 (const_rtx x, machine_mode mode, const_rtx known_x, { enum rtx_code code = GET_CODE (x); unsigned int bitwidth = GET_MODE_PRECISION (mode); + machine_mode inner_mode; int num0, num1, result; unsigned HOST_WIDE_INT nonzero; @@ -4906,13 +4904,13 @@ num_sign_bit_copies1 (const_rtx x, machine_mode mode, const_rtx known_x, } /* For a smaller object, just ignore the high bits. */ - if (bitwidth <= GET_MODE_PRECISION (GET_MODE (SUBREG_REG (x)))) + inner_mode = GET_MODE (SUBREG_REG (x)); + if (bitwidth <= GET_MODE_PRECISION (inner_mode)) { num0 = cached_num_sign_bit_copies (SUBREG_REG (x), VOIDmode, known_x, known_mode, known_ret); - return MAX (1, (num0 - - (int) (GET_MODE_PRECISION (GET_MODE (SUBREG_REG (x))) - - bitwidth))); + return + MAX (1, num0 - (int) (GET_MODE_PRECISION (inner_mode) - bitwidth)); } /* For paradoxical SUBREGs on machines where all register operations @@ -4926,9 +4924,10 @@ num_sign_bit_copies1 (const_rtx x, machine_mode mode, const_rtx known_x, to the stack. */ if (WORD_REGISTER_OPERATIONS + && GET_MODE_PRECISION (inner_mode) <= BITS_PER_WORD + && LOAD_EXTEND_OP (inner_mode) == SIGN_EXTEND && paradoxical_subreg_p (x) - && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND - && MEM_P (SUBREG_REG (x))) + && (MEM_P (SUBREG_REG (x)) || REG_P (SUBREG_REG (x)))) return cached_num_sign_bit_copies (SUBREG_REG (x), mode, known_x, known_mode, known_ret); break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 87f09bd4259..e9485591659 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,143 @@ +2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com> + Richard Biener <rguenther@suse.de> + + * gcc.dg/gimplefe-1.c: New testcase. + * gcc.dg/gimplefe-2.c: Likewise. + * gcc.dg/gimplefe-3.c: Likewise. + * gcc.dg/gimplefe-4.c: Likewise. + * gcc.dg/gimplefe-5.c: Likewise. + * gcc.dg/gimplefe-6.c: Likewise. + * gcc.dg/gimplefe-7.c: Likewise. + * gcc.dg/gimplefe-8.c: Likewise. + * gcc.dg/gimplefe-9.c: Likewise. + * gcc.dg/gimplefe-10.c: Likewise. + * gcc.dg/gimplefe-11.c: Likewise. + * gcc.dg/gimplefe-12.c: Likewise. + * gcc.dg/gimplefe-13.c: Likewise. + * gcc.dg/gimplefe-14.c: Likewise. + * gcc.dg/gimplefe-15.c: Likewise. + * gcc.dg/gimplefe-16.c: Likewise. + * gcc.dg/gimplefe-17.c: Likewise. + * gcc.dg/gimplefe-18.c: Likewise. + +2016-11-14 Martin Liska <mliska@suse.cz> + + PR bootstrap/78069 + * gcc.dg/no_profile_instrument_function-attr-1.c: Update test + to match scanned pattern. + * gcc.dg/tree-ssa/ssa-lim-11.c: Likewise. + +2016-11-14 Richard Biener <rguenther@suse.de> + + PR tree-optimization/78312 + * gcc.dg/torture/pr78312.c: New testcase. + +2016-11-14 Georg-Johann Lay <avr@gjlay.de> + + PR target/78093 + * gcc.target/avr/torture/tiny-absdata-2.c: New test. + +2016-11-14 Jakub Jelinek <jakub@redhat.com> + Jason Merrill <jason@redhat.com> + + Implement P0217R3 - C++17 structured bindings + * g++.dg/cpp1z/decomp1.C: New test. + * g++.dg/cpp1z/decomp2.C: New test. + * g++.dg/cpp1z/decomp3.C: New test. + * g++.dg/cpp1z/decomp4.C: New test. + * g++.dg/cpp1z/decomp5.C: New test. + * g++.dg/cpp1z/decomp6.C: New test. + * g++.dg/cpp1z/decomp7.C: New test. + * g++.dg/cpp1z/decomp8.C: New test. + * g++.dg/cpp1z/decomp9.C: New test. + * g++.dg/cpp1z/decomp10.C: New test. + +2016-11-13 Kugan Vivekanandarajah <kuganv@linaro.org> + + * g++.dg/torture/pr78268.C: New test. + +2016-11-13 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> + + PR c/35503 + * c-c++-common/pr35503-1.c: New test. + * c-c++-common/pr35503-2.c: Likewise. + * c-c++-common/pr35503-3.c: Likewise. + * gcc.dg/format/gcc_diag-1.c: Add tests for "Z" specifier. + +2016-11-13 Uros Bizjak <ubizjak@gmail.com> + + PR rtl-optimization/78232 + PR rtl-optimization/78248 + * gcc.dg/ubsan/pr78248.c: New test. + +2016-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/address_conv.adb: New test. + +2016-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/renaming11.ad[sb]: New test. + +2016-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * c-c++-common/dump-ada-spec-6.c: New test. + +2016-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/lto21.adb: New test. + * gnat.dg/lto21_pkg1.ads: New helper. + * gnat.dg/lto21_pkg2.ad[sb]: Likewise. + +2016-11-13 Janus Weil <janus@gcc.gnu.org> + + PR fortran/60952 + * gfortran.dg/typebound_proc_34.f90: New test. + +2016-11-13 Janus Weil <janus@gcc.gnu.org> + + PR fortran/66366 + * gfortran.dg/class_57.f90: Changed error message. + * gfortran.dg/class_60.f90: New test. + +2016-11-12 David Edelsohn <dje.gcc@gmail.com> + + * g++.dg/pr78112.C: XFAIL AIX. + +2016-11-12 Janus Weil <janus@gcc.gnu.org> + + PR fortran/77501 + * gfortran.dg/typebound_generic_16.f90: New test. + +2016-11-12 Jakub Jelinek <jakub@redhat.com> + + PR c++/71225 + * g++.dg/cpp0x/pr71225.C: New test. + +2016-11-11 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.target/sparc/20161111-1.c: New test. + +2016-11-11 Uros Bizjak <ubizjak@gmail.com> + + PR target/78310 + * gcc.target/i386/pr78310.c: New test. + +2016-11-11 Jeff Law <law@redhat.com> + + * gcc.dg/tree-ssa/isolate-6.c: New test. + * gcc.dg/tree-ssa/isolate-7.c: New test. + +2016-11-11 Bin Cheng <bin.cheng@arm.com> + + PR testsuite/78292 + * gcc.dg/vect/vect-cond-2.c: Only drop xfail for targets supporting + vect_max_reduc. + +2016-11-11 Jakub Jelinek <jakub@redhat.com> + + PR c++/72774 + * g++.dg/parse/pr72774.C: New test. + 2016-11-11 Richard Biener <rguenther@suse.de> PR tree-optimization/71575 @@ -2876,8 +3016,8 @@ arm_fp16_alternative_ok. * g++.dg/ext/arm-fp16/arm-fp16-ops-4.C: Likewise. * gcc.dg/torture/arm-fp16-int-convert-alt.c: Likewise. - * gcc/testsuite/gcc.dg/torture/arm-fp16-ops-3.c: Likewise. - * gcc/testsuite/gcc.dg/torture/arm-fp16-ops-4.c: Likewise. + * gcc.dg/torture/arm-fp16-ops-3.c: Likewise. + * gcc.dg/torture/arm-fp16-ops-4.c: Likewise. * gcc.target/arm/fp16-compile-alt-1.c: Likewise. * gcc.target/arm/fp16-compile-alt-10.c: Likewise. * gcc.target/arm/fp16-compile-alt-11.c: Likewise. diff --git a/gcc/testsuite/c-c++-common/dump-ada-spec-6.c b/gcc/testsuite/c-c++-common/dump-ada-spec-6.c new file mode 100644 index 00000000000..fb31b3bca00 --- /dev/null +++ b/gcc/testsuite/c-c++-common/dump-ada-spec-6.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-ada-spec" } */ + +typedef enum { + Zero +} MyEnum; + +typedef MyEnum SomethingElse; + +/* { dg-final { cleanup-ada-spec } } */ diff --git a/gcc/testsuite/c-c++-common/pr35503-1.c b/gcc/testsuite/c-c++-common/pr35503-1.c new file mode 100644 index 00000000000..25e3721df93 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr35503-1.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-Wrestrict" } */ + +int foo (char *__restrict buf, const char *__restrict fmt, ...); + +void f(void) +{ + char buf[100] = "hello"; + foo (buf, "%s-%s", buf, "world"); /* { dg-warning "passing argument 1 to restrict-qualified parameter aliases with argument 3" } */ +} diff --git a/gcc/testsuite/c-c++-common/pr35503-2.c b/gcc/testsuite/c-c++-common/pr35503-2.c new file mode 100644 index 00000000000..bfcd9448e03 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr35503-2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-fdiagnostics-show-caret -Wrestrict" } */ + +void f(int *__restrict x, int *y, int *__restrict z, int *w); + +void foo(int alpha, int beta) +{ + f (&alpha, &beta, &alpha, &alpha); /* { dg-warning "passing argument 1 to restrict-qualified parameter aliases with arguments 3, 4" } */ + +/* { dg-begin-multiline-output "" } + f (&alpha, &beta, &alpha, &alpha); + ^~~~~~ ~~~~~~ ~~~~~~ + { dg-end-multiline-output "" } */ +} diff --git a/gcc/testsuite/c-c++-common/pr35503-3.c b/gcc/testsuite/c-c++-common/pr35503-3.c new file mode 100644 index 00000000000..8cbacabba62 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr35503-3.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-Wrestrict" } */ + +void f(int *x, int *__restrict y); + +void foo(int a) +{ + f (&a, &a); /* { dg-warning "passing argument 2 to restrict-qualified parameter aliases with argument 1" } */ +} diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-56.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-56.C new file mode 100644 index 00000000000..7e894cdbd86 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-56.C @@ -0,0 +1,4 @@ +// { dg-do compile { target c++11 } } + +using I = int; // { dg-message "int" } +using I = float; // { dg-error "float" } diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-complex2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-complex2.C new file mode 100644 index 00000000000..9a9291b264c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-complex2.C @@ -0,0 +1,5 @@ +// { dg-do compile { target c++11 } } +// { dg-options "" } + +static _Complex int i; +static_assert (&__imag i == &__imag i, ""); diff --git a/gcc/testsuite/g++.dg/cpp0x/explicit-inst1.C b/gcc/testsuite/g++.dg/cpp0x/explicit-inst1.C new file mode 100644 index 00000000000..a6455d8310b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/explicit-inst1.C @@ -0,0 +1,13 @@ +// In C++11 explicit instantiation without a nested-name-specifier must be in +// the same namespace. + +namespace N { + template <class T> class foo {}; + template <class T> class bar {}; +} + +using N::bar; +template class bar<int>; // { dg-error "" "" { target c++11 } } + +using namespace N; +template class foo<int>; // { dg-error "" "" { target c++11 } } diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71225.C b/gcc/testsuite/g++.dg/cpp0x/pr71225.C new file mode 100644 index 00000000000..8a328e4d939 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr71225.C @@ -0,0 +1,17 @@ +// PR c++/71225 +// { dg-do compile { target c++11 } } + +template <bool, class> struct A; +template <class T> struct B; +template <typename T> +struct C +{ + struct D + { + template <int N = 42, typename A<N == 43 || B<T>(), int>::type = 0> + void foo () const {} + template <int N = 42, typename A<N == 43 || !B<T> (), int>::type = 0> + void foo () const {} + void bar () { foo (); } + }; +}; diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic169.C b/gcc/testsuite/g++.dg/cpp0x/variadic169.C new file mode 100644 index 00000000000..6858973cd2e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic169.C @@ -0,0 +1,9 @@ +// DR 2233 +// { dg-do compile { target c++11 } } + +template<typename ...T> void f(int n = 0, T ...t); + +int main() +{ + f<int>(); // { dg-error "too few arguments" } +} diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp1.C b/gcc/testsuite/g++.dg/cpp1z/decomp1.C new file mode 100644 index 00000000000..98f60905e1a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp1.C @@ -0,0 +1,35 @@ +// { dg-do run { target c++11 } } +// { dg-options "" } + +int a[2] = { 1, 2 }; +struct S { int a; signed char b; float c; } s = { 6, 7, 8.0f }; + +int +main () +{ + auto & [ c, d ] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto [ e, f ] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto [ g, h, i ] = s; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto & [ j, k, l ] = s; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + c++; + d++; + e += 6; + f += 7; + g++; + h++; + j += 10; + k += 11; + if (c != 2 || &c != &a[0] + || d != 3 || &d != &a[1] + || e != 7 || &e == &a[0] + || f != 9 || &f == &a[1] + || g != 7 || &g == &s.a + || h != 8 || &h == &s.b + || i != 8.0f || &i == &s.c + || j != 16 || &j != &s.a + || k != 18 || &k != &s.b + || l != 8.0f || &l != &s.c + || a[0] != 2 || a[1] != 3 + || s.a != 16 || s.b != 18 || s.c != 8.0f) + __builtin_abort (); +} diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp10.C b/gcc/testsuite/g++.dg/cpp1z/decomp10.C new file mode 100644 index 00000000000..316cea98811 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp10.C @@ -0,0 +1,48 @@ +// { dg-options -std=c++1z } + +namespace std { + template<typename T> struct tuple_size; + template<int, typename> struct tuple_element; +} + +struct A1 { int i,j; } a1; +template<> struct std::tuple_size<A1> { }; +void f1() { auto [ x ] = a1; } // { dg-error "decomposes into 2" } + +struct A2 { int i,j; } a2; +template<> struct std::tuple_size<A2> { enum { value = 5 }; }; +void f2() { auto [ x ] = a2; } // { dg-error "decomposes into 5" } + +struct A3 { int i,j; } a3; +template<> struct std::tuple_size<A3> { enum { value = 1 }; }; +void f3() { auto [ x ] = a3; } // { dg-error "get" } + +struct A3a { int i,j; int get(); } a3a; +template<> struct std::tuple_size<A3a> { enum { value = 1 }; }; +void f3a() { auto [ x ] = a3a; } // { dg-error "get<0>" } + +struct A3b { int i,j; } a3b; +int get(A3b&&); +template<> struct std::tuple_size<A3b> { enum { value = 1 }; }; +void f3b() { auto [ x ] = a3b; } // { dg-error "get<0>" } + +struct A4 { + int ar[3]; + template <int I> int& get() { return ar[I]; } +} a4; +template<> struct std::tuple_size<A4> { enum { value = 3 }; }; +template <int I> +void f4() { auto [ x, y, z ] = a4; } // { dg-error "tuple_element" } + +struct A5 { } a5; +template <int I> int& get(A5&& a); +template<> struct std::tuple_size<A5> { enum { value = 3 }; }; +template <int I> +void f5() { auto [ x, y, z ] = a5; } // { dg-error "tuple_element" } + +struct A6 { } a6; +template <int I> int& get(A6&& a); +template<> struct std::tuple_size<A6> { enum { value = 3 }; }; +template<> struct std::tuple_element<0, A6> { }; +template <int I> +void f6() { auto [ x, y, z ] = a6; } // { dg-error "no type named .type" } diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp2.C b/gcc/testsuite/g++.dg/cpp1z/decomp2.C new file mode 100644 index 00000000000..5831fc74940 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp2.C @@ -0,0 +1,54 @@ +// { dg-do run { target c++11 } } +// { dg-options "" } + +typedef int V __attribute__((vector_size (4 * sizeof (int)))); +V a = (V) { 1, 2, 3, 4 }; +__complex__ double b = 5.0 + 6.0i; +__complex__ int c = 7 + 8i; + +int +main () +{ + auto & [ d, e, f, g ] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto [ h, i, j, k ] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto [ l, m ] = b; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto & [ n, o ] = b; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto & [ p, q ] = c; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto [ r, s ] = c; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + d += 10; + e += 11; + f += 12; + g += 13; + h += 14; + i += 15; + j += 16; + k += 17; + l = l * 2.; + m = m * 3.; + n = n * 3.; + o = o * 2.; + p += 18; + q += 19; + r += 22; + s += 23; + if (d != 11 || &d != &a[0] + || e != 13 || &e != &a[1] + || f != 15 || &f != &a[2] + || g != 17 || &g != &a[3] + || h != 15 || &h == &a[0] + || i != 17 || &i == &a[1] + || j != 19 || &j == &a[2] + || k != 21 || &k == &a[3] + || l != 10.0 || &l == &__real__ b + || m != 18.0 || &m == &__imag__ b + || n != 15.0 || &n != &__real__ b + || o != 12.0 || &o != &__imag__ b + || p != 25 || &p != &__real__ c + || q != 27 || &q != &__imag__ c + || r != 29 || &r == &__real__ c + || s != 31 || &s == &__imag__ c + || a[0] != 11 || a[1] != 13 || a[2] != 15 || a[3] != 17 + || b != 15.0 + 12.0i + || c != 25 + 27i) + __builtin_abort (); +} diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp3.C b/gcc/testsuite/g++.dg/cpp1z/decomp3.C new file mode 100644 index 00000000000..a739d3ace37 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp3.C @@ -0,0 +1,66 @@ +// { dg-do compile { target c++11 } } +// { dg-options "" } + +struct A { int a, b; float c; }; +A &bar (); +struct B { int d; }; +B baz (); + +void +test (A &b, B c) +{ + int && [ d ] = c; // { dg-error "decomposition declaration cannot be declared with type 'int'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + char & [ e, f, ff ] { b }; // { dg-error "decomposition declaration cannot be declared with type 'char'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto&[g,h,i]=b; // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } } + decltype (auto) [ j ] = c; // { dg-error "decomposition declaration cannot be declared with type 'decltype.auto.'" "" { target c++14 } } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + // { dg-error "expected primary-expression before 'decltype'" "" { target c++11_down } .-2 } + auto & & && & [ m, n, o ] = b; // { dg-error "multiple ref-qualifiers" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + constexpr auto [ p ] = c; // { dg-error "decomposition declaration cannot be declared 'constexpr'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + friend auto [ q ] = c; // { dg-error "'friend' used outside of class" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + typedef auto [ r ] = c; // { dg-error "decomposition declaration cannot be declared 'typedef'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + inline auto [ s ] = c; // { dg-error "decomposition declaration cannot be declared 'inline'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + __restrict auto [ t ] = c; // { dg-error "invalid use of 'restrict'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + long long auto [ u ] = c; // { dg-error "'long long' invalid for 'decomposition'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + virtual auto [ v ] = c; // { dg-error "'virtual' outside class declaration" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + explicit auto [ w ] = c; // { dg-error "'explicit' outside class declaration" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + static auto [ x ] = c; // { dg-error "decomposition declaration cannot be declared 'static'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + extern auto [ y ] { c }; // { dg-error "decomposition declaration cannot be declared 'extern'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } +} + +void +test2 (auto & [ p ] = bar ()) // { dg-error "'p' was not declared in this scope" } +{ +} + +int arr[4]; + +void +test3 (A &b, B c) +{ + auto [ d, e, f ] = arr; // { dg-error "only 3 names provided while 'int .4.' decomposes into 4 elements" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto & [ g, h, i, j, k ] = arr; // { dg-error "5 names provided while 'int .4.' decomposes into 4 elements" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto [ l, m ] = b; // { dg-error "only 2 names provided while 'A' decomposes into 3 elements" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto & [ n, o, p, q ] = b; // { dg-error "4 names provided while 'A' decomposes into 3 elements" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto [] { c }; // { dg-error "empty decomposition declaration" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto [ r, s ] = c; // { dg-error "2 names provided while 'B' decomposes into 1 elements" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } +} diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp4.C b/gcc/testsuite/g++.dg/cpp1z/decomp4.C new file mode 100644 index 00000000000..95a02ec27df --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp4.C @@ -0,0 +1,32 @@ +// { dg-do compile { target c++11 } } +// { dg-options "" } + +struct A { int a; struct { int b; }; }; +struct B { int a; union { int c; long d; }; }; +struct C { int a; private: int b; }; +struct D { int a; private: static int b; }; +struct E { protected: int a; }; +struct F { int a; }; +struct G : public F { int b; }; +struct H { int b; }; +struct I : public F, H {}; + +void +test (A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i) +{ + auto [ j ] = a; // { dg-error "cannot decompose class type 'A' because it has an anonymous struct member" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto [ k ] { b }; // { dg-error "cannot decompose class type 'B' because it has an anonymous union member" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto [ l ] = c; // { dg-error "cannot decompose non-public member 'C::b' of 'C'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto [ m ] = d; // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } } + auto [ n ] { e }; // { dg-error "cannot decompose non-public member 'E::a' of 'E'" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto [ o ] { f }; // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } } + auto & [ p ] { g }; // { dg-error "cannot decompose class type 'G': both it and its base class 'F' have non-static data members" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } + auto [ q ] { h }; // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } } + auto [ r ] { i }; // { dg-error "cannot decompose class type 'I': its base classes 'F' and 'H' have non-static data members" } + // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } +} diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp5.C b/gcc/testsuite/g++.dg/cpp1z/decomp5.C new file mode 100644 index 00000000000..86b2c22f37a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp5.C @@ -0,0 +1,40 @@ +// { dg-do run { target c++11 } } +// { dg-options "" } + +struct A { int i; long long j; } a[64]; + +int +main () +{ + int i = 0; + for (auto &x : a) + { + x.i = i; + x.j = 2 * i++; + } + for (auto & [ x, y ] : a) // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + { + x += 2; + y += 3; + } + i = 0; + for (const auto [ u, v ] : a) // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + { + if (u != i + 2 || v != 2 * i++ + 3) + __builtin_abort (); + } + i = 0; + for (auto [ x, y ] : a) // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + { + x += 4; + y += 5; + if (x != i + 6 || y != 2 * i++ + 8) + __builtin_abort (); + } + i = 0; + for (const auto x : a) + { + if (x.i != i + 2 || x.j != 2 * i++ + 3) + __builtin_abort (); + } +} diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp6.C b/gcc/testsuite/g++.dg/cpp1z/decomp6.C new file mode 100644 index 00000000000..ed6fce49ec5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp6.C @@ -0,0 +1,92 @@ +// { dg-do run { target c++11 } } +// { dg-options "" } + +int ccnt, dcnt, cccnt, tccnt; + +struct A +{ + A () : a (6) { ccnt++; } + ~A () { dcnt++; } + explicit A (const A &x) : a (x.a) { cccnt++; } + template <typename T> + A (const T &x) : a (x.a) { tccnt++; } + int a; +}; + +int +main () +{ + if (ccnt || dcnt || cccnt || tccnt) + __builtin_abort (); + { + A a[6]; + if (ccnt != 6 || dcnt || cccnt || tccnt) + __builtin_abort (); + { + auto [b,c,d,e,f,g] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + if (ccnt != 6 || dcnt || cccnt || tccnt != 6) + __builtin_abort (); + b.a++; + c.a += 2; + f.a += 3; + if (b.a != 7 || c.a != 8 || d.a != 6 || e.a != 6 || f.a != 9 || g.a != 6) + __builtin_abort (); + if (&b == &a[0] || &c == &a[1] || &d == &a[2] || &e == &a[3] || &f == &a[4] || &g == &a[5]) + __builtin_abort (); + { + auto&[ h, i, j, k, l, m ] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + if (ccnt != 6 || dcnt || cccnt || tccnt != 6) + __builtin_abort (); + j.a += 4; + k.a += 5; + m.a += 6; + if (a[0].a != 6 || a[1].a != 6 || a[2].a != 10 || a[3].a != 11 || a[4].a != 6 || a[5].a != 12) + __builtin_abort (); + if (&h != &a[0] || &i != &a[1] || &j != &a[2] || &k != &a[3] || &l != &a[4] || &m != &a[5]) + __builtin_abort (); + } + if (ccnt != 6 || dcnt || cccnt || tccnt != 6) + __builtin_abort (); + } + if (ccnt != 6 || dcnt != 6 || cccnt || tccnt != 6) + __builtin_abort (); + } + if (ccnt != 6 || dcnt != 12 || cccnt || tccnt != 6) + __builtin_abort (); + + { + A a[6]; + if (ccnt != 12 || dcnt != 12 || cccnt || tccnt != 6) + __builtin_abort (); + { + auto [b,c,d,e,f,g] { a }; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + if (ccnt != 12 || dcnt != 12 || cccnt != 6 || tccnt != 6) + __builtin_abort (); + b.a++; + c.a += 2; + f.a += 3; + if (b.a != 7 || c.a != 8 || d.a != 6 || e.a != 6 || f.a != 9 || g.a != 6) + __builtin_abort (); + if (&b == &a[0] || &c == &a[1] || &d == &a[2] || &e == &a[3] || &f == &a[4] || &g == &a[5]) + __builtin_abort (); + { + auto&[ h, i, j, k, l, m ] {a}; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + if (ccnt != 12 || dcnt != 12 || cccnt != 6 || tccnt != 6) + __builtin_abort (); + j.a += 4; + k.a += 5; + m.a += 6; + if (a[0].a != 6 || a[1].a != 6 || a[2].a != 10 || a[3].a != 11 || a[4].a != 6 || a[5].a != 12) + __builtin_abort (); + if (&h != &a[0] || &i != &a[1] || &j != &a[2] || &k != &a[3] || &l != &a[4] || &m != &a[5]) + __builtin_abort (); + } + if (ccnt != 12 || dcnt != 12 || cccnt != 6 || tccnt != 6) + __builtin_abort (); + } + if (ccnt != 12 || dcnt != 18 || cccnt != 6 || tccnt != 6) + __builtin_abort (); + } + if (ccnt != 12 || dcnt != 24 || cccnt != 6 || tccnt != 6) + __builtin_abort (); +} diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp7.C b/gcc/testsuite/g++.dg/cpp1z/decomp7.C new file mode 100644 index 00000000000..d366adecc4c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp7.C @@ -0,0 +1,60 @@ +// { dg-do run { target c++11 } } +// { dg-options "" } + +int a[2] = { 1, 2 }; +int b[2] = { 4, 5 }; +struct S { int a; signed char b; float c; } sa = { 6, 7, 8.0f }; +S sb = { 9, 10, 11.0f }; + +template <typename T, typename U> +void +foo (T &x, U &y) +{ + auto & [ c, d ] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto [ e, f ] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto [ g, h, i ] = sa; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto & [ j, k, l ] = sa; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto & [ m, n ] = x; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto [ o, p ] = x; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto [ q, r, s ] = y; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + auto & [ t, u, v ] = y; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + c += 1; + e += 2; + g += 3; + j += 4; + m += 5; + o += 6; + q += 7; + t += 8; + if (c != 2 || &c != &a[0] + || d != 2 || &d != &a[1] + || e != 3 || &e == &a[0] + || f != 2 || &f == &a[1] + || g != 9 || &g == &sa.a + || h != 7 || &h == &sa.b + || i != 8.0f || &i == &sa.c + || j != 10 || &j != &sa.a + || k != 7 || &k != &sa.b + || l != 8.0f || &l != &sa.c + || m != 9 || &m != &b[0] + || n != 5 || &n != &b[1] + || o != 10 || &o == &b[0] + || p != 5 || &p == &b[1] + || q != 16 || &q == &sb.a + || r != 10 || &r == &sb.b + || s != 11.0f || &s == &sb.c + || t != 17 || &t != &sb.a + || u != 10 || &u != &sb.b + || v != 11.0f || &v != &sb.c + || a[0] != 2 || a[1] != 2 + || sa.a != 10 || sa.b != 7 || sa.c != 8.0f + || b[0] != 9 || b[1] != 5 + || sb.a != 17 || sb.b != 10 || sb.c != 11.0f) + __builtin_abort (); +} + +int +main () +{ + foo (b, sb); +} diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp8.C b/gcc/testsuite/g++.dg/cpp1z/decomp8.C new file mode 100644 index 00000000000..9e1ea5d5da1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp8.C @@ -0,0 +1,88 @@ +// { dg-do run { target c++11 } } +// { dg-options "" } + +struct A { int i; long long j; } a[64]; +A b[32]; + +template <typename T> +void +foo (T &b) +{ + int i = 0; + for (auto &x : a) + { + x.i = i; + x.j = 2 * i++; + } + for (auto & [ x, y ] : a) // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + { + x += 2; + y += 3; + } + i = 0; + for (const auto [ u, v ] : a) // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + { + if (u != i + 2 || v != 2 * i++ + 3) + __builtin_abort (); + } + i = 0; + for (auto [ x, y ] : a) // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + { + x += 4; + y += 5; + if (x != i + 6 || y != 2 * i++ + 8) + __builtin_abort (); + } + i = 0; + for (const auto x : a) + { + if (x.i != i + 2 || x.j != 2 * i++ + 3) + __builtin_abort (); + } + i = 0; + for (auto &x : b) + { + x.i = i; + x.j = 2 * i++; + } + for (auto & [ x, y ] : b) // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + { + x -= 2; + y -= 3; + } + i = 0; + for (const auto [ u, v ] : b) // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + { + if (u != i - 2 || v != 2 * i++ - 3) + __builtin_abort (); + } + i = 0; + for (auto [ x, y ] : b) // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + { + x -= 4; + y -= 5; + if (x != i - 6 || y != 2 * i++ - 8) + __builtin_abort (); + } + i = 0; + for (const auto x : b) + { + if (x.i != i - 2 || x.j != 2 * i++ - 3) + __builtin_abort (); + } +} + +int +main () +{ + foo (b); + for (int i = 0; i < 64; i++) + { + if (a[i].i != i + 2 || a[i].j != 2 * i + 3) + __builtin_abort (); + if (i >= 32) + continue; + if (b[i].i != i - 2 || b[i].j != 2 * i - 3) + __builtin_abort (); + } +} diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp9.C b/gcc/testsuite/g++.dg/cpp1z/decomp9.C new file mode 100644 index 00000000000..f7c6f56b8d5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp9.C @@ -0,0 +1,47 @@ +// { dg-do run } +// { dg-options -std=c++1z } + +#define assert(X) do { if (!(X)) __builtin_abort(); } while (0) + +namespace std { + template<typename T> struct tuple_size; + template<int, typename> struct tuple_element; +} + +struct A { + int i; + template <int I> int& get() { return i; } +}; + +template<> struct std::tuple_size<A> { static const int value = 2; }; +template<int I> struct std::tuple_element<I,A> { using type = int; }; + +struct B { + int i; +}; +template <int I> int& get(B&& b) { return b.i; } +template <int I> int& get(B& b) { return b.i; } + +template<> struct std::tuple_size<B> { static const int value = 2; }; +template<int I> struct std::tuple_element<I,B> { using type = int; }; + +int main() +{ + { + A a = { 42 }; + auto& [ x, y ] = a; + assert (&x == &y && &x == &a.i && x == 42); + + auto [ x2, y2 ] = a; + assert (&x2 == &y2 && &x2 != &a.i && x2 == 42); + } + + { + B b = { 42 }; + auto& [ x, y ] = b; + assert (&x == &y && &x == &b.i && x == 42); + + auto [ x2, y2 ] = b; + assert (&x2 == &y2 && &x2 != &b.i && x2 == 42); + } +} diff --git a/gcc/testsuite/g++.dg/parse/parser-pr14875-2.C b/gcc/testsuite/g++.dg/parse/parser-pr14875-2.C index 3510aac908f..d2e538236bd 100644 --- a/gcc/testsuite/g++.dg/parse/parser-pr14875-2.C +++ b/gcc/testsuite/g++.dg/parse/parser-pr14875-2.C @@ -15,7 +15,7 @@ CHECK (xor_eq); // { dg-error "before .xor_eq. token" } #undef CHECK #define CHECK(x) int x - CHECK (<:); // { dg-error "before .<:. token" } + CHECK (<:); // { dg-error "" } CHECK (:>); // { dg-error "before .:>. token" } #undef CHECK #define CHECK(x) x diff --git a/gcc/testsuite/g++.dg/parse/pr72774.C b/gcc/testsuite/g++.dg/parse/pr72774.C new file mode 100644 index 00000000000..487a1a377a3 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/pr72774.C @@ -0,0 +1,10 @@ +// PR c++/72774 +// { dg-do compile } + +void baz (); +namespace A { void foo (); } +void bar () +{ + using A::foo; + 0 ? static_cast<foo> (0) : baz; // { dg-error "does not name a type" } +} diff --git a/gcc/testsuite/g++.dg/pr78112.C b/gcc/testsuite/g++.dg/pr78112.C index 95d9e59fb64..986171dab52 100644 --- a/gcc/testsuite/g++.dg/pr78112.C +++ b/gcc/testsuite/g++.dg/pr78112.C @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-g -dA -std=gnu++11" } */ -/* { dg-final { scan-assembler-times DW_AT_inline 6 } } */ -/* { dg-final { scan-assembler-times DW_AT_object_pointer 37 } } */ +/* { dg-final { scan-assembler-times DW_AT_inline 6 { xfail *-*-aix* } } } */ +/* { dg-final { scan-assembler-times DW_AT_object_pointer 37 { xfail *-*-aix* } } } */ namespace std { template <typename _Tp> struct integral_constant diff --git a/gcc/testsuite/g++.dg/template/crash7.C b/gcc/testsuite/g++.dg/template/crash7.C index 5bd275e3255..691628e7878 100644 --- a/gcc/testsuite/g++.dg/template/crash7.C +++ b/gcc/testsuite/g++.dg/template/crash7.C @@ -7,7 +7,7 @@ template <typename> struct A { - template <typename> A(typename A::X) {} // { dg-error "no type" } + template <typename> A(typename A::X) {} // { dg-error "incomplete" } }; // We currently don't give the "no match" error because we don't add the diff --git a/gcc/testsuite/g++.dg/template/error56.C b/gcc/testsuite/g++.dg/template/error56.C new file mode 100644 index 00000000000..3eda04c3225 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/error56.C @@ -0,0 +1,12 @@ +// Test that the error message mentions the template arguments. + +struct A +{ + template <class T> void f(T); + void f(); +}; + +int main() +{ + A().f<1>(); // { dg-error "f<1>" } +} diff --git a/gcc/testsuite/g++.dg/template/spec17.C b/gcc/testsuite/g++.dg/template/spec17.C index 23755768423..91c5d56fc47 100644 --- a/gcc/testsuite/g++.dg/template/spec17.C +++ b/gcc/testsuite/g++.dg/template/spec17.C @@ -1,7 +1,7 @@ // PR c++/16224 namespace io { - template <typename> int foo(); // { dg-error "" } + template <typename> int foo(); } using namespace io; diff --git a/gcc/testsuite/g++.dg/template/spec25.C b/gcc/testsuite/g++.dg/template/spec25.C index 385d19ada0c..d6f0f08e280 100644 --- a/gcc/testsuite/g++.dg/template/spec25.C +++ b/gcc/testsuite/g++.dg/template/spec25.C @@ -1,10 +1,10 @@ namespace N { template <typename T> struct S { - void f() {} // { dg-error "definition" } + void f() {} }; } namespace K { - template <> void N::S<char>::f() {} // { dg-error "different namespace" } + template <> void N::S<char>::f() {} // { dg-error "namespace" } } diff --git a/gcc/testsuite/g++.dg/template/spec36.C b/gcc/testsuite/g++.dg/template/spec36.C index 7e8dc5241d9..5807fc516df 100644 --- a/gcc/testsuite/g++.dg/template/spec36.C +++ b/gcc/testsuite/g++.dg/template/spec36.C @@ -8,9 +8,9 @@ struct basic_string namespace MyNS { class MyClass { template <typename T> - T test() { } /* { dg-error "from definition" } */ + T test() { } /* { dg-message "from definition" "" { target c++98_only } } */ }; } template <> -basic_string MyNS::MyClass::test() /* { dg-error "specialization of" } */ +basic_string MyNS::MyClass::test() /* { dg-error "specialization of" "" { target c++98_only } }*/ { return 1; } diff --git a/gcc/testsuite/g++.dg/torture/pr78268.C b/gcc/testsuite/g++.dg/torture/pr78268.C new file mode 100644 index 00000000000..ef4547c1159 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr78268.C @@ -0,0 +1,25 @@ +// { dg-do compile } +typedef enum {} nsresult; + +struct A { + virtual nsresult m_fn1(bool); +}; + +struct B { + A *operator[](int); +}; + +struct C { + nsresult m_fn2(bool); + bool m_fn3(bool); + B mDataSources; +}; +nsresult C::m_fn2(bool p1) +{ + m_fn3(!p1); +} + +bool C::m_fn3(bool p1) +{ + mDataSources[0]->m_fn1(p1); +} diff --git a/gcc/testsuite/g++.dg/warn/forward-inner.C b/gcc/testsuite/g++.dg/warn/forward-inner.C index dae99486a91..5336d4ed946 100644 --- a/gcc/testsuite/g++.dg/warn/forward-inner.C +++ b/gcc/testsuite/g++.dg/warn/forward-inner.C @@ -3,13 +3,13 @@ // Verify warnings for and within classes, and by extension, struct and union. class C1; -class C1::C2; // { dg-error "does not name a type" } +class C1::C2; // { dg-error "incomplete" } class C1::C2::C3; // { dg-error "has not been declared" } class C1 { public: class C2; - class C2::C3; // { dg-error "does not name a type" } + class C2::C3; // { dg-error "incomplete" } class C2 { public: class C3; diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template13.C b/gcc/testsuite/g++.old-deja/g++.ns/template13.C index a9559c7153b..e8e5304dae0 100644 --- a/gcc/testsuite/g++.old-deja/g++.ns/template13.C +++ b/gcc/testsuite/g++.old-deja/g++.ns/template13.C @@ -4,7 +4,7 @@ namespace bar { // trick it to provide some prior declaration template<class T> - void foo(); // { dg-error "definition" } + void foo(); template<class T>class X; // { dg-message "note: previous declaration" } } @@ -15,7 +15,7 @@ bar::foo(T const &a) // { dg-error "" "" { xfail *-*-* } } not declared in b return a; } -template<> void bar::foo<int>() // { dg-error "different namespace" } +template<> void bar::foo<int>() // { dg-error "different namespace" "" { target c++98_only } } { } diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl5.C b/gcc/testsuite/g++.old-deja/g++.other/decl5.C index 2a7a5f2560e..aa2acf8d142 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/decl5.C +++ b/gcc/testsuite/g++.old-deja/g++.other/decl5.C @@ -19,7 +19,7 @@ struct A { struct Z; expand me; // { dg-error "'expand' does not name a type" } void foo(struct A::e); - void foo(struct A::z); // { dg-error "does not name a type" } + void foo(struct A::z); // { dg-error "incomplete" } }; struct Q; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit73.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit73.C index 1d83e346828..f8ceaf790c4 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit73.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit73.C @@ -7,7 +7,7 @@ // the template namespace N { - template <class T> class foo; // { dg-error "" } referenced below + template <class T> class foo; } using namespace N; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lookup10.C b/gcc/testsuite/g++.old-deja/g++.pt/lookup10.C index 1c04250fc3c..9d2add8f627 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/lookup10.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/lookup10.C @@ -13,8 +13,8 @@ namespace Outer { namespace Core = Core_Real; namespace Core_Real { - template<class T> void Foo (T *) {} // { dg-error "definition" } + template<class T> void Foo (T *) {} } - template<> void Core::Foo<> (Render_Real::Type *) {} // { dg-error "" } + template<> void Core::Foo<> (Render_Real::Type *) {} // { dg-error "" "" { target c++98_only } } } diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-1.c b/gcc/testsuite/gcc.dg/format/gcc_diag-1.c index 953c944b4e8..f4922cd4966 100644 --- a/gcc/testsuite/gcc.dg/format/gcc_diag-1.c +++ b/gcc/testsuite/gcc.dg/format/gcc_diag-1.c @@ -32,7 +32,7 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p, ullong ull, unsigned int *un, const int *cn, signed char *ss, unsigned char *us, const signed char *css, unsigned int u1, unsigned int u2, location_t *loc, tree t1, union tree_node *t2, - tree *t3, tree t4[]) + tree *t3, tree t4[], int *v, unsigned v_len) { /* Acceptable C90 specifiers, flags and modifiers. */ diag ("%%"); @@ -90,6 +90,10 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p, cdiag ("%v%qv%#v", i, i, i); cxxdiag ("%v%qv%#v", i, i, i); + tdiag ("%Z", v, v_len); + cdiag ("%Z", v, v_len); + cxxdiag ("%Z", v, v_len); + /* Bad stuff with extensions. */ diag ("%m", i); /* { dg-warning "format" "extra arg" } */ tdiag ("%m", i); /* { dg-warning "format" "extra arg" } */ @@ -133,6 +137,9 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p, cdiag ("%v", t1); /* { dg-warning "format" "wrong arg" } */ cxxdiag ("%v", t1); /* { dg-warning "format" "wrong arg" } */ + tdiag ("%Z"); /* { dg-warning "format" "missing arg" } */ + tdiag ("%Z", t1); /* { dg-warning "format" "wrong arg" } */ + /* Standard specifiers not accepted in the diagnostic framework. */ diag ("%X\n", u); /* { dg-warning "format" "HEX" } */ diag ("%f\n", d); /* { dg-warning "format" "float" } */ diff --git a/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-1.c b/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-1.c index e0c2600b400..f7afb346d7f 100644 --- a/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-1.c +++ b/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-1.c @@ -1,4 +1,4 @@ -/* { dg-options "-O2 -fprofile-generate -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fprofile-generate -fprofile-update=single -fdump-tree-optimized" } */ __attribute__ ((no_profile_instrument_function)) int foo() diff --git a/gcc/testsuite/gcc.dg/torture/pr78312.c b/gcc/testsuite/gcc.dg/torture/pr78312.c new file mode 100644 index 00000000000..470e5b2ea0a --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr78312.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ + +typedef unsigned short u16; + +static u16 a; + +u16 __attribute__ ((noinline, noclone)) +foo (int p1) +{ + a = -(p1 > 0); + a *= 0 != a; + a *= (unsigned)a; + return a; +} + +int +main () +{ + u16 x = foo (1); + if (x != 1) + __builtin_abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/isolate-6.c b/gcc/testsuite/gcc.dg/tree-ssa/isolate-6.c new file mode 100644 index 00000000000..ec7c57ac56c --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/isolate-6.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-isolate-paths" } */ + +int x, y; + +static inline int +z () +{ + return x ? y : 0; +} + +int +lower_for (int j) +{ + return j % z (); +} + +/* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "isolate-paths"} } */ + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/isolate-7.c b/gcc/testsuite/gcc.dg/tree-ssa/isolate-7.c new file mode 100644 index 00000000000..e63d5a032c1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/isolate-7.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-isolate-paths" } */ + +extern int oof (); +extern int x; +_Bool +gcd_of_steps_may_divide_p () +{ + long cd = 0, val; + if (x) + cd = oof (); + return val % cd == 0; +} +/* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "isolate-paths"} } */ + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-11.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-11.c index e4c11aab195..4c3898278b1 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-11.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fprofile-arcs -fdump-tree-lim2-details" } */ +/* { dg-options "-O -fprofile-arcs -fprofile-update=single -fdump-tree-lim2-details" } */ /* { dg-require-profiling "-fprofile-generate" } */ struct thread_param diff --git a/gcc/testsuite/gcc.dg/ubsan/pr78248.c b/gcc/testsuite/gcc.dg/ubsan/pr78248.c new file mode 100644 index 00000000000..3483c774735 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ubsan/pr78248.c @@ -0,0 +1,31 @@ +/* PR rtl-optimization/78232 */ +/* PR rtl-optimization/78248 */ +/* { dg-do run } */ +/* { dg-options "-fsanitize=undefined" } */ + +static struct S +{ + int f0:15; +} a; + +int b[1], c = 2, d, e, f, g; + +int main () +{ + struct S h = { -2 }; + for (; e < 640; e++) + for (; f < 1; f++) + { + if (c < 2) + { + d = b[e]; + h = a; + } + g = c; + c = 1; + if (!h.f0) + break; + c = g; + } + return 0; +} diff --git a/gcc/testsuite/gcc.dg/vect/vect-cond-2.c b/gcc/testsuite/gcc.dg/vect/vect-cond-2.c index d7da8034f0c..646eac12a38 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-cond-2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-cond-2.c @@ -39,6 +39,6 @@ int main (void) 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_max_reduc } } } } */ diff --git a/gcc/testsuite/gcc.target/avr/torture/tiny-absdata-2.c b/gcc/testsuite/gcc.target/avr/torture/tiny-absdata-2.c new file mode 100644 index 00000000000..1d98a6b57b7 --- /dev/null +++ b/gcc/testsuite/gcc.target/avr/torture/tiny-absdata-2.c @@ -0,0 +1,85 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target avr_tiny } */ +/* { dg-options "-mabsdata" } */ + +typedef struct +{ + char a, b, c; +} abc_t; + +extern char varA; +extern char varB; +extern const char varC __attribute__((progmem)); + +extern int arrayA[]; +extern int arrayB[]; +extern char arrayC[] __attribute__((address(0x80))); +extern char arrayD[] __attribute__((address(0xc0))); + +extern abc_t abc; + +char get_1 (void) +{ + return varA; +} + +int get_2 (void) +{ + return arrayA[3]; +} + +char get_3 (void) +{ + return abc.a + abc.b + abc.c; +} + +char get_4 (void) +{ + return varC; +} + +void put_1 (char b) +{ + varB = b; +} + +void put_2 (int b) +{ + arrayB[3] = b; +} + +void put_3 (void) +{ + abc.a = abc.b = abc.c = 0; +} + +void put_4 (void) +{ + arrayC[0] = arrayC[1] = arrayC[2] = 0; +} + +void put_5 (void) +{ + arrayD[0] = 0; +} + +/* { dg-final { scan-assembler "lds r\[0-9\]+,varA" } } */ +/* { dg-final { scan-assembler "lds r\[0-9\]+,arrayA\\+6" } } */ +/* { dg-final { scan-assembler "lds r\[0-9\]+,arrayA\\+6\\+1" } } */ +/* { dg-final { scan-assembler "lds r\[0-9\]+,abc" } } */ +/* { dg-final { scan-assembler "lds r\[0-9\]+,abc\\+1" } } */ +/* { dg-final { scan-assembler "lds r\[0-9\]+,abc\\+2" } } */ + +/* { dg-final { scan-assembler "sts varB," } } */ +/* { dg-final { scan-assembler "sts arrayB\\+6," } } */ +/* { dg-final { scan-assembler "sts arrayB\\+6\\+1," } } */ +/* { dg-final { scan-assembler "sts arrayC," } } */ +/* { dg-final { scan-assembler "sts arrayC\\+1," } } */ +/* { dg-final { scan-assembler "sts arrayC\\+2," } } */ + +/* { dg-final { scan-assembler "sts abc," } } */ +/* { dg-final { scan-assembler "sts abc\\+1," } } */ +/* { dg-final { scan-assembler "sts abc\\+2," } } */ + +/* { dg-final { scan-assembler-not "lds r\[0-9\]+,varC" } } */ +/* { dg-final { scan-assembler-not "sts arrayD," } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr78310.c b/gcc/testsuite/gcc.target/i386/pr78310.c new file mode 100644 index 00000000000..dfeae4c827c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr78310.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O -mbmi2" } */ + +unsigned long long a; +int b; + +int +fn1(int p1) +{ + p1 &= 1; + p1 &= (short)~p1; + b = a; + a = a << p1 | a >> (64 - p1); + return p1 + 1 + a; +} diff --git a/gcc/testsuite/gcc.target/sparc/20161111-1.c b/gcc/testsuite/gcc.target/sparc/20161111-1.c new file mode 100644 index 00000000000..eda8b0a9f12 --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/20161111-1.c @@ -0,0 +1,17 @@ +/* PR rtl-optimization/59461 */ + +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +extern char zeb_test_array[10]; + +unsigned char ee_isdigit2(unsigned int i) +{ + unsigned char c = zeb_test_array[i]; + unsigned char retval; + + retval = ((c>='0') & (c<='9')) ? 1 : 0; + return retval; +} + +/* { dg-final { scan-assembler-not "and\t%" } } */ diff --git a/gcc/testsuite/gfortran.dg/class_57.f90 b/gcc/testsuite/gfortran.dg/class_57.f90 index 7256dfc4d29..8104338672b 100644 --- a/gcc/testsuite/gfortran.dg/class_57.f90 +++ b/gcc/testsuite/gfortran.dg/class_57.f90 @@ -18,7 +18,7 @@ contains function pc(pd) type(p) :: pc class(d), intent(in), target :: pd - pc%cc => pd ! { dg-error "Non-POINTER in pointer association context" } + pc%cc => pd ! { dg-error "is not a member of" } end function end diff --git a/gcc/testsuite/gfortran.dg/class_60.f90 b/gcc/testsuite/gfortran.dg/class_60.f90 new file mode 100644 index 00000000000..f51c48349c3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_60.f90 @@ -0,0 +1,33 @@ +! { dg-do compile } +! +! PR 66366: [OOP] ICE on invalid with non-allocatable CLASS variable +! +! Contributed by Andrew Benson <abensonca@gmail.com> + +module bug + + type :: t1d + contains + procedure :: interpolate => interp + end type t1d + + type :: tff + class(t1d) :: transfer ! { dg-error "must be allocatable or pointer" } + end type tff + +contains + + double precision function interp(self) + implicit none + class(t1d), intent(inout) :: self + return + end function interp + + double precision function fvb(self) + implicit none + class(tff), intent(inout) :: self + fvb=self%transfer%interpolate() ! { dg-error "is not a member of" } + return + end function fvb + +end module bug diff --git a/gcc/testsuite/gfortran.dg/typebound_generic_16.f90 b/gcc/testsuite/gfortran.dg/typebound_generic_16.f90 new file mode 100644 index 00000000000..0043fbb2152 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_generic_16.f90 @@ -0,0 +1,21 @@ +! { dg-do compile } +! +! PR 77501: [F03] ICE in gfc_match_generic, at fortran/decl.c:9429 +! +! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> + +module m1 + type t + contains + generic :: f => g ! { dg-error "must target a specific binding" } + generic :: g => h ! { dg-error "Undefined specific binding" } + end type +end + +module m2 + type t + contains + generic :: f => g ! { dg-error "must target a specific binding" } + generic :: g => f ! { dg-error "Undefined specific binding" } + end type +end diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_34.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_34.f90 new file mode 100644 index 00000000000..bf2b882bb7a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_34.f90 @@ -0,0 +1,26 @@ +! { dg-do compile } +! +! PR 60952: [F03] Problem using "end" as a type bound procedure and contained procedures +! +! Contributed by tlcclt <Thomas.L.Clune@nasa.gov> + +module A_mod + implicit none + + type A + contains + procedure, nopass :: end + end type + +contains + + subroutine swap + contains + subroutine subSwap + end subroutine + end subroutine + + integer function end() + end function + +end module diff --git a/gcc/testsuite/gnat.dg/address_conv.adb b/gcc/testsuite/gnat.dg/address_conv.adb new file mode 100644 index 00000000000..27b3dada9ab --- /dev/null +++ b/gcc/testsuite/gnat.dg/address_conv.adb @@ -0,0 +1,19 @@ +-- { dg-do compile } + +with System.Storage_Elements; use System.Storage_Elements; + +procedure Address_Conv is + + subtype My_Address is System.Address; + + type Rec is record + A : My_Address; + end record; + + Addr : constant My_Address := To_Address (16#FACEFACE#); + + R : constant Rec := (A => Addr); + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/lto21.adb b/gcc/testsuite/gnat.dg/lto21.adb new file mode 100644 index 00000000000..fe6fb2734b5 --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto21.adb @@ -0,0 +1,10 @@ +-- { dg-do run } +-- { dg-options "-O3 -flto" { target lto } } + +with Lto21_Pkg1; +with Lto21_Pkg2; use Lto21_Pkg2; + +procedure Lto21 is +begin + Proc; +end; diff --git a/gcc/testsuite/gnat.dg/lto21_pkg1.ads b/gcc/testsuite/gnat.dg/lto21_pkg1.ads new file mode 100644 index 00000000000..000a568c6c9 --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto21_pkg1.ads @@ -0,0 +1,10 @@ +with Ada.Containers.Vectors; +with Lto21_Pkg2; + +package Lto21_Pkg1 is + + pragma Suppress (Tampering_Check); + + package Vect1 is new Ada.Containers.Vectors (Positive, Natural); + +end Lto21_Pkg1; diff --git a/gcc/testsuite/gnat.dg/lto21_pkg2.adb b/gcc/testsuite/gnat.dg/lto21_pkg2.adb new file mode 100644 index 00000000000..5d38102d8f2 --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto21_pkg2.adb @@ -0,0 +1,30 @@ +with Ada.Containers; use Ada.Containers; +with Ada.Containers.Hashed_Maps; +with Ada.Containers.Vectors; + +package body Lto21_Pkg2 is + + pragma Suppress (Tampering_Check); + + procedure Proc is + + function Hash (Syd : Natural) return Hash_Type is (Hash_Type'Mod (Syd)); + + package Vect2 is new Vectors (Positive, Natural); + + package Maps is + new Hashed_Maps (Natural, Vect2.Vector, Hash, "=", Vect2."="); + + procedure Nested (M : Maps.Map) is + use Maps; + procedure Inner (Position : Cursor) is null; + begin + Iterate (M, Inner'Access); + end; + + M : Maps.Map; + begin + Nested (M); + end; + +end Lto21_Pkg2; diff --git a/gcc/testsuite/gnat.dg/lto21_pkg2.ads b/gcc/testsuite/gnat.dg/lto21_pkg2.ads new file mode 100644 index 00000000000..935b3b71e8a --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto21_pkg2.ads @@ -0,0 +1,5 @@ +package Lto21_Pkg2 is + + procedure Proc; + +end Lto21_Pkg2; diff --git a/gcc/testsuite/gnat.dg/renaming11.adb b/gcc/testsuite/gnat.dg/renaming11.adb new file mode 100644 index 00000000000..c9241c28d82 --- /dev/null +++ b/gcc/testsuite/gnat.dg/renaming11.adb @@ -0,0 +1,12 @@ +-- { dg-do compile } + +package body Renaming11 is + + function F (Arg: Ptr3) return Integer is + V : Ptr1 renames Arg.all.all; + I : Integer renames V.A(1); + begin + return I; + end; + +end Renaming11; diff --git a/gcc/testsuite/gnat.dg/renaming11.ads b/gcc/testsuite/gnat.dg/renaming11.ads new file mode 100644 index 00000000000..d3dda72ede7 --- /dev/null +++ b/gcc/testsuite/gnat.dg/renaming11.ads @@ -0,0 +1,19 @@ +package Renaming11 is + + subtype Index_Type is Integer range 1..10; + + type Arr is array (Index_Type range <>) of Integer; + + type Rec (Min : Index_Type; Max : Index_Type) is record + A : Arr (Min .. Max); + end record; + + type Ptr1 is access Rec; + + type Ptr2 is access Ptr1; + + type Ptr3 is access Ptr2; + + function F (Arg : Ptr3) return Integer; + +end Renaming11; diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c index d18b954a385..a4f9d11b161 100644 --- a/gcc/tree-profile.c +++ b/gcc/tree-profile.c @@ -592,25 +592,26 @@ tree_profiling (void) struct cgraph_node *node; /* Verify whether we can utilize atomic update operations. */ - if (flag_profile_update == PROFILE_UPDATE_ATOMIC) + bool can_support_atomic = false; + unsigned HOST_WIDE_INT gcov_type_size + = tree_to_uhwi (TYPE_SIZE_UNIT (get_gcov_type ())); + if (gcov_type_size == 4) + can_support_atomic + = HAVE_sync_compare_and_swapsi || HAVE_atomic_compare_and_swapsi; + else if (gcov_type_size == 8) + can_support_atomic + = HAVE_sync_compare_and_swapdi || HAVE_atomic_compare_and_swapdi; + + if (flag_profile_update == PROFILE_UPDATE_ATOMIC + && !can_support_atomic) { - bool can_support = false; - unsigned HOST_WIDE_INT gcov_type_size - = tree_to_uhwi (TYPE_SIZE_UNIT (get_gcov_type ())); - if (gcov_type_size == 4) - can_support - = HAVE_sync_compare_and_swapsi || HAVE_atomic_compare_and_swapsi; - else if (gcov_type_size == 8) - can_support - = HAVE_sync_compare_and_swapdi || HAVE_atomic_compare_and_swapdi; - - if (!can_support) - { - warning (0, "target does not support atomic profile update, " - "single mode is selected"); - flag_profile_update = PROFILE_UPDATE_SINGLE; - } + warning (0, "target does not support atomic profile update, " + "single mode is selected"); + flag_profile_update = PROFILE_UPDATE_SINGLE; } + else if (flag_profile_update == PROFILE_UPDATE_PREFER_ATOMIC) + flag_profile_update = can_support_atomic + ? PROFILE_UPDATE_ATOMIC : PROFILE_UPDATE_SINGLE; /* This is a small-ipa pass that gets called only once, from cgraphunit.c:ipa_passes(). */ diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index 372a0be2ffa..778b36377b7 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -236,9 +236,9 @@ dse_optimize_stmt (gimple_stmt_iterator *gsi) if (dump_file && (dump_flags & TDF_DETAILS)) { - fprintf (dump_file, " Deleted dead call '"); + fprintf (dump_file, " Deleted dead call: "); print_gimple_stmt (dump_file, gsi_stmt (*gsi), dump_flags, 0); - fprintf (dump_file, "'\n"); + fprintf (dump_file, "\n"); } tree lhs = gimple_call_lhs (stmt); @@ -292,9 +292,9 @@ dse_optimize_stmt (gimple_stmt_iterator *gsi) if (dump_file && (dump_flags & TDF_DETAILS)) { - fprintf (dump_file, " Deleted dead store '"); + fprintf (dump_file, " Deleted dead store: "); print_gimple_stmt (dump_file, gsi_stmt (*gsi), dump_flags, 0); - fprintf (dump_file, "'\n"); + fprintf (dump_file, "\n"); } /* Then we need to fix the operand of the consuming stmt. */ diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index e3a81f6b026..f682e570f2f 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2016-11-11 Szabolcs Nagy <szabolcs.nagy@arm.com> + + * config.host (i[3456]86-*-musl*, x86_64-*-musl*): Use + i386/t-cpuinfo-static instead of i386/t-cpuinfo. + * config/i386/t-cpuinfo-static: New. + 2016-11-03 Martin Liska <mliska@suse.cz> * libgcov-profiler.c (__gcov_time_profiler): Remove. diff --git a/libgcc/config.host b/libgcc/config.host index 4291cfef5b4..64beb219f31 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1320,7 +1320,14 @@ esac case ${host} in i[34567]86-*-* | x86_64-*-*) - tmake_file="${tmake_file} i386/t-cpuinfo" + case ${host} in + *-musl*) + tmake_file="${tmake_file} i386/t-cpuinfo-static" + ;; + *) + tmake_file="${tmake_file} i386/t-cpuinfo" + ;; + esac ;; esac diff --git a/libgcc/config/i386/t-cpuinfo-static b/libgcc/config/i386/t-cpuinfo-static new file mode 100644 index 00000000000..5617bc14eed --- /dev/null +++ b/libgcc/config/i386/t-cpuinfo-static @@ -0,0 +1,4 @@ +# If the compatibility cpuinfo symbols in shared libgcc_s are not needed +# then they can be added to the static library only. + +LIB2ADD_ST += $(srcdir)/config/i386/cpuinfo.c diff --git a/libgo/configure b/libgo/configure index 7a9df58c216..adabb74baad 100755 --- a/libgo/configure +++ b/libgo/configure @@ -13648,7 +13648,6 @@ case ${host} in GOARCH_FAMILY=ARM GOARCH_CACHELINESIZE=32 GOARCH_PCQUANTUM=4 - GOARCH_INT64ALIGN=4 GOARCH_MINFRAMESIZE=4 ;; i[34567]86-*-* | x86_64-*-*) @@ -13685,7 +13684,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext GOARCH_BIGENDIAN=1 GOARCH_CACHELINESIZE=16 GOARCH_PCQUANTUM=4 - GOARCH_INT64ALIGN=4 + GOARCH_INT64ALIGN=2 ;; mips*-*-*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13747,7 +13746,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext case "$mips_abi" in "o32" | "n32") GOARCH_FAMILY=MIPS - GOARCH_INT64ALIGN=4 GOARCH_MINFRAMESIZE=4 ;; "n64" | "o64") @@ -13778,7 +13776,6 @@ if ac_fn_c_try_compile "$LINENO"; then : GOARCH=ppc GOARCH_FAMILY=PPC GOARCH_BIGENDIAN=1 -GOARCH_INT64ALIGN=4 else @@ -13816,7 +13813,6 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : GOARCH=s390 GOARCH_FAMILY=S390 -GOARCH_INT64ALIGN=4 GOARCH_MINFRAMESIZE=4 else diff --git a/libgo/configure.ac b/libgo/configure.ac index ed2edd3b69c..09add8d136b 100644 --- a/libgo/configure.ac +++ b/libgo/configure.ac @@ -230,7 +230,6 @@ case ${host} in GOARCH_FAMILY=ARM GOARCH_CACHELINESIZE=32 GOARCH_PCQUANTUM=4 - GOARCH_INT64ALIGN=4 GOARCH_MINFRAMESIZE=4 ;; changequote(,)dnl @@ -262,7 +261,7 @@ GOARCH_HUGEPAGESIZE="1 << 21" GOARCH_BIGENDIAN=1 GOARCH_CACHELINESIZE=16 GOARCH_PCQUANTUM=4 - GOARCH_INT64ALIGN=4 + GOARCH_INT64ALIGN=2 ;; mips*-*-*) AC_COMPILE_IFELSE([ @@ -296,7 +295,6 @@ GOARCH_HUGEPAGESIZE="1 << 21" case "$mips_abi" in "o32" | "n32") GOARCH_FAMILY=MIPS - GOARCH_INT64ALIGN=4 GOARCH_MINFRAMESIZE=4 ;; "n64" | "o64") @@ -323,7 +321,6 @@ GOARCH_HUGEPAGESIZE="1 << 21" [GOARCH=ppc GOARCH_FAMILY=PPC GOARCH_BIGENDIAN=1 -GOARCH_INT64ALIGN=4 ], [ GOARCH_FAMILY=PPC64 @@ -347,7 +344,6 @@ GOARCH_BIGENDIAN=1 #endif], [GOARCH=s390 GOARCH_FAMILY=S390 -GOARCH_INT64ALIGN=4 GOARCH_MINFRAMESIZE=4 ], [GOARCH=s390x GOARCH_FAMILY=S390X diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e1a4764afd7..57a7be64b84 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,80 @@ +2016-11-14 Jonathan Wakely <jwakely@redhat.com> + + * include/bits/move.h (addressof(const _Tp&&)): Add deleted overload, + as per LWG 2598. + + * include/std/future (future::share(), future<R&>::share()) + (future<void>::share()): Add noexcept, as per LWG 2556. + +2016-11-13 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/78326 + * include/experimental/memory_resource (memory_resource::_S_max_align): + Change access to protected. + + * doc/xml/manual/status_cxx2017.xml: Update status. + * doc/html/manual/status.html: Regenerate. + * include/bits/shared_ptr.h (shared_ptr(unique_ptr<_Yp, _Del>)): Add + extension constructor to maintain C++14 behaviour. + * include/bits/shared_ptr_base.h (__sp_array_delete): Add new struct. + (__shared_count(_Ptr, false_type), __shared_count(_Ptr, true_type)): + New constructors. + (__sp_compatible_with, __sp_is_constructible): Add specializations + for array support. + (__sp_is_constructible_arr, __sp_is_constructible_arrN): New helpers. + (__shared_ptr_access): New base class for observer member functions. + (__shared_ptr::element_type): Use remove_extent. + (__shared_ptr::_UniqCompatible): Add __sp_compatible_with check. + (__shared_ptr(_Yp*)): Use tag dispatching to call new __shared_count + constructor. + (__shared_ptr(unique_ptr<_Yp, _Del>)): Add extension constructor. + (__shared_ptr::operator*, __shared_ptr::operator->): Remove and + inherit from __shared_ptr_access base class. + (__shared_ptr::__has_esft_base): Return false for array types. + (__weak_ptr::element_type): Use remove_extent. + * include/experimental/bits/shared_ptr.h (__libfund_v1): Remove. + (__shared_ptr<__libfund_v1<_Tp>>): Remove specializations. + (__wak_ptr<__libfund_v1<_Tp>>): Likewise. + (experimental::__sp_compatible_v): Redefine using + __sp_compatible_with. + (experimental::__sp_is_constructible_v): Redefine using + __sp_is_constructible. + (get_deleter, operator<<): Change argument from __shared_ptr to + shared_ptr. + * testsuite/20_util/shared_ptr/cons/array.cc: New test. + * testsuite/20_util/shared_ptr/cons/unique_ptr_array.cc: Adjust for + new behaviour. + * testsuite/20_util/shared_ptr/observers/array.cc: Test observers for + arrays. + * testsuite/20_util/shared_ptr/observers/array_neg.cc: New test. + +2016-11-13 Ville Voutilainen <ville.voutilainen@gmail.com> + + Implement P0403R1, Literal suffixes for basic_string_view. + * include/std/string_view + (operator""sv(const char*, size_t)): New. + (operator""sv(const wchar_t*, size_t)): Likewise. + (operator""sv(const char16_t*, size_t)): Likewise. + (operator""sv(const char32_t*, size_t)): Likewise. + * testsuite/21_strings/basic_string_view/literals/types.cc: New. + * testsuite/21_strings/basic_string_view/literals/values.cc: Likewise. + * testsuite/experimental/string_view/literals/values.cc: Add + tests for literals with embedded NULs. + +2016-11-12 Jonathan Wakely <jwakely@redhat.com> + + * src/filesystem/ops.cc (is_empty): Fix typo in exception message. + + * include/std/future (future_error): Fix public typo to private. + +2016-11-11 Jonathan Wakely <jwakely@redhat.com> + + * include/std/future (future_error): Make existing constructor + private and add constructor from future_errc. + + * include/bits/shared_ptr.h (hash<shared_ptr<T>>): Use element_type. + * include/bits/shared_ptr_base.h (hash<__shared_ptr<T, L>>): Likewise. + 2016-11-10 François Dumont <fdumont@gcc.gnu.org> * src/c++11/debug.cc (format_word): Delete. diff --git a/libstdc++-v3/doc/html/manual/status.html b/libstdc++-v3/doc/html/manual/status.html index 554d519a0a6..08c9ad06dea 100644 --- a/libstdc++-v3/doc/html/manual/status.html +++ b/libstdc++-v3/doc/html/manual/status.html @@ -565,11 +565,11 @@ Feature-testing recommendations for C++</a>. <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html" target="_top"> P0220R1 </a> - </td><td align="center"> 7 </td><td align="left"> <code class="code">__cpp_lib_apply >= 201603</code> </td></tr><tr bgcolor="#C8B0B0"><td align="left"> Library Fundamentals V1 TS Components: <code class="code">shared_ptr<T[]></code> </td><td align="left"> + </td><td align="center"> 7 </td><td align="left"> <code class="code">__cpp_lib_apply >= 201603</code> </td></tr><tr><td align="left"> Library Fundamentals V1 TS Components: <code class="code">shared_ptr<T[]></code> </td><td align="left"> <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html" target="_top"> P0220R1 </a> - </td><td align="center"> No </td><td align="left"> <code class="code">__cpp_lib_shared_ptr_arrays >= 201603</code> </td></tr><tr><td align="left"> Library Fundamentals V1 TS Components: Searchers </td><td align="left"> + </td><td align="center"> 7 </td><td align="left"> <code class="code">__cpp_lib_shared_ptr_arrays >= 201603</code> </td></tr><tr><td align="left"> Library Fundamentals V1 TS Components: Searchers </td><td align="left"> <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html" target="_top"> P0220R1 </a> diff --git a/libstdc++-v3/doc/xml/manual/status_cxx2017.xml b/libstdc++-v3/doc/xml/manual/status_cxx2017.xml index d008bd9eb9b..dbb26c8f867 100644 --- a/libstdc++-v3/doc/xml/manual/status_cxx2017.xml +++ b/libstdc++-v3/doc/xml/manual/status_cxx2017.xml @@ -158,14 +158,13 @@ Feature-testing recommendations for C++</link>. </row> <row> - <?dbhtml bgcolor="#C8B0B0" ?> <entry> Library Fundamentals V1 TS Components: <code>shared_ptr<T[]></code> </entry> <entry> <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html"> P0220R1 </link> </entry> - <entry align="center"> No </entry> + <entry align="center"> 7 </entry> <entry> <code>__cpp_lib_shared_ptr_arrays >= 201603</code> </entry> </row> diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h index a5002fca422..d0aefe76cf0 100644 --- a/libstdc++-v3/include/bits/move.h +++ b/libstdc++-v3/include/bits/move.h @@ -137,6 +137,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION addressof(_Tp& __r) noexcept { return std::__addressof(__r); } + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 2598. addressof works on temporaries + template<typename _Tp> + const _Tp* addressof(const _Tp&&) = delete; + // C++11 version of std::exchange for internal use. template <typename _Tp, typename _Up = _Tp> inline _Tp diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h index 9f7a40c5e1e..cbe4144359e 100644 --- a/libstdc++-v3/include/bits/shared_ptr.h +++ b/libstdc++-v3/include/bits/shared_ptr.h @@ -277,6 +277,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION shared_ptr(unique_ptr<_Yp, _Del>&& __r) : __shared_ptr<_Tp>(std::move(__r)) { } +#if __cplusplus <= 201402L && _GLIBCXX_USE_DEPRECATED + // This non-standard constructor exists to support conversions that + // were possible in C++11 and C++14 but are ill-formed in C++17. + // If an exception is thrown this constructor has no effect. + template<typename _Yp, typename _Del, + _Constructible<unique_ptr<_Yp, _Del>, __sp_array_delete>* = 0> + shared_ptr(unique_ptr<_Yp, _Del>&& __r) + : __shared_ptr<_Tp>(std::move(__r), __sp_array_delete()) { } +#endif + /** * @brief Construct an empty %shared_ptr. * @post use_count() == 0 && get() == nullptr @@ -692,7 +702,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { size_t operator()(const shared_ptr<_Tp>& __s) const noexcept - { return std::hash<_Tp*>()(__s.get()); } + { + return std::hash<typename shared_ptr<_Tp>::element_type*>()(__s.get()); + } }; // @} group pointer_abstractions diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index 1a9e3e901e9..953aa87436e 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -559,6 +559,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Impl _M_impl; }; + // The default deleter for shared_ptr<T[]> and shared_ptr<T[N]>. + struct __sp_array_delete + { + template<typename _Yp> + void operator()(_Yp* __p) const { delete[] __p; } + }; template<_Lock_policy _Lp> class __shared_count @@ -582,6 +588,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } + template<typename _Ptr> + __shared_count(_Ptr __p, /* is_array = */ false_type) + : __shared_count(__p) + { } + + template<typename _Ptr> + __shared_count(_Ptr __p, /* is_array = */ true_type) + : __shared_count(__p, __sp_array_delete{}, allocator<void>()) + { } + template<typename _Ptr, typename _Deleter> __shared_count(_Ptr __p, _Deleter __d) : __shared_count(__p, std::move(__d), allocator<void>()) @@ -848,8 +864,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_pi = nullptr; } - // Helper traits for shared_ptr +#define __cpp_lib_shared_ptr_arrays 201603 + + // Helper traits for shared_ptr of array: + // A pointer type Y* is said to be compatible with a pointer type T* when + // either Y* is convertible to T* or Y is U[N] and T is U cv []. template<typename _Yp_ptr, typename _Tp_ptr> struct __sp_compatible_with : false_type @@ -860,17 +880,161 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : is_convertible<_Yp*, _Tp*>::type { }; + template<typename _Up, size_t _Nm> + struct __sp_compatible_with<_Up(*)[_Nm], _Up(*)[]> + : true_type + { }; + + template<typename _Up, size_t _Nm> + struct __sp_compatible_with<_Up(*)[_Nm], const _Up(*)[]> + : true_type + { }; + + template<typename _Up, size_t _Nm> + struct __sp_compatible_with<_Up(*)[_Nm], volatile _Up(*)[]> + : true_type + { }; + + template<typename _Up, size_t _Nm> + struct __sp_compatible_with<_Up(*)[_Nm], const volatile _Up(*)[]> + : true_type + { }; + + // Test conversion from Y(*)[N] to U(*)[N] without forming invalid type Y[N]. + template<typename _Up, size_t _Nm, typename _Yp, typename = void> + struct __sp_is_constructible_arrN + : false_type + { }; + + template<typename _Up, size_t _Nm, typename _Yp> + struct __sp_is_constructible_arrN<_Up, _Nm, _Yp, __void_t<_Yp[_Nm]>> + : is_convertible<_Yp(*)[_Nm], _Up(*)[_Nm]>::type + { }; + + // Test conversion from Y(*)[] to U(*)[] without forming invalid type Y[]. + template<typename _Up, typename _Yp, typename = void> + struct __sp_is_constructible_arr + : false_type + { }; + + template<typename _Up, typename _Yp> + struct __sp_is_constructible_arr<_Up, _Yp, __void_t<_Yp[]>> + : is_convertible<_Yp(*)[], _Up(*)[]>::type + { }; + + // Trait to check if shared_ptr<T> can be constructed from Y*. + template<typename _Tp, typename _Yp> + struct __sp_is_constructible; + + // When T is U[N], Y(*)[N] shall be convertible to T*; + template<typename _Up, size_t _Nm, typename _Yp> + struct __sp_is_constructible<_Up[_Nm], _Yp> + : __sp_is_constructible_arrN<_Up, _Nm, _Yp>::type + { }; + + // when T is U[], Y(*)[] shall be convertible to T*; + template<typename _Up, typename _Yp> + struct __sp_is_constructible<_Up[], _Yp> + : __sp_is_constructible_arr<_Up, _Yp>::type + { }; + + // otherwise, Y* shall be convertible to T*. + template<typename _Tp, typename _Yp> + struct __sp_is_constructible + : is_convertible<_Yp*, _Tp*>::type + { }; + + + // Define operator* and operator-> for shared_ptr<T>. + template<typename _Tp, _Lock_policy _Lp, + bool = is_array<_Tp>::value, bool = is_void<_Tp>::value> + class __shared_ptr_access + { + public: + using element_type = _Tp; + + element_type& + operator*() const noexcept + { + __glibcxx_assert(_M_get() != nullptr); + return *_M_get(); + } + + element_type* + operator->() const noexcept + { + _GLIBCXX_DEBUG_PEDASSERT(_M_get() != nullptr); + return _M_get(); + } + + private: + element_type* + _M_get() const noexcept + { return static_cast<const __shared_ptr<_Tp, _Lp>*>(this)->get(); } + }; + + // Define operator-> for shared_ptr<cv void>. template<typename _Tp, _Lock_policy _Lp> - class __shared_ptr + class __shared_ptr_access<_Tp, _Lp, false, true> { public: using element_type = _Tp; + element_type* + operator->() const noexcept + { + _GLIBCXX_DEBUG_PEDASSERT(_M_get() != nullptr); + return static_cast<const __shared_ptr<_Tp, _Lp>*>(this)->get(); + } + }; + + // Define operator[] for shared_ptr<T[]> and shared_ptr<T[N]>. + template<typename _Tp, _Lock_policy _Lp> + class __shared_ptr_access<_Tp, _Lp, true, false> + { + public: + using element_type = typename remove_extent<_Tp>::type; + +#if __cplusplus <= 201402L + [[__deprecated__("shared_ptr<T[]>::operator* is absent from C++17")]] + element_type& + operator*() const noexcept + { + __glibcxx_assert(_M_ptr != nullptr); + return *_M_get(); + } + + [[__deprecated__("shared_ptr<T[]>::operator-> is absent from C++17")]] + element_type* + operator->() const noexcept + { + _GLIBCXX_DEBUG_PEDASSERT(_M_get() != nullptr); + return _M_get(); + } +#endif + + element_type& + operator[](ptrdiff_t __i) const + { + __glibcxx_assert(_M_get() != nullptr); + __glibcxx_assert(!extent<_Tp>::value || __i < extent<_Tp>::value); + return _M_get()[__i]; + } + private: - // Trait to check if shared_ptr<T> can be constructed from Y*. - template<typename _Tp1, typename _Yp> - using __sp_is_constructible = is_convertible<_Yp*, _Tp1*>; + element_type* + _M_get() const noexcept + { return static_cast<const __shared_ptr<_Tp, _Lp>*>(this)->get(); } + }; + + template<typename _Tp, _Lock_policy _Lp> + class __shared_ptr + : public __shared_ptr_access<_Tp, _Lp> + { + public: + using element_type = typename remove_extent<_Tp>::type; + private: // Constraint for taking ownership of a pointer of type _Yp*: template<typename _Yp> using _SafeConv @@ -888,9 +1052,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Constraint for construction from unique_ptr: template<typename _Yp, typename _Del, typename _Res = void, typename _Ptr = typename unique_ptr<_Yp, _Del>::pointer> - using _UniqCompatible = typename enable_if< - is_convertible<_Ptr, element_type*>::value - , _Res>::type; + using _UniqCompatible = typename enable_if<__and_< + __sp_compatible_with<_Yp*, _Tp*>, is_convertible<_Ptr, element_type*> + >::value, _Res>::type; // Constraint for assignment from unique_ptr: template<typename _Yp, typename _Del> @@ -909,7 +1073,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Yp, typename = _SafeConv<_Yp>> explicit __shared_ptr(_Yp* __p) - : _M_ptr(__p), _M_refcount(__p) + : _M_ptr(__p), _M_refcount(__p, typename is_array<_Tp>::type()) { static_assert( !is_void<_Yp>::value, "incomplete type" ); static_assert( sizeof(_Yp) > 0, "incomplete type" ); @@ -995,6 +1159,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_enable_shared_from_this_with(__raw); } +#if __cplusplus <= 201402L && _GLIBCXX_USE_DEPRECATED + protected: + // If an exception is thrown this constructor has no effect. + template<typename _Tp1, typename _Del, + typename enable_if<__and_< + __not_<is_array<_Tp>>, is_array<_Tp1>, + is_convertible<typename unique_ptr<_Tp1, _Del>::pointer, _Tp*> + >::value, bool>::type = true> + __shared_ptr(unique_ptr<_Tp1, _Del>&& __r, __sp_array_delete) + : _M_ptr(__r.get()), _M_refcount() + { + auto __raw = _S_raw_ptr(__r.get()); + _M_refcount = __shared_count<_Lp>(std::move(__r)); + _M_enable_shared_from_this_with(__raw); + } + public: +#endif + #if _GLIBCXX_USE_DEPRECATED // Postcondition: use_count() == 1 and __r.get() == 0 template<typename _Yp, typename = _Compatible<_Yp>> @@ -1068,21 +1250,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION reset(_Yp* __p, _Deleter __d, _Alloc __a) { __shared_ptr(__p, __d, std::move(__a)).swap(*this); } - // Allow class instantiation when _Tp is [cv-qual] void. - typename std::add_lvalue_reference<element_type>::type - operator*() const noexcept - { - __glibcxx_assert(_M_ptr != 0); - return *_M_ptr; - } - - element_type* - operator->() const noexcept - { - _GLIBCXX_DEBUG_PEDASSERT(_M_ptr != 0); - return _M_ptr; - } - element_type* get() const noexcept { return _M_ptr; } @@ -1193,7 +1360,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Yp> struct __has_esft_base<_Yp, __void_t<__esft_base_t<_Yp>>> - : true_type { }; + : __not_<is_array<_Tp>> { }; // No enable shared_from_this for arrays template<typename _Yp> typename enable_if<__has_esft_base<_Yp>::value>::type @@ -1428,7 +1595,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using _Assignable = _Compatible<_Yp, __weak_ptr&>; public: - using element_type = _Tp; + using element_type = typename remove_extent<_Tp>::type; constexpr __weak_ptr() noexcept : _M_ptr(nullptr), _M_refcount() @@ -1681,7 +1848,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { size_t operator()(const __shared_ptr<_Tp, _Lp>& __s) const noexcept - { return std::hash<_Tp*>()(__s.get()); } + { + return hash<typename __shared_ptr<_Tp, _Lp>::element_type*>()( + __s.get()); + } }; _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/experimental/bits/shared_ptr.h b/libstdc++-v3/include/experimental/bits/shared_ptr.h index e8c533e158c..8a1fc52caf8 100644 --- a/libstdc++-v3/include/experimental/bits/shared_ptr.h +++ b/libstdc++-v3/include/experimental/bits/shared_ptr.h @@ -46,665 +46,20 @@ namespace experimental inline namespace fundamentals_v2 { _GLIBCXX_BEGIN_NAMESPACE_VERSION - template<typename _Tp> class enable_shared_from_this; -_GLIBCXX_END_NAMESPACE_VERSION -} // namespace fundamentals_v2 -} // namespace experimental - -#define __cpp_lib_experimental_shared_ptr_arrays 201406 - -_GLIBCXX_BEGIN_NAMESPACE_VERSION - - /* - * The specification of std::experimental::shared_ptr is slightly different - * to std::shared_ptr (specifically in terms of "compatible" pointers) so - * to implement std::experimental::shared_ptr without too much duplication - * we make it derive from a partial specialization of std::__shared_ptr - * using a special tag type, __libfund_v1. - * - * There are two partial specializations for the tag type, supporting the - * different interfaces of the array and non-array forms. - */ - - template <typename _Tp, bool = is_array<_Tp>::value> - struct __libfund_v1 { using type = _Tp; }; - - // Partial specialization for base class of experimental::shared_ptr<T> - // (i.e. the non-array form of experimental::shared_ptr) - template<typename _Tp, _Lock_policy _Lp> - class __shared_ptr<__libfund_v1<_Tp, false>, _Lp> - : private __shared_ptr<_Tp, _Lp> - { - // For non-arrays, Y* is compatible with T* if Y* is convertible to T*. - template<typename _Yp, typename _Res = void> - using _Compatible - = enable_if_t<experimental::is_convertible_v<_Yp*, _Tp*>, _Res>; - - template<typename _Yp, typename _Del, - typename _Ptr = typename unique_ptr<_Yp, _Del>::pointer, - typename _Res = void> - using _UniqCompatible = enable_if_t< - experimental::is_convertible_v<_Yp*, _Tp*> - && experimental::is_convertible_v<_Ptr, _Tp*>, - _Res>; - - using _Base_type = __shared_ptr<_Tp>; - - _Base_type& _M_get_base() { return *this; } - const _Base_type& _M_get_base() const { return *this; } - - public: - using element_type = _Tp; - - constexpr __shared_ptr() noexcept = default; - - template<typename _Tp1, typename = _Compatible<_Tp1>> - explicit - __shared_ptr(_Tp1* __p) - : _Base_type(__p) - { } - - template<typename _Tp1, typename _Deleter, typename = _Compatible<_Tp1>> - __shared_ptr(_Tp1* __p, _Deleter __d) - : _Base_type(__p, __d) - { } - - template<typename _Tp1, typename _Deleter, typename _Alloc, - typename = _Compatible<_Tp1>> - __shared_ptr(_Tp1* __p, _Deleter __d, _Alloc __a) - : _Base_type(__p, __d, __a) - { } - - template<typename _Deleter> - __shared_ptr(nullptr_t __p, _Deleter __d) - : _Base_type(__p, __d) - { } - - template<typename _Deleter, typename _Alloc> - __shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a) - : _Base_type(__p, __d, __a) - { } - - template<typename _Tp1> - __shared_ptr(const __shared_ptr<__libfund_v1<_Tp1>, _Lp>& __r, - element_type* __p) noexcept - : _Base_type(__r._M_get_base(), __p) - { } - - __shared_ptr(const __shared_ptr&) noexcept = default; - __shared_ptr(__shared_ptr&&) noexcept = default; - __shared_ptr& operator=(const __shared_ptr&) noexcept = default; - __shared_ptr& operator=(__shared_ptr&&) noexcept = default; - ~__shared_ptr() = default; - - template<typename _Tp1, typename = _Compatible<_Tp1>> - __shared_ptr(const __shared_ptr<__libfund_v1<_Tp1>, _Lp>& __r) noexcept - : _Base_type(__r._M_get_base()) - { } - - template<typename _Tp1, typename = _Compatible<_Tp1>> - __shared_ptr(__shared_ptr<__libfund_v1<_Tp1>, _Lp>&& __r) noexcept - : _Base_type(std::move((__r._M_get_base()))) - { } - - template<typename _Tp1, typename = _Compatible<_Tp1>> - explicit - __shared_ptr(const __weak_ptr<__libfund_v1<_Tp1>, _Lp>& __r) - : _Base_type(__r._M_get_base()) - { } - - template<typename _Tp1, typename _Del, - typename = _UniqCompatible<_Tp1, _Del>> - __shared_ptr(unique_ptr<_Tp1, _Del>&& __r) - : _Base_type(std::move(__r)) - { } - -#if _GLIBCXX_USE_DEPRECATED - // Postcondition: use_count() == 1 and __r.get() == 0 - template<typename _Tp1, typename = _Compatible<_Tp1>> - __shared_ptr(std::auto_ptr<_Tp1>&& __r) - : _Base_type(std::move(__r)) - { } -#endif - - constexpr __shared_ptr(nullptr_t) noexcept : __shared_ptr() { } - - // reset - void - reset() noexcept - { __shared_ptr(nullptr).swap(*this); } - - template<typename _Tp1> - _Compatible<_Tp1> - reset(_Tp1* __p) - { - _GLIBCXX_DEBUG_ASSERT(__p == 0 || __p != get()); - __shared_ptr(__p).swap(*this); - } - - template<typename _Tp1, typename _Deleter> - _Compatible<_Tp1> - reset(_Tp1* __p, _Deleter __d) - { __shared_ptr(__p, __d).swap(*this); } - - template<typename _Tp1, typename _Deleter, typename _Alloc> - _Compatible<_Tp1> - reset(_Tp1* __p, _Deleter __d, _Alloc __a) - { __shared_ptr(__p, __d, std::move(__a)).swap(*this); } - - using _Base_type::operator*; - using _Base_type::operator->; - - template<typename _Tp1> - _Compatible<_Tp1, __shared_ptr&> - operator=(const __shared_ptr<__libfund_v1<_Tp1>, _Lp>& __r) noexcept - { - _Base_type::operator=(__r._M_get_base()); - return *this; - } - - template<class _Tp1> - _Compatible<_Tp1, __shared_ptr&> - operator=(__shared_ptr<__libfund_v1<_Tp1>, _Lp>&& __r) noexcept - { - _Base_type::operator=(std::move(__r._M_get_base())); - return *this; - } - - template<typename _Tp1, typename _Del> - _UniqCompatible<_Tp1, _Del, __shared_ptr&> - operator=(unique_ptr<_Tp1, _Del>&& __r) - { - _Base_type::operator=(std::move(__r)); - return *this; - } - -#if _GLIBCXX_USE_DEPRECATED - template<typename _Tp1> - _Compatible<_Tp1, __shared_ptr&> - operator=(std::auto_ptr<_Tp1>&& __r) - { - _Base_type::operator=(std::move(__r)); - return *this; - } -#endif - - void - swap(__shared_ptr& __other) noexcept - { _Base_type::swap(__other); } - - template<typename _Tp1> - bool - owner_before(__shared_ptr<__libfund_v1<_Tp1>, _Lp> const& __rhs) const - { return _Base_type::owner_before(__rhs._M_get_base()); } - - template<typename _Tp1> - bool - owner_before(__weak_ptr<__libfund_v1<_Tp1>, _Lp> const& __rhs) const - { return _Base_type::owner_before(__rhs._M_get_base()); } - - using _Base_type::operator bool; - using _Base_type::get; - using _Base_type::unique; - using _Base_type::use_count; - - protected: - - // make_shared not yet support for shared_ptr_arrays - //template<typename _Alloc, typename... _Args> - // __shared_ptr(_Sp_make_shared_tag __tag, const _Alloc& __a, - // _Args&&... __args) - // : _M_ptr(), _M_refcount(__tag, (_Tp*)0, __a, - // std::forward<_Args>(__args)...) - // { - // void* __p = _M_refcount._M_get_deleter(typeid(__tag)); - // _M_ptr = static_cast<_Tp*>(__p); - // } - - // __weak_ptr::lock() - __shared_ptr(const __weak_ptr<__libfund_v1<_Tp>, _Lp>& __r, - std::nothrow_t) - : _Base_type(__r._M_get_base(), std::nothrow) - { } - - private: - template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr; - template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr; - - // TODO - template<typename _Del, typename _Tp1, _Lock_policy _Lp1> - friend _Del* get_deleter(const __shared_ptr<_Tp1, _Lp1>&) noexcept; - }; - - // Helper traits for shared_ptr of array: - // Trait that tests if Y* is compatible with T*, for shared_ptr purposes. - template<typename _Yp, typename _Tp> - struct __sp_compatible - : is_convertible<_Yp*, _Tp*>::type - { }; + // 8.2.1 - template<size_t _Nm, typename _Tp> - struct __sp_compatible<_Tp[_Nm], _Tp[]> - : true_type - { }; - - template<size_t _Nm, typename _Tp> - struct __sp_compatible<_Tp[_Nm], const _Tp[]> - : true_type - { }; + template<typename _Tp> class shared_ptr; + template<typename _Tp> class weak_ptr; + template<typename _Tp> class enable_shared_from_this; template<typename _Yp, typename _Tp> constexpr bool __sp_compatible_v - = __sp_compatible<_Yp, _Tp>::value; - - // Test conversion from Y(*)[N] to U(*)[N] without forming invalid type Y[N]. - template<typename _Up, size_t _Nm, typename _Yp, typename = void> - struct __sp_is_constructible_arrN - : false_type - { }; - - template<typename _Up, size_t _Nm, typename _Yp> - struct __sp_is_constructible_arrN<_Up, _Nm, _Yp, __void_t<_Yp[_Nm]>> - : is_convertible<_Yp(*)[_Nm], _Up(*)[_Nm]>::type - { }; - - // Test conversion from Y(*)[] to U(*)[] without forming invalid type Y[]. - template<typename _Up, typename _Yp, typename = void> - struct __sp_is_constructible_arr - : false_type - { }; - - template<typename _Up, typename _Yp> - struct __sp_is_constructible_arr<_Up, _Yp, __void_t<_Yp[]>> - : is_convertible<_Yp(*)[], _Up(*)[]>::type - { }; - - // Trait to check if shared_ptr<T> can be constructed from Y*. - template<typename _Tp, typename _Yp> - struct __sp_is_constructible; - - // When T is U[N], Y(*)[N] shall be convertible to T*; - template<typename _Up, size_t _Nm, typename _Yp> - struct __sp_is_constructible<_Up[_Nm], _Yp> - : __sp_is_constructible_arrN<_Up, _Nm, _Yp>::type - { }; - - // when T is U[], Y(*)[] shall be convertible to T*; - template<typename _Up, typename _Yp> - struct __sp_is_constructible<_Up[], _Yp> - : __sp_is_constructible_arr<_Up, _Yp>::type - { }; - - // otherwise, Y* shall be convertible to T*. - template<typename _Tp, typename _Yp> - struct __sp_is_constructible - : is_convertible<_Yp*, _Tp*>::type - { }; + = std::__sp_compatible_with<_Yp*, _Tp*>::value; template<typename _Tp, typename _Yp> constexpr bool __sp_is_constructible_v - = __sp_is_constructible<_Tp, _Yp>::value; - - - // Partial specialization for base class of experimental::shared_ptr<T[N]> - // and experimental::shared_ptr<T[]> (i.e. the array forms). - template<typename _Tp, _Lock_policy _Lp> - class __shared_ptr<__libfund_v1<_Tp, true>, _Lp> - : private __shared_ptr<remove_extent_t<_Tp>, _Lp> - { - public: - using element_type = remove_extent_t<_Tp>; - - private: - struct _Array_deleter - { - void - operator()(element_type const *__p) const - { delete [] __p; } - }; - - // Constraint for constructing/resetting with a pointer of type _Yp*: - template<typename _Yp> - using _SafeConv = enable_if_t<__sp_is_constructible_v<_Tp, _Yp>>; - - // Constraint for constructing/assigning from smart_pointer<_Tp1>: - template<typename _Tp1, typename _Res = void> - using _Compatible = enable_if_t<__sp_compatible_v<_Tp1, _Tp>, _Res>; - - // Constraint for constructing/assigning from unique_ptr<_Tp1, _Del>: - template<typename _Tp1, typename _Del, - typename _Ptr = typename unique_ptr<_Tp1, _Del>::pointer, - typename _Res = void> - using _UniqCompatible = enable_if_t< - __sp_compatible_v<_Tp1, _Tp> - && experimental::is_convertible_v<_Ptr, element_type*>, - _Res>; - - using _Base_type = __shared_ptr<element_type>; - - _Base_type& _M_get_base() { return *this; } - const _Base_type& _M_get_base() const { return *this; } - - public: - constexpr __shared_ptr() noexcept - : _Base_type() - { } - - template<typename _Tp1, typename = _SafeConv<_Tp1>> - explicit - __shared_ptr(_Tp1* __p) - : _Base_type(__p, _Array_deleter()) - { } - - template<typename _Tp1, typename _Deleter, typename = _SafeConv<_Tp1>> - __shared_ptr(_Tp1* __p, _Deleter __d) - : _Base_type(__p, __d) - { } - - template<typename _Tp1, typename _Deleter, typename _Alloc, - typename = _SafeConv<_Tp1>> - __shared_ptr(_Tp1* __p, _Deleter __d, _Alloc __a) - : _Base_type(__p, __d, __a) - { } - - template<typename _Deleter> - __shared_ptr(nullptr_t __p, _Deleter __d) - : _Base_type(__p, __d) - { } - - template<typename _Deleter, typename _Alloc> - __shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a) - : _Base_type(__p, __d, __a) - { } - - template<typename _Tp1> - __shared_ptr(const __shared_ptr<__libfund_v1<_Tp1>, _Lp>& __r, - element_type* __p) noexcept - : _Base_type(__r._M_get_base(), __p) - { } - - __shared_ptr(const __shared_ptr&) noexcept = default; - __shared_ptr(__shared_ptr&&) noexcept = default; - __shared_ptr& operator=(const __shared_ptr&) noexcept = default; - __shared_ptr& operator=(__shared_ptr&&) noexcept = default; - ~__shared_ptr() = default; - - template<typename _Tp1, typename = _Compatible<_Tp1>> - __shared_ptr(const __shared_ptr<__libfund_v1<_Tp1>, _Lp>& __r) noexcept - : _Base_type(__r._M_get_base()) - { } - - template<typename _Tp1, typename = _Compatible<_Tp1>> - __shared_ptr(__shared_ptr<__libfund_v1<_Tp1>, _Lp>&& __r) noexcept - : _Base_type(std::move((__r._M_get_base()))) - { } - - template<typename _Tp1, typename = _Compatible<_Tp1>> - explicit - __shared_ptr(const __weak_ptr<__libfund_v1<_Tp1>, _Lp>& __r) - : _Base_type(__r._M_get_base()) - { } - - template<typename _Tp1, typename _Del, - typename = _UniqCompatible<_Tp1, _Del>> - __shared_ptr(unique_ptr<_Tp1, _Del>&& __r) - : _Base_type(std::move(__r)) - { } - -#if _GLIBCXX_USE_DEPRECATED - // Postcondition: use_count() == 1 and __r.get() == 0 - template<typename _Tp1, typename = _Compatible<_Tp1>> - __shared_ptr(auto_ptr<_Tp1>&& __r) - : _Base_type(std::move(__r)) - { } -#endif - - constexpr __shared_ptr(nullptr_t) noexcept : __shared_ptr() { } - - // reset - void - reset() noexcept - { __shared_ptr(nullptr).swap(*this); } - - template<typename _Tp1> - _SafeConv<_Tp1> - reset(_Tp1* __p) - { - _GLIBCXX_DEBUG_ASSERT(__p == 0 || __p != get()); - __shared_ptr(__p, _Array_deleter()).swap(*this); - } - - template<typename _Tp1, typename _Deleter> - _SafeConv<_Tp1> - reset(_Tp1* __p, _Deleter __d) - { __shared_ptr(__p, __d).swap(*this); } - - template<typename _Tp1, typename _Deleter, typename _Alloc> - _SafeConv<_Tp1> - reset(_Tp1* __p, _Deleter __d, _Alloc __a) - { __shared_ptr(__p, __d, std::move(__a)).swap(*this); } - - element_type& - operator[](ptrdiff_t i) const noexcept - { - _GLIBCXX_DEBUG_ASSERT(get() != 0 && i >= 0); - return get()[i]; - } - - template<typename _Tp1> - _Compatible<_Tp1, __shared_ptr&> - operator=(const __shared_ptr<__libfund_v1<_Tp1>, _Lp>& __r) noexcept - { - _Base_type::operator=(__r._M_get_base()); - return *this; - } - - template<class _Tp1> - _Compatible<_Tp1, __shared_ptr&> - operator=(__shared_ptr<__libfund_v1<_Tp1>, _Lp>&& __r) noexcept - { - _Base_type::operator=(std::move(__r._M_get_base())); - return *this; - } - - template<typename _Tp1, typename _Del> - _UniqCompatible<_Tp1, _Del, __shared_ptr&> - operator=(unique_ptr<_Tp1, _Del>&& __r) - { - _Base_type::operator=(std::move(__r)); - return *this; - } - -#if _GLIBCXX_USE_DEPRECATED - template<typename _Tp1> - _Compatible<_Tp1, __shared_ptr&> - operator=(auto_ptr<_Tp1>&& __r) - { - _Base_type::operator=(std::move(__r)); - return *this; - } -#endif - - void - swap(__shared_ptr& __other) noexcept - { _Base_type::swap(__other); } - - template<typename _Tp1> - bool - owner_before(__shared_ptr<__libfund_v1<_Tp1>, _Lp> const& __rhs) const - { return _Base_type::owner_before(__rhs._M_get_base()); } - - template<typename _Tp1> - bool - owner_before(__weak_ptr<__libfund_v1<_Tp1>, _Lp> const& __rhs) const - { return _Base_type::owner_before(__rhs._M_get_base()); } - - using _Base_type::operator bool; - using _Base_type::get; - using _Base_type::unique; - using _Base_type::use_count; - - protected: - - // make_shared not yet support for shared_ptr_arrays - //template<typename _Alloc, typename... _Args> - // __shared_ptr(_Sp_make_shared_tag __tag, const _Alloc& __a, - // _Args&&... __args) - // : _M_ptr(), _M_refcount(__tag, (_Tp*)0, __a, - // std::forward<_Args>(__args)...) - // { - // void* __p = _M_refcount._M_get_deleter(typeid(__tag)); - // _M_ptr = static_cast<_Tp*>(__p); - // } - - // __weak_ptr::lock() - __shared_ptr(const __weak_ptr<__libfund_v1<_Tp>, _Lp>& __r, - std::nothrow_t) - : _Base_type(__r._M_get_base(), std::nothrow) - { } - - private: - template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr; - template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr; - - // TODO - template<typename _Del, typename _Tp1, _Lock_policy _Lp1> - friend _Del* get_deleter(const __shared_ptr<_Tp1, _Lp1>&) noexcept; - }; - - // weak_ptr specialization for __shared_ptr array - template<typename _Tp, _Lock_policy _Lp> - class __weak_ptr<__libfund_v1<_Tp>, _Lp> - : __weak_ptr<remove_extent_t<_Tp>, _Lp> - { - template<typename _Tp1, typename _Res = void> - using _Compatible - = enable_if_t<__sp_compatible_v<_Tp1, _Tp>, _Res>; - - using _Base_type = __weak_ptr<remove_extent_t<_Tp>>; - - _Base_type& _M_get_base() { return *this; } - const _Base_type& _M_get_base() const { return *this; } - - public: - using element_type = remove_extent_t<_Tp>; - - constexpr __weak_ptr() noexcept - : _Base_type() - { } - - __weak_ptr(const __weak_ptr&) noexcept = default; - - ~__weak_ptr() = default; - - template<typename _Tp1, typename = _Compatible<_Tp1>> - __weak_ptr(const __weak_ptr<__libfund_v1<_Tp1>, _Lp>& __r) noexcept - : _Base_type(__r._M_get_base()) - { } - - template<typename _Tp1, typename = _Compatible<_Tp1>> - __weak_ptr(const __shared_ptr<__libfund_v1<_Tp1>, _Lp>& __r) noexcept - : _Base_type(__r._M_get_base()) - { } - - __weak_ptr(__weak_ptr&& __r) noexcept - : _Base_type(std::move(__r)) - { } - - template<typename _Tp1, typename = _Compatible<_Tp1>> - __weak_ptr(__weak_ptr<__libfund_v1<_Tp1>, _Lp>&& __r) noexcept - : _Base_type(std::move(__r._M_get_base())) - { } - - __weak_ptr& - operator=(const __weak_ptr& __r) noexcept = default; - - template<typename _Tp1> - _Compatible<_Tp1, __weak_ptr&> - operator=(const __weak_ptr<__libfund_v1<_Tp1>, _Lp>& __r) noexcept - { - this->_Base_type::operator=(__r._M_get_base()); - return *this; - } - - template<typename _Tp1> - _Compatible<_Tp1, __weak_ptr&> - operator=(const __shared_ptr<_Tp1, _Lp>& __r) noexcept - { - this->_Base_type::operator=(__r._M_get_base()); - return *this; - } - - __weak_ptr& - operator=(__weak_ptr&& __r) noexcept - { - this->_Base_type::operator=(std::move(__r)); - return *this; - } - - template<typename _Tp1> - _Compatible<_Tp1, __weak_ptr&> - operator=(__weak_ptr<_Tp1, _Lp>&& __r) noexcept - { - this->_Base_type::operator=(std::move(__r._M_get_base())); - return *this; - } - - void - swap(__weak_ptr& __other) noexcept - { this->_Base_type::swap(__other); } - - template<typename _Tp1> - bool - owner_before(const __shared_ptr<__libfund_v1<_Tp1>, _Lp>& __rhs) const - { return _Base_type::owner_before(__rhs._M_get_base()); } - - template<typename _Tp1> - bool - owner_before(const __weak_ptr<__libfund_v1<_Tp1>, _Lp>& __rhs) const - { return _Base_type::owner_before(__rhs._M_get_base()); } - - __shared_ptr<__libfund_v1<_Tp>, _Lp> - lock() const noexcept // should not be element_type - { return __shared_ptr<__libfund_v1<_Tp>, _Lp>(*this, std::nothrow); } - - using _Base_type::use_count; - using _Base_type::expired; - using _Base_type::reset; - - private: - // Used by __enable_shared_from_this. - void - _M_assign(element_type* __ptr, - const __shared_count<_Lp>& __refcount) noexcept - { this->_Base_type::_M_assign(__ptr, __refcount); } - - template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr; - template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr; - friend class __enable_shared_from_this<_Tp, _Lp>; - friend class experimental::enable_shared_from_this<_Tp>; - friend class enable_shared_from_this<_Tp>; - }; - -_GLIBCXX_END_NAMESPACE_VERSION - -namespace experimental -{ -inline namespace fundamentals_v2 -{ -_GLIBCXX_BEGIN_NAMESPACE_VERSION - - // 8.2.1 - - template<typename _Tp> class shared_ptr; - template<typename _Tp> class weak_ptr; - - template<typename _Tp, _Lock_policy _Lp = __default_lock_policy> - using __shared_ptr = std::__shared_ptr<__libfund_v1<_Tp>, _Lp>; - - template<typename _Tp, _Lock_policy _Lp = __default_lock_policy> - using __weak_ptr = std::__weak_ptr<__libfund_v1<_Tp>, _Lp>; + = std::__sp_is_constructible<_Tp, _Yp>::value; template<typename _Tp> class shared_ptr : public __shared_ptr<_Tp> @@ -1128,16 +483,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { __a.swap(__b); } /// C++14 §20.8.2.2.10 - template<typename _Del, typename _Tp, _Lock_policy _Lp> + template<typename _Del, typename _Tp> inline _Del* - get_deleter(const __shared_ptr<_Tp, _Lp>& __p) noexcept + get_deleter(const shared_ptr<_Tp>& __p) noexcept { return std::get_deleter<_Del>(__p); } // C++14 §20.8.2.2.11 - template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp> + template<typename _Ch, typename _Tr, typename _Tp> inline std::basic_ostream<_Ch, _Tr>& - operator<<(std::basic_ostream<_Ch, _Tr>& __os, - const __shared_ptr<_Tp, _Lp>& __p) + operator<<(std::basic_ostream<_Ch, _Tr>& __os, const shared_ptr<_Tp>& __p) { __os << __p.get(); return __os; diff --git a/libstdc++-v3/include/experimental/memory_resource b/libstdc++-v3/include/experimental/memory_resource index 39187c50881..52e0b031653 100644 --- a/libstdc++-v3/include/experimental/memory_resource +++ b/libstdc++-v3/include/experimental/memory_resource @@ -72,6 +72,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // 8.5 Class memory_resource class memory_resource { + protected: static constexpr size_t _S_max_align = alignof(max_align_t); public: diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future index fea915b0a87..8ba13069510 100644 --- a/libstdc++-v3/include/std/future +++ b/libstdc++-v3/include/std/future @@ -95,11 +95,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ class future_error : public logic_error { - error_code _M_code; - public: - explicit future_error(error_code __ec) - : logic_error("std::future_error: " + __ec.message()), _M_code(__ec) + explicit + future_error(future_errc __errc) + : future_error(std::make_error_code(__errc)) { } virtual ~future_error() noexcept; @@ -109,6 +108,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const error_code& code() const noexcept { return _M_code; } + + private: + explicit + future_error(error_code __ec) + : logic_error("std::future_error: " + __ec.message()), _M_code(__ec) + { } + + friend void __throw_future_error(int); + + error_code _M_code; }; // Forward declarations. @@ -426,8 +435,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (static_cast<bool>(__res)) { - error_code __ec(make_error_code(future_errc::broken_promise)); - __res->_M_error = make_exception_ptr(future_error(__ec)); + __res->_M_error = + make_exception_ptr(future_error(future_errc::broken_promise)); // This function is only called when the last asynchronous result // provider is abandoning this shared state, so noone can be // trying to make the shared state ready at the same time, and @@ -769,7 +778,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return std::move(this->_M_get_result()._M_value()); } - shared_future<_Res> share(); + shared_future<_Res> share() noexcept; }; /// Partial specialization for future<R&> @@ -812,7 +821,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return this->_M_get_result()._M_get(); } - shared_future<_Res&> share(); + shared_future<_Res&> share() noexcept; }; /// Explicit specialization for future<void> @@ -855,7 +864,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION this->_M_get_result(); } - shared_future<void> share(); + shared_future<void> share() noexcept; }; @@ -995,18 +1004,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : _M_state(std::move(__uf._M_state)) { } + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 2556. Wide contract for future::share() template<typename _Res> inline shared_future<_Res> - future<_Res>::share() + future<_Res>::share() noexcept { return shared_future<_Res>(std::move(*this)); } template<typename _Res> inline shared_future<_Res&> - future<_Res&>::share() + future<_Res&>::share() noexcept { return shared_future<_Res&>(std::move(*this)); } inline shared_future<void> - future<void>::share() + future<void>::share() noexcept { return shared_future<void>(std::move(*this)); } /// Primary template for promise diff --git a/libstdc++-v3/include/std/string_view b/libstdc++-v3/include/std/string_view index b2d2a296ba4..cf728dd83e9 100644 --- a/libstdc++-v3/include/std/string_view +++ b/libstdc++-v3/include/std/string_view @@ -640,6 +640,36 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { }; #endif + inline namespace literals + { + inline namespace string_view_literals + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION + + inline constexpr basic_string_view<char> + operator""sv(const char* __str, size_t __len) + { return basic_string_view<char>{__str, __len}; } + +#ifdef _GLIBCXX_USE_WCHAR_T + inline constexpr basic_string_view<wchar_t> + operator""sv(const wchar_t* __str, size_t __len) + { return basic_string_view<wchar_t>{__str, __len}; } +#endif + +#ifdef _GLIBCXX_USE_C99_STDINT_TR1 + inline constexpr basic_string_view<char16_t> + operator""sv(const char16_t* __str, size_t __len) + { return basic_string_view<char16_t>{__str, __len}; } + + inline constexpr basic_string_view<char32_t> + operator""sv(const char32_t* __str, size_t __len) + { return basic_string_view<char32_t>{__str, __len}; } +#endif + + _GLIBCXX_END_NAMESPACE_VERSION + } // namespace string_literals + } // namespace literals + _GLIBCXX_END_NAMESPACE_VERSION } // namespace std diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc index 8ed0a105dfa..0dcb1b410fc 100644 --- a/libstdc++-v3/src/filesystem/ops.cc +++ b/libstdc++-v3/src/filesystem/ops.cc @@ -1054,7 +1054,7 @@ fs::is_empty(const path& p) error_code ec; bool e = is_empty(p, ec); if (ec) - _GLIBCXX_THROW_OR_ABORT(filesystem_error("cannot check is file is empty", + _GLIBCXX_THROW_OR_ABORT(filesystem_error("cannot check if file is empty", p, ec)); return e; } diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc index 4f0720af412..a65971633fa 100644 --- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc +++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc @@ -41,7 +41,7 @@ void test01() typedef make_signed<float>::type test5_type; } -// { dg-error "does not name a type" "" { target *-*-* } 32 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 32 } // { dg-error "required from here" "" { target *-*-* } 34 } // { dg-error "required from here" "" { target *-*-* } 36 } // { dg-error "required from here" "" { target *-*-* } 39 } diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc index 8eea6b967f3..6a93e2f3640 100644 --- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc +++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc @@ -41,7 +41,7 @@ void test01() typedef make_unsigned<float>::type test5_type; } -// { dg-error "does not name a type" "" { target *-*-* } 32 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 32 } // { dg-error "required from here" "" { target *-*-* } 34 } // { dg-error "required from here" "" { target *-*-* } 36 } // { dg-error "required from here" "" { target *-*-* } 39 } diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/array.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/array.cc new file mode 100644 index 00000000000..d56dc6692e9 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/array.cc @@ -0,0 +1,273 @@ +// { dg-do run { target c++11 } } + +// Copyright (C) 2016 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <memory> +#include <testsuite_hooks.h> + +// C++1z 20.11.2.2.1 shared_ptr constructors [util.smartptr.shared.const] + +template<typename To, typename From> +constexpr bool check() +{ + using std::shared_ptr; + using std::is_constructible; + return !is_constructible<shared_ptr<To>, shared_ptr<From>>::value + && !is_constructible<shared_ptr<To>, shared_ptr<From>&>::value; +} + +static_assert( check<int, int[]>() ); +static_assert( check<int, int[2]>() ); +static_assert( check<int[2], void>() ); +static_assert( check<int[2], int>() ); +static_assert( check<int[2], int[]>() ); +static_assert( check<int[], void>() ); +static_assert( check<int[], int>() ); + +int count = 0; + +struct A { + A() { ++count; } + ~A() { --count; } +}; + +struct B : A { }; + +static_assert( check<A, B[2]>() ); +static_assert( check<A, B[]>() ); +static_assert( check<A[2], B>() ); +static_assert( check<A[2], B[2]>() ); +static_assert( check<A[2], B[]>() ); +static_assert( check<A[], B>() ); +static_assert( check<A[], B[2]>() ); +static_assert( check<A[], B[]>() ); + +void +test01() +{ + std::shared_ptr<A[2]> p; + VERIFY( p.get() == nullptr ); + VERIFY( p.use_count() == 0 ); + p.reset(); + VERIFY( count == 0 ); +} + +void +test02() +{ + std::shared_ptr<A[]> p; + VERIFY( p.get() == nullptr ); + VERIFY( p.use_count() == 0 ); + p.reset(); + VERIFY( count == 0 ); +} + +void +test03() +{ + std::shared_ptr<A[2]> p(nullptr); + VERIFY( p.get() == nullptr ); + VERIFY( p.use_count() == 0 ); + p.reset(); + VERIFY( count == 0 ); +} + +void +test04() +{ + std::shared_ptr<A[]> p(nullptr); + VERIFY( p.get() == nullptr ); + VERIFY( p.use_count() == 0 ); + p.reset(); + VERIFY( count == 0 ); +} + +// Construction from pointer + +void +test05() +{ + A * const a = nullptr; + std::shared_ptr<A[2]> p(a); + VERIFY( p.get() == nullptr ); + VERIFY( p.use_count() == 1 ); + p.reset(); + VERIFY( count == 0 ); +} + +void +test06() +{ + A * const a = nullptr; + std::shared_ptr<A[]> p(a); + VERIFY( p.get() == nullptr ); + VERIFY( p.use_count() == 1 ); + p.reset(); + VERIFY( count == 0 ); +} + +void +test07() +{ + A * const a = new A[2]; + std::shared_ptr<A[2]> p(a); + VERIFY( p.get() == a ); + VERIFY( p.use_count() == 1 ); + p.reset(); + VERIFY( count == 0 ); +} + +void +test08() +{ + A * const a = new A[2]; + std::shared_ptr<A[]> p(a); + VERIFY( p.get() == a ); + VERIFY( p.use_count() == 1 ); + p.reset(); + VERIFY( count == 0 ); +} + +// Converting constrcutor + +void +test09() +{ + A * const a = new A[2]; + std::shared_ptr<A[2]> p(a); + std::shared_ptr<const A[2]> p2(p); + VERIFY( p2.get() == a ); + VERIFY( p.use_count() == 2 ); + VERIFY( p2.use_count() == 2 ); + p.reset(); + VERIFY( count != 0 ); + p2.reset(); + VERIFY( count == 0 ); +} + +void +test10() +{ + A * const a = new A[2]; + std::shared_ptr<A[]> p(a); + std::shared_ptr<const A[]> p2(p); + VERIFY( p2.get() == a ); + VERIFY( p.use_count() == 2 ); + VERIFY( p2.use_count() == 2 ); + p.reset(); + VERIFY( count != 0 ); + p2.reset(); + VERIFY( count == 0 ); +} + +void +test11() +{ + A * const a = new A[2]; + std::shared_ptr<A[2]> p(a); + std::shared_ptr<const A[]> p2(p); + VERIFY( p2.get() == a ); + VERIFY( p.use_count() == 2 ); + VERIFY( p2.use_count() == 2 ); + p.reset(); + VERIFY( count != 0 ); + p2.reset(); + VERIFY( count == 0 ); +} + +// Copy construction + +void +test12() +{ + A * const a = new A[2]; + std::shared_ptr<A[2]> p(a); + std::shared_ptr<A[2]> p2(p); + VERIFY( p2.get() == a ); + VERIFY( p.use_count() == 2 ); + VERIFY( p2.use_count() == 2 ); + p.reset(); + VERIFY( count != 0 ); + p2.reset(); + VERIFY( count == 0 ); +} + +void +test13() +{ + A * const a = new A[2]; + std::shared_ptr<A[2]> p(a); + std::shared_ptr<A[]> p2(p); + VERIFY( p2.get() == a ); + VERIFY( p.use_count() == 2 ); + VERIFY( p2.use_count() == 2 ); + p.reset(); + VERIFY( count != 0 ); + p2.reset(); + VERIFY( count == 0 ); +} + +// Move construction + +void +test14() +{ + A * const a = new A[2]; + std::shared_ptr<A[2]> p(a); + std::shared_ptr<A[2]> p2(std::move(p)); + VERIFY( p.get() == nullptr ); + VERIFY( p2.get() == a ); + VERIFY( p.use_count() == 0 ); + VERIFY( p2.use_count() == 1 ); + p2.reset(); + VERIFY( count == 0 ); +} + +void +test15() +{ + A * const a = new A[2]; + std::shared_ptr<A[2]> p(a); + std::shared_ptr<A[]> p2(std::move(p)); + VERIFY( p.get() == nullptr ); + VERIFY( p2.get() == a ); + VERIFY( p.use_count() == 0 ); + VERIFY( p2.use_count() == 1 ); + p2.reset(); + VERIFY( count == 0 ); +} + +int +main() +{ + test01(); + test02(); + test03(); + test04(); + test05(); + test06(); + test07(); + test08(); + test09(); + test10(); + test11(); + test12(); + test13(); + test14(); + test15(); +} diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/unique_ptr_array.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/unique_ptr_array.cc index 72eed477c8f..bc1fcf12225 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/unique_ptr_array.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/unique_ptr_array.cc @@ -22,6 +22,13 @@ #include <memory> #include <testsuite_hooks.h> +#if __cpp_lib_shared_ptr_arrays >= 201603 +# define SHARED_PTR_ARRAYS +#endif +#if __cpp_lib_enable_shared_from_this >= 201603 +# define WEAK_FROM_THIS +#endif + int destroyed = 0; struct A : std::enable_shared_from_this<A> @@ -36,12 +43,22 @@ int test01() { std::unique_ptr<A[]> up(new A[2]); +#ifdef SHARED_PTR_ARRAYS + std::shared_ptr<A[]> sp(std::move(up)); +#else std::shared_ptr<A> sp(std::move(up)); +#endif VERIFY( up.get() == 0 ); VERIFY( sp.get() != 0 ); VERIFY( sp.use_count() == 1 ); +#ifdef SHARED_PTR_ARRAYS +# ifdef WEAK_FROM_THIS + VERIFY( sp[0].weak_from_this().expired() ); +# endif +#else VERIFY( sp->shared_from_this() != nullptr ); +#endif sp.reset(); VERIFY( destroyed == 2 ); diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/observers/array.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/observers/array.cc new file mode 100644 index 00000000000..c47859d659a --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/observers/array.cc @@ -0,0 +1,73 @@ +// { dg-do run { target c++11 } } + +// Copyright (C) 2016 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <memory> +#include <testsuite_hooks.h> + +struct A +{ + int i = 0; +}; + +// C++1z 20.11.2.2.5 shared_ptr observers [util.smartptr.shared.obs] + +// get +void +test01() +{ + A * const a = new A[2]; + const std::shared_ptr<A[2]> p(a); + VERIFY( p.get() == a ); +} + +// get +void +test02() +{ + A * const a = new A[2]; + const std::shared_ptr<A[]> p(a); + VERIFY( p.get() == a ); +} + +// operator[] +void +test03() +{ + A * const a = new A[2]; + const std::shared_ptr<A[2]> p(a); + VERIFY( &p[0] == a ); +} + +// operator[] +void +test04() +{ + A * const a = new A[2]; + const std::shared_ptr<A[]> p(a); + VERIFY( &p[0] == a ); +} + +int +main() +{ + test01(); + test02(); + test03(); + test04(); +} diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc new file mode 100644 index 00000000000..42e8b16070e --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc @@ -0,0 +1,45 @@ +// { dg-options "-std=gnu++17" } +// { dg-do compile } + +// Copyright (C) 2013-2016 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <string_view> +#include <type_traits> + +void +test01() +{ + using namespace std::literals::string_view_literals; + + static_assert(std::is_same<decltype("Hello"sv), std::string_view>::value, + "\"Hello\"s is std::string_view"); + + static_assert(std::is_same<decltype(u8"Hello"sv), std::string_view>::value, + "u8\"Hello\"s is std::string_view"); + +#ifdef _GLIBCXX_USE_WCHAR_T + static_assert(std::is_same<decltype(L"Hello"sv), std::wstring_view>::value, + "L\"Hello\"s is std::wstring_view"); +#endif + + static_assert(std::is_same<decltype(u"Hello"sv), std::u16string_view>::value, + "u\"Hello\"s is std::u16string_view"); + + static_assert(std::is_same<decltype(U"Hello"sv), std::u32string_view>::value, + "U\"Hello\"s is std::u32string_view"); +} diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc new file mode 100644 index 00000000000..bbaa70e854a --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc @@ -0,0 +1,72 @@ +// { dg-options "-std=gnu++17" } + +// Copyright (C) 2013-2016 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <string_view> +#include <testsuite_hooks.h> + +void +test01() +{ + using namespace std::literals::string_view_literals; + + std::string_view planet = "Mercury"sv; +#ifdef _GLIBCXX_USE_WCHAR_T + std::wstring_view wplanet = L"Venus"sv; +#endif + std::string_view u8planet = u8"Mars"sv; + std::u16string_view u16planet = u"Jupiter"sv; + std::u32string_view u32planet = U"Saturn"sv; + + VERIFY( planet == std::string_view("Mercury") ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( wplanet == std::wstring_view(L"Venus") ); +#endif + VERIFY( u8planet == std::string_view(u8"Mars") ); + VERIFY( u16planet == std::u16string_view(u"Jupiter") ); + VERIFY( u32planet == std::u32string_view(U"Saturn") ); +} + +void +test02() +{ + using namespace std::literals::string_view_literals; + + std::string_view planet_cratered = "Mercury\0cratered"sv; +#ifdef _GLIBCXX_USE_WCHAR_T + std::wstring_view wplanet_cratered = L"Venus\0cratered"sv; +#endif + std::string_view u8planet_cratered = u8"Mars\0cratered"sv; + std::u16string_view u16planet_cratered = u"Jupiter\0cratered"sv; + std::u32string_view u32planet_cratered = U"Saturn\0cratered"sv; + + VERIFY( planet_cratered == std::string_view("Mercury\0cratered", 16) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( wplanet_cratered == std::wstring_view(L"Venus\0cratered", 14) ); +#endif + VERIFY( u8planet_cratered == std::string_view(u8"Mars\0cratered", 13) ); + VERIFY( u16planet_cratered == std::u16string_view(u"Jupiter\0cratered", 16) ); + VERIFY( u32planet_cratered == std::u32string_view(U"Saturn\0cratered", 15) ); +} + +int +main() +{ + test01(); + test02(); +} diff --git a/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc index 16325232204..87d423f1e8b 100644 --- a/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/30_threads/future/requirements/explicit_instantiation.cc @@ -25,9 +25,8 @@ #include <testsuite_tr1.h> using namespace __gnu_test; -using std::future; -template class future<int>; -template class future<int&>; -template class future<void>; -template class future<ClassType>; -template class future<ClassType&>; +template class std::future<int>; +template class std::future<int&>; +template class std::future<void>; +template class std::future<ClassType>; +template class std::future<ClassType&>; diff --git a/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc index db90ff2c0f5..e3b61e4f418 100644 --- a/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/30_threads/packaged_task/requirements/explicit_instantiation.cc @@ -25,9 +25,8 @@ #include <testsuite_tr1.h> using namespace __gnu_test; -using std::packaged_task; -template class packaged_task<int()>; -template class packaged_task<int&()>; -template class packaged_task<void()>; -template class packaged_task<ClassType(int)>; -template class packaged_task<AbstractClass&(int)>; +template class std::packaged_task<int()>; +template class std::packaged_task<int&()>; +template class std::packaged_task<void()>; +template class std::packaged_task<ClassType(int)>; +template class std::packaged_task<AbstractClass&(int)>; diff --git a/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc index 9691ab0445d..4a220a9deb6 100644 --- a/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/30_threads/promise/requirements/explicit_instantiation.cc @@ -25,9 +25,8 @@ #include <testsuite_tr1.h> using namespace __gnu_test; -using std::promise; -template class promise<int>; -template class promise<int&>; -template class promise<void>; -template class promise<ClassType>; -template class promise<ClassType&>; +template class std::promise<int>; +template class std::promise<int&>; +template class std::promise<void>; +template class std::promise<ClassType>; +template class std::promise<ClassType&>; diff --git a/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc index a992b882fb0..715b7fe39c4 100644 --- a/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/30_threads/shared_future/requirements/explicit_instantiation.cc @@ -25,9 +25,8 @@ #include <testsuite_tr1.h> using namespace __gnu_test; -using std::shared_future; -template class shared_future<int>; -template class shared_future<int&>; -template class shared_future<void>; -template class shared_future<ClassType>; -template class shared_future<ClassType&>; +template class std::shared_future<int>; +template class std::shared_future<int&>; +template class std::shared_future<void>; +template class std::shared_future<ClassType>; +template class std::shared_future<ClassType&>; diff --git a/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc b/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc index 19c64abdc1b..b51fd4555ff 100644 --- a/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc +++ b/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc @@ -42,8 +42,36 @@ test01() VERIFY( u32planet == std::experimental::u32string_view(U"Saturn") ); } +void +test02() +{ + using namespace std::experimental::literals::string_view_literals; + + std::experimental::string_view planet_cratered = "Mercury\0cratered"sv; +#ifdef _GLIBCXX_USE_WCHAR_T + std::experimental::wstring_view wplanet_cratered = L"Venus\0cratered"sv; +#endif + std::experimental::string_view u8planet_cratered = u8"Mars\0cratered"sv; + std::experimental::u16string_view u16planet_cratered = u"Jupiter\0cratered"sv; + std::experimental::u32string_view u32planet_cratered = U"Saturn\0cratered"sv; + + VERIFY( planet_cratered == + std::experimental::string_view("Mercury\0cratered", 16) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( wplanet_cratered == + std::experimental::wstring_view(L"Venus\0cratered", 14) ); +#endif + VERIFY( u8planet_cratered == + std::experimental::string_view(u8"Mars\0cratered", 13) ); + VERIFY( u16planet_cratered == + std::experimental::u16string_view(u"Jupiter\0cratered", 16) ); + VERIFY( u32planet_cratered == + std::experimental::u32string_view(U"Saturn\0cratered", 15) ); +} + int main() { test01(); + test02(); } diff --git a/libstdc++-v3/testsuite/ext/numeric_traits/numeric_traits.cc b/libstdc++-v3/testsuite/ext/numeric_traits/numeric_traits.cc index 61987433954..6653625be8c 100644 --- a/libstdc++-v3/testsuite/ext/numeric_traits/numeric_traits.cc +++ b/libstdc++-v3/testsuite/ext/numeric_traits/numeric_traits.cc @@ -21,7 +21,6 @@ #include <ext/numeric_traits.h> -using __gnu_cxx::__numeric_traits; -template struct __numeric_traits<short>; -template struct __numeric_traits<unsigned short>; -template struct __numeric_traits<double>; +template struct __gnu_cxx::__numeric_traits<short>; +template struct __gnu_cxx::__numeric_traits<unsigned short>; +template struct __gnu_cxx::__numeric_traits<double>; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/requirements/explicit_instantiation/1.cc index a7b967f30ab..18d94dfa71c 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/requirements/explicit_instantiation/1.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/requirements/explicit_instantiation/1.cc @@ -23,8 +23,7 @@ // { dg-do compile } using namespace __gnu_test; -using std::tr1::enable_shared_from_this; -template class enable_shared_from_this<int>; -template class enable_shared_from_this<void>; -template class enable_shared_from_this<ClassType>; -template class enable_shared_from_this<IncompleteClass>; +template class std::tr1::enable_shared_from_this<int>; +template class std::tr1::enable_shared_from_this<void>; +template class std::tr1::enable_shared_from_this<ClassType>; +template class std::tr1::enable_shared_from_this<IncompleteClass>; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/1.cc index 794deaffe8d..918822d0681 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/1.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/1.cc @@ -23,8 +23,7 @@ // { dg-do compile } using namespace __gnu_test; -using std::tr1::shared_ptr; -template class shared_ptr<int>; -template class shared_ptr<void>; -template class shared_ptr<ClassType>; -template class shared_ptr<IncompleteClass>; +template class std::tr1::shared_ptr<int>; +template class std::tr1::shared_ptr<void>; +template class std::tr1::shared_ptr<ClassType>; +template class std::tr1::shared_ptr<IncompleteClass>; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/2.cc index 93587b293f7..870e888b382 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/2.cc @@ -26,8 +26,7 @@ // library this checks the templates can be instantiated for non-default // lock policy, for a single-threaded lib this is redundant but harmless. using namespace __gnu_test; -using std::tr1::__shared_ptr; using std::tr1::_S_single; -template class __shared_ptr<int, _S_single>; -template class __shared_ptr<ClassType, _S_single>; -template class __shared_ptr<IncompleteClass, _S_single>; +template class std::tr1::__shared_ptr<int, _S_single>; +template class std::tr1::__shared_ptr<ClassType, _S_single>; +template class std::tr1::__shared_ptr<IncompleteClass, _S_single>; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/1.cc index d64517c30c4..0680ead9c3e 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/1.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/1.cc @@ -23,8 +23,7 @@ // { dg-do compile } using namespace __gnu_test; -using std::tr1::weak_ptr; -template class weak_ptr<int>; -template class weak_ptr<void>; -template class weak_ptr<ClassType>; -template class weak_ptr<IncompleteClass>; +template class std::tr1::weak_ptr<int>; +template class std::tr1::weak_ptr<void>; +template class std::tr1::weak_ptr<ClassType>; +template class std::tr1::weak_ptr<IncompleteClass>; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/2.cc index 672e637d5f7..31617c9152c 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/2.cc @@ -26,9 +26,8 @@ // library this checks the templates can be instantiated for non-default // lock policy, for a single-threaded lib this is redundant but harmless. using namespace __gnu_test; -using std::tr1::__weak_ptr; using std::tr1::_S_single; -template class __weak_ptr<int, _S_single>; -template class __weak_ptr<void, _S_single>; -template class __weak_ptr<ClassType, _S_single>; -template class __weak_ptr<IncompleteClass, _S_single>; +template class std::tr1::__weak_ptr<int, _S_single>; +template class std::tr1::__weak_ptr<void, _S_single>; +template class std::tr1::__weak_ptr<ClassType, _S_single>; +template class std::tr1::__weak_ptr<IncompleteClass, _S_single>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/explicit_instantiation.cc index aba574d66dd..5f017c70461 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/explicit_instantiation.cc @@ -24,27 +24,25 @@ #include <string> #include <tr1/functional> -using namespace std::tr1; - // Verify that we can instantiate hash for every required type. -template class hash<bool>; -template class hash<char>; -template class hash<signed char>; -template class hash<unsigned char>; -template class hash<short>; -template class hash<int>; -template class hash<long>; -template class hash<unsigned short>; -template class hash<unsigned int>; -template class hash<unsigned long>; -template class hash<float>; -template class hash<double>; -template class hash<long double>; -template class hash<void*>; -template class hash<std::string>; +template class std::tr1::hash<bool>; +template class std::tr1::hash<char>; +template class std::tr1::hash<signed char>; +template class std::tr1::hash<unsigned char>; +template class std::tr1::hash<short>; +template class std::tr1::hash<int>; +template class std::tr1::hash<long>; +template class std::tr1::hash<unsigned short>; +template class std::tr1::hash<unsigned int>; +template class std::tr1::hash<unsigned long>; +template class std::tr1::hash<float>; +template class std::tr1::hash<double>; +template class std::tr1::hash<long double>; +template class std::tr1::hash<void*>; +template class std::tr1::hash<std::string>; #ifdef _GLIBCXX_USE_WCHAR_T -template class hash<wchar_t>; -template class hash<std::wstring>; +template class std::tr1::hash<wchar_t>; +template class std::tr1::hash<std::wstring>; #endif diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/explicit_instantiation.cc index f659817d72f..60ac8a5bef1 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_map/requirements/explicit_instantiation.cc @@ -30,13 +30,13 @@ using std::allocator; using std::pair; using std::equal_to; -template class unordered_map<string, float>; -template class unordered_map<string, int, +template class std::tr1::unordered_map<string, float>; +template class std::tr1::unordered_map<string, int, hash<string>, equal_to<string>, allocator<pair<const string, int> > >; -template class unordered_map<string, float, +template class std::tr1::unordered_map<string, float, hash<string>, equal_to<string>, allocator<char> >; -template class __unordered_map<string, int, +template class std::tr1::__unordered_map<string, int, hash<string>, equal_to<string>, allocator<pair<const string, int> >, true>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/explicit_instantiation.cc index 5b72ae9b8eb..e92da828ff5 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multimap/requirements/explicit_instantiation.cc @@ -30,13 +30,13 @@ using std::equal_to; using std::allocator; using std::pair; -template class unordered_multimap<string, float>; -template class unordered_multimap<string, int, +template class std::tr1::unordered_multimap<string, float>; +template class std::tr1::unordered_multimap<string, int, hash<string>, equal_to<string>, allocator<pair<const string, int> > >; -template class unordered_multimap<string, float, +template class std::tr1::unordered_multimap<string, float, hash<string>, equal_to<string>, allocator<char> >; -template class __unordered_multimap<string, int, +template class std::tr1::__unordered_multimap<string, int, hash<string>, equal_to<string>, allocator<pair<const string, int> >, true>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/explicit_instantiation.cc index a1605266c8c..662184beed6 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_multiset/requirements/explicit_instantiation.cc @@ -27,10 +27,10 @@ using namespace std::tr1; using std::equal_to; using std::allocator; -template class unordered_multiset<int>; -template class unordered_multiset<float, hash<float>, equal_to<float>, +template class std::tr1::unordered_multiset<int>; +template class std::tr1::unordered_multiset<float, hash<float>, equal_to<float>, allocator<float> >; -template class unordered_multiset<int, hash<int>, equal_to<int>, +template class std::tr1::unordered_multiset<int, hash<int>, equal_to<int>, allocator<char> >; -template class __unordered_multiset<float, hash<float>, equal_to<float>, +template class std::tr1::__unordered_multiset<float, hash<float>, equal_to<float>, allocator<float>, true>; diff --git a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/explicit_instantiation.cc index 15679e1e629..5d4d83d743e 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/unordered_set/requirements/explicit_instantiation.cc @@ -27,10 +27,10 @@ using namespace std::tr1; using std::equal_to; using std::allocator; -template class unordered_set<int>; -template class unordered_set<float, hash<float>, equal_to<float>, - allocator<float> >; -template class unordered_set<int, hash<int>, equal_to<int>, - allocator<char> >; -template class __unordered_set<float, hash<float>, equal_to<float>, - allocator<float>, true>; +template class std::tr1::unordered_set<int>; +template class std::tr1::unordered_set<float, hash<float>, equal_to<float>, + allocator<float> >; +template class std::tr1::unordered_set<int, hash<int>, equal_to<int>, + allocator<char> >; +template class std::tr1::__unordered_set<float, hash<float>, equal_to<float>, + allocator<float>, true>; |