Martin Liska [Wed, 26 Jul 2017 08:52:37 +0000 (10:52 +0200)]
Move non-local goto expansion after parm_birth_insn (PR sanitize/81186).
2017-07-26 Martin Liska <mliska@suse.cz>
PR sanitize/81186
* function.c (expand_function_start): Make expansion of
nonlocal_goto_save_area after parm_birth_insn.
2017-07-26 Martin Liska <mliska@suse.cz>
PR sanitize/81186
* gcc.dg/asan/pr81186.c: New test.
Carl Love [Tue, 25 Jul 2017 23:16:25 +0000 (23:16 +0000)]
extend.texi: Update the built-in documentation file for the existing built-in functions...
gcc/ChangeLog:
2017-07-25 Carl Love <cel@us.ibm.com>
* doc/extend.texi: Update the built-in documentation file for the
existing built-in functions
vector signed char vec_cnttz (vector signed char);
vector unsigned char vec_cnttz (vector unsigned char);
vector signed short vec_cnttz (vector signed short);
vector unsigned short vec_cnttz (vector unsigned short);
vector signed int vec_cnttz (vector signed int);
vector unsigned int vec_cnttz (vector unsigned int);
vector signed long long vec_cnttz (vector signed long long);
vector unsigned long long vec_cnttz (vector unsigned long long);
gcc/testsuite/ChangeLog:
2017-07-25 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/builtins-4-p9-runnable.c: Add test file for
vec_cnttz builtins.
Ian Lance Taylor [Tue, 25 Jul 2017 22:54:23 +0000 (22:54 +0000)]
compiler: clean up unresolved placeholders for pointer types
Add a new helper routine Type::finish_pointer_types that walks through
the pointer type cache and looks for placeholder types that may have
been created at some point before conversion of named types, and
invokes Type::finish_backend() on said placeholders. This is needed
to handle cases where the compiler manufactures a pointer type as part
of lowering, then a placeholder is created for it due to a call to
Type::backend_type_size(), but there is no explicit reference to the
type in user code.
Jonathan Wakely [Tue, 25 Jul 2017 17:47:52 +0000 (18:47 +0100)]
Remove deprecated iostream members for C++17
* include/bits/ios_base.h (ios_base::io_state, ios_base::open_mode)
(ios_base::seek_dir): Remove for C++17.
* include/std/streambuf (basic_streambuf::stossc): Remove for C++17.
Add deprecated attribute for C++11 and C++14.
* testsuite/27_io/types/1.cc: Don't run for C++17 and later.
* testsuite/27_io/types/4.cc: New.
Jim Wilson [Tue, 25 Jul 2017 16:06:37 +0000 (16:06 +0000)]
Fix i686-pc-cygwin build failure.
gcc/
PR bootstrap/81521
* config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition): Look
for FUNCTION_DECLs in TYPE_FIELDS rather than TYPE_METHODS.
i386.c (ix86_decompose_address): Do not check for register RTX when looking at index_reg or base_reg.
* config/i386/i386.c (ix86_decompose_address): Do not check for
register RTX when looking at index_reg or base_reg.
* config/i386/i386.h (INCOMING_RETURN_ADDR_RTX): Use stack_pointer_rtx.
Eric Botcazou [Tue, 25 Jul 2017 14:47:16 +0000 (14:47 +0000)]
gimple.c (gimple_assign_set_rhs_with_ops): Do not ask gsi_replace to update EH info here.
* gimple.c (gimple_assign_set_rhs_with_ops): Do not ask gsi_replace
to update EH info here.
ada/
* checks.adb (Apply_Divide_Checks): Ensure that operands are not
evaluated twice.
c-attribs.c (c_common_attribute_table): Add entry for "patchable_function_entry".
2017-07-07 Torsten Duwe <duwe@suse.de>
c-family/
* c-attribs.c (c_common_attribute_table): Add entry for
"patchable_function_entry".
lto/
* lto-lang.c (lto_attribute_table): Add entry for
"patchable_function_entry".
* common.opt: Introduce -fpatchable-function-entry
command line option, and its variables function_entry_patch_area_size
and function_entry_patch_area_start.
* opts.c (common_handle_option): Add -fpatchable_function_entry_ case,
including a two-value parser.
* target.def (print_patchable_function_entry): New target hook.
* targhooks.h (default_print_patchable_function_entry): New function.
* targhooks.c (default_print_patchable_function_entry): Likewise.
* toplev.c (process_options): Switch off IPA-RA if
patchable function entries are being generated.
* varasm.c (assemble_start_function): Look at the
patchable-function-entry command line switch and current
function attributes and maybe generate NOP instructions by
calling the print_patchable_function_entry hook.
* doc/extend.texi: Document patchable_function_entry attribute.
* doc/invoke.texi: Document -fpatchable_function_entry
command line option.
* doc/tm.texi.in (TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY):
New target hook.
* doc/tm.texi: Re-generate.
* c-c++-common/patchable_function_entry-default.c: New test.
* c-c++-common/patchable_function_entry-decl.c: Likewise.
* c-c++-common/patchable_function_entry-definition.c: Likewise.
David Edelsohn [Tue, 25 Jul 2017 13:11:37 +0000 (13:11 +0000)]
dwarf2asm.c (dw2_asm_output_nstring): Encode double quote character for AIX.
* dwarf2asm.c (dw2_asm_output_nstring): Encode double quote
character for AIX.
* dwarf2out.c (output_macinfo): Copy debug_line_section_label
to dl_section_ref. On AIX, append an expression to subtract
the size of the section length to dl_section_ref.
Do not silently continue if config.{build,host,gcc} fails
If config.{build,host,gcc} fails, configure currently silently
continues. This then makes it much harder than necessary to notice
you made a stupid pasto in config.gcc (and where exactly).
* configure.ac: If any of the config.* scripts fail, exit 1.
* configure: Regenerate.
Martin Liska [Tue, 25 Jul 2017 10:20:23 +0000 (12:20 +0200)]
Fix wrong condition in ipa-visibility.c (PR ipa/81520).
2017-07-25 Martin Liska <mliska@suse.cz>
PR ipa/81520
* ipa-visibility.c (function_and_variable_visibility): Make the redirection
just on target that do supporting aliasing. Fix GNU coding style.
2017-07-25 Martin Liska <mliska@suse.cz>
Marek Polacek [Tue, 25 Jul 2017 09:49:08 +0000 (09:49 +0000)]
re PR c/81364 (Bogus -Wmultistatement-macros warning)
PR c/81364
* c-parser.c (c_parser_else_body): Don't warn about multistatement
macro expansion if the body is in { }.
(c_parser_while_statement): Likewise.
(c_parser_for_statement): Likewise.
Daniel Santos [Mon, 24 Jul 2017 22:00:35 +0000 (22:00 +0000)]
PR testsuite/80759 Fix broken tests in ms-sysv.exp
2017-07-24 Daniel Santos <daniel.santos@pobox.com>
PR testsuite/80759
* gcc.target/x86_64/abi/ms-sysv/do-test.S
(ELFFN_BEGIN): Rename to FN_TYPE.
(ELFFN_END): Rename to FN_SIZE.
(ASMNAME): New macro.
(FUNC): Rename to FUNC_BEGIN, use ASMNAME and use .globl instead of
.global.
(FUNC_END): Use ASMNAME.
(test_data_save): Remove.
(test_data_input): Likewise.
(test_data_output: Likewise.
(test_data_fn): Likewise.
(test_data_retaddr): Likewise.
(regs_to_mem): Make globals, use r10 instead of rax.
(mem_to_regs): Likewise.
(do_test_unaligned): Remove .cfi directives, remove pushf/popf, move
body to ms-sysv.c.
(do_test_aligned): Likewise.
* gcc.target/x86_64/abi/ms-sysv/ms-sysv.c:
Add dg-* directives.
(PASTE_STR): New macro.
(ASMNAME): Likewise.
(LOAD_TEST_DATA_ADDR): Likewise.
(TEST_DATA_OFFSET): Likewise.
(do_test_body0): New C function.
(do_test_body): New inline assembly routine.
* gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp
(runtest_ms_sysv): Modify.
Daniel Santos [Mon, 24 Jul 2017 21:59:57 +0000 (21:59 +0000)]
PR testsuite/80759 Fix -mcall-ms2sysv-xlogues on Darwin and Solaris
2017-07-24 Daniel Santos <daniel.santos@pobox.com>
PR testsuite/80759
* config.host: include i386/t-msabi for darwin and solaris.
* config/i386/i386-asm.h
(ELFFN): Rename to FN_TYPE.
(FN_SIZE): New macro.
(FN_HIDDEN): Likewise.
(ASMNAME): Likewise.
(FUNC_START): Rename to FUNC_BEGIN, use ASMNAME, replace .global with
.globl.
(HIDDEN_FUNC): Use ASMNAME and .globl instead of .global.
(SSE_SAVE): Convert to cpp macro, hard-code offset (always 0x60).
* config/i386/resms64.S: Use SSE_SAVE as cpp macro instead of gas
.macro.
* config/i386/resms64f.S: Likewise.
* config/i386/resms64fx.S: Likewise.
* config/i386/resms64x.S: Likewise.
* config/i386/savms64.S: Likewise.
* config/i386/savms64f.S: Likewise.
cfgrtl: Don't crash in rtl_dump_bb if BB_END(bb) is NULL
Currently rtl_dump_bb crashes if BB_END(bb) is NULL, like it can be
during expand (rtl_dump_bb can be called at any time, by the emergency
dump added recently for example).
This fixes it.
* cfgrtl.c (rtl_dump_bb): Don't call NEXT_INSN on NULL.
re PR target/79041 (aarch64 backend emits R_AARCH64_ADR_PREL_PG_HI21 relocation despite -mpc-relative-literal-loads option being used)
Fix PR79041
As described in PR79041, -mcmodel=large -mpc-relative-literal-loads
may be used to avoid generating ADRP/ADD or ADRP/LDR. However both
trunk and GCC7 may still emit ADRP for some constant pool literals.
Fix this by adding a aarch64_pcrelative_literal_loads check.
gcc/
PR target/79041
* config/aarch64/aarch64.c (aarch64_classify_symbol):
Avoid SYMBOL_SMALL_ABSOLUTE for literals with pc-relative literals
gcc/testsuite/
* gcc.target/aarch64/pr79041-2.c: New test.
Michael Collison [Sun, 23 Jul 2017 22:46:34 +0000 (22:46 +0000)]
Add optimized implementation of mersenne twister for aarch64
2017-07-23 Michael Collison <michael.collison@arm.com>
Add optimized implementation of mersenne twister for aarch64
* config/cpu/aarch64/opt/ext/opt_random.h: New file.
(__arch64_recursion): New function.
(__aarch64_lsr_128): New function.
(__aarch64_lsl_128): New function.
(operator==): New function.
(simd_fast_mersenne_twister_engine): Implement
method _M_gen_rand.
* config/cpu/aarch64/opt/bits/opt_random.h: New file.
* include/ext/random: (simd_fast_mersenne_twister_engine):
add _M_state private array.
Ian Lance Taylor [Fri, 21 Jul 2017 20:25:13 +0000 (20:25 +0000)]
syscall: call f?statfs64 on GNU/Linux
We unconditionally set _FILE_OFFSET_BITS to 64 in configure.ac, so we
should unconditionally call the statfs64 and fstatfs64 functions.
These functions should be available on all versions of GNU/Linux since 2.6.
On 64-bit systems they are aliased to statfs/fstatfs, and on 32-bit
systems they use the 64-bit data structures.
Ian Lance Taylor [Fri, 21 Jul 2017 18:27:35 +0000 (18:27 +0000)]
runtime: don't use runtime_lock in __go_get_backtrace_state
If getSiginfo does not know how to determine the PC, it will call
runtime_callers. That can happen in a thread that was started by
non-Go code, in which case the TLS variable g will not be set, in
which case runtime_lock will crash.
Avoid the problem by using atomic operations for the lock. This is OK
since creating a backtrace state is fast and never blocks.
The test case is TestCgoExternalThreadSIGPROF in the runtime package
on a system that getSiginfo doesn't handle specially.
Steven Munroe [Fri, 21 Jul 2017 17:44:22 +0000 (17:44 +0000)]
Now completeting the mmintrin.h intrinsic headers for PowerPC by
adding the DG tests.
2017-07-21 Steven Munroe <munroesj@gcc.gnu.org>
* gcc.target/powerpc/mmx-check.h: New file.
* gcc.target/powerpc/mmx-packs.c: New file.
* gcc.target/powerpc/mmx-packssdw-1.c: New file.
* gcc.target/powerpc/mmx-packsswb-1.c: New file.
* gcc.target/powerpc/mmx-packuswb-1.c: New file.
* gcc.target/powerpc/mmx-paddb-1.c: New file.
* gcc.target/powerpc/mmx-paddd-1.c: New file.
* gcc.target/powerpc/mmx-paddsb-1.c: New file.
* gcc.target/powerpc/mmx-paddsw-1.c: New file.
* gcc.target/powerpc/mmx-paddusb-1.c: New file.
* gcc.target/powerpc/mmx-paddusw-1.c: New file.
* gcc.target/powerpc/mmx-paddw-1.c: New file.
* gcc.target/powerpc/mmx-pcmpeqb-1.c: New file.
* gcc.target/powerpc/mmx-pcmpeqd-1.c: New file.
* gcc.target/powerpc/mmx-pcmpeqw-1.c: New file.
* gcc.target/powerpc/mmx-pcmpgtb-1.c: New file.
* gcc.target/powerpc/mmx-pcmpgtd-1.c: New file.
* gcc.target/powerpc/mmx-pcmpgtw-1.c: New file.
* gcc.target/powerpc/mmx-pmaddwd-1.c: New file.
* gcc.target/powerpc/mmx-pmulhw-1.c: New file.
* gcc.target/powerpc/mmx-pmullw-1.c: New file.
* gcc.target/powerpc/mmx-pslld-1.c: New file.
* gcc.target/powerpc/mmx-psllw-1.c: New file.
* gcc.target/powerpc/mmx-psrad-1.c: New file.
* gcc.target/powerpc/mmx-psraw-1.c: New file.
* gcc.target/powerpc/mmx-psrld-1.c: New file.
* gcc.target/powerpc/mmx-psrlw-1.c: New file.
* gcc.target/powerpc/mmx-psubb-2.c: New file.
* gcc.target/powerpc/mmx-psubd-2.c: New file.
* gcc.target/powerpc/mmx-psubsb-1.c: New file.
* gcc.target/powerpc/mmx-psubsw-1.c: New file.
* gcc.target/powerpc/mmx-psubusb-1.c: New file.
* gcc.target/powerpc/mmx-psubusw-1.c: New file.
* gcc.target/powerpc/mmx-psubw-2.c: New file.
* gcc.target/powerpc/mmx-punpckhbw-1.c: New file.
* gcc.target/powerpc/mmx-punpckhdq-1.c: New file.
* gcc.target/powerpc/mmx-punpckhwd-1.c: New file.
* gcc.target/powerpc/mmx-punpcklbw-1.c: New file.
* gcc.target/powerpc/mmx-punpckldq-1.c: New file.
* gcc.target/powerpc/mmx-punpcklwd-1.c: New file.
Andrew Pinski [Fri, 21 Jul 2017 17:16:51 +0000 (17:16 +0000)]
tree-ssa-sccvn.c (vn_nary_op_eq): Check BIT_INSERT_EXPR's operand 1 to see if the types precision matches.
2017-07-21 Andrew Pinski <apinski@cavium.com>
* tree-ssa-sccvn.c (vn_nary_op_eq): Check BIT_INSERT_EXPR's
operand 1 to see if the types precision matches.
* fold-const.c (operand_equal_p): Likewise.
re PR lto/81487 ([mingw32] ld.exe: error: asprintf failed)
lto-plugin/
PR lto/81487
* lto-plugin.c (claim_file_handler): Use xasprintf instead of
asprintf.
[hi!=0]: Swap hi and lo arguments supplied to xasprintf.
Richard Biener [Fri, 21 Jul 2017 11:32:39 +0000 (11:32 +0000)]
re PR tree-optimization/81303 (410.bwaves regression caused by r249919)
2017-07-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/81303
* tree-vect-data-refs.c (vect_get_peeling_costs_all_drs): Pass
in datarefs vector. Allow NULL dr0 for no peeling cost estimate.
(vect_peeling_hash_get_lowest_cost): Adjust.
(vect_enhance_data_refs_alignment): Likewise. Use
vect_get_peeling_costs_all_drs to compute the penalty for no
peeling to match up costs.
Jan Hubicka [Fri, 21 Jul 2017 07:17:22 +0000 (09:17 +0200)]
bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges): Put all BBs reachable only via paths crossing cold region to cold region.
* bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges):
Put all BBs reachable only via paths crossing cold region to cold
region.
* cfgrtl.c (find_bbs_reachable_by_hot_paths): New function.
Richard Biener [Fri, 21 Jul 2017 07:13:57 +0000 (07:13 +0000)]
re PR tree-optimization/81303 (410.bwaves regression caused by r249919)
2016-07-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/81303
* tree-vect-loop.c (vect_estimate_min_profitable_iters): Take
into account prologue and epilogue iterations when raising
min_profitable_iters to sth at least covering one vector iteration.
gcc/
Remove TYPE_METHODS.
* tree.h (TYPE_METHODS): Delete.
* dwarf2out.c (gen_member_die): Member fns are on TYPE_FIELDS.
* dbxout.c (dbxout_type_fields): Ignore FUNCTION_DECLs.
(dbxout_type_methods): Scan TYPE_FIELDS.
(dbxout_type): Don't check TYPE_METHODS here.
* function.c (use_register_for_decl): Always ignore register for
class types when not optimizing.
* ipa-devirt.c (odr_types_equivalent_p): Delete TYPE_METHODS scan.
* tree.c (free_lang_data_in_type): Stitch out member functions and
templates from TYPE_FIELDS.
(build_distinct_type_copy, verify_type_variant,
verify_type): Member fns are on TYPE_FIELDS.
* tree-dump.c (dequeue_and_dump): No TYPE_METHODS.
* tree-pretty-print.c (dump_generic_node): Likewise.
gcc/c-family/
Remove TYPE_METHODS.
* c-ada-spec.c (is_tagged_type, has_nontrivial_methods,
dump_ada_template, print_ada_methods,
print_ada_declaration): Member fns are on TYPE_FIELDS.
gcc/objc/
Remove TYPE_METHODS.
* objc-runtime-shared-support.c (build_ivar_list_initializer):
Don't presume first item is a FIELD_DECL.
Ian Lance Taylor [Thu, 20 Jul 2017 19:53:54 +0000 (19:53 +0000)]
compiler: add explicit convert in Type_guard_expression::do_get_backend
The current recipe in Type_guard_expression for creating a Bexpression
performs a type conversion at the Type level, but doesn't invoke
Backend::convert_expression to capture the conversion for the back
end. Add code to create a BE type conversion operation.
Jakub Jelinek [Thu, 20 Jul 2017 16:36:18 +0000 (18:36 +0200)]
re PR target/80846 (auto-vectorized AVX2 horizontal sum should narrow to 128b right away, to be more efficient for Ryzen and Intel)
PR target/80846
* config/i386/i386.c (ix86_expand_vector_init_general): Handle
V2TImode and V4TImode.
(ix86_expand_vector_extract): Likewise.
* config/i386/sse.md (VMOVE): Enable V4TImode even for just
TARGET_AVX512F, instead of only for TARGET_AVX512BW.
(ssescalarmode): Handle V4TImode and V2TImode.
(VEC_EXTRACT_MODE): Add V4TImode and V2TImode.
(*vec_extractv2ti, *vec_extractv4ti): New insns.
(VEXTRACTI128_MODE): New mode iterator.
(splitter for *vec_extractv?ti first element): New.
(VEC_INIT_MODE): New mode iterator.
(vec_init<mode>): Consolidate 3 expanders into one using
VEC_INIT_MODE mode iterator.
* gcc.target/i386/avx-pr80846.c: New test.
* gcc.target/i386/avx2-pr80846.c: New test.
* gcc.target/i386/avx512f-pr80846.c: New test.
* gimple.h (gimple_phi_result): Add gphi * overload.
(gimple_phi_result_ptr): Likewise.
(gimple_phi_arg): Likewise. Adjust index assert to only
allow actual argument accesses rather than all slots available
by capacity.
(gimple_phi_arg_def): Add gphi * overload.
* tree-phinodes.c (make_phi_node): Initialize only actual
arguments.
(resize_phi_node): Clear memory not covered by old node,
do not initialize excess argument slots.
(reserve_phi_args_for_new_edge): Initialize new argument slot
completely.
Richard Biener [Thu, 20 Jul 2017 11:17:21 +0000 (11:17 +0000)]
re PR tree-optimization/61171 (vectorization fails for a reduction in presence of subtraction)
2017-07-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/61171
* tree-vectorizer.h (slp_instance): Add reduc_phis member.
(vect_analyze_stmt): Add slp instance parameter.
(vectorizable_reduction): Likewise.
* tree-vect-loop.c (vect_analyze_loop_operations): Adjust.
(vect_is_simple_reduction): Deal with chains not detected
as SLP reduction chain, specifically not properly associated
chains containing a mix of plus/minus.
(get_reduction_op): Remove.
(get_initial_defs_for_reduction): Simplify, pass in whether
this is a reduction chain, pass in the SLP node for the PHIs.
(vect_create_epilog_for_reduction): Get the SLP instance as
arg and adjust.
(vectorizable_reduction): Get the SLP instance as arg.
During analysis remember the SLP node with the PHIs in the
instance. Simplify getting at the vectorized reduction PHIs.
* tree-vect-slp.c (vect_slp_analyze_node_operations): Pass
through SLP instance.
(vect_slp_analyze_operations): Likewise.
* tree-vect-stms.c (vect_analyze_stmt): Likewise.
(vect_transform_stmt): Likewise.
* g++.dg/vect/pr61171.cc: New testcase.
* gfortran.dg/vect/pr61171.f: Likewise.
* gcc.dg/vect/vect-reduc-11.c: Likewise.