Commit Graph

159310 Commits

Author SHA1 Message Date
Claudiu Zissulescu 7778a1ad1f [ARC] Add SJLI support.
gcc/
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>

        * config/arc/arc-protos.h: Add arc_is_secure_call_p proto.
        * config/arc/arc.c (arc_handle_secure_attribute): New function.
        (arc_attribute_table): Add 'secure_call' attribute.
        (arc_print_operand): Print secure call operand.
        (arc_function_ok_for_sibcall): Don't optimize tail calls when
        secure.
        (arc_is_secure_call_p): New function.
        * config/arc/arc.md (call_i): Add support for sjli instruction.
        (call_value_i): Likewise.
        * config/arc/constraints.md (Csc): New constraint.

From-SVN: r257082
2018-01-26 12:33:42 +01:00
Claudiu Zissulescu 6b55f8c92b [ARC] Add JLI support.
The ARCv2 ISA provides the JLI instruction, which is two-byte instructions
that can be used to reduce code size in an application. To make use of it,
we provide two new function attributes 'jli_always' and 'jli_fixed' which
will force the compiler to call the indicated function using a jli_s
instruction. The compiler also generates the entries in the JLI table for
the case when we use 'jli_always' attribute. In the case of 'jli_fixed'
the compiler assumes a fixed position of the function into JLI
table. Thus, the user needs to provide an assembly file with the JLI table
for the final link. This is usefully when we want to have a table in ROM
and a second table in the RAM memory.

The jli instruction usage can be also forced without the need to annotate
the source code via '-mjli-always' command.

gcc/
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
            John Eric Martin <John.Martin@emmicro-us.com>

        * config/arc/arc-protos.h: Add arc_is_jli_call_p proto.
        * config/arc/arc.c (_arc_jli_section): New struct.
        (arc_jli_section): New type.
        (rc_jli_sections): New static variable.
        (arc_handle_jli_attribute): New function.
        (arc_attribute_table): Add jli_always and jli_fixed attribute.
        (arc_file_end): New function.
        (TARGET_ASM_FILE_END): Define.
        (arc_print_operand): Reuse 'S' letter for JLI output instruction.
        (arc_add_jli_section): New function.
        (jli_call_scan): Likewise.
        (arc_reorg): Call jli_call_scan.
        (arc_output_addsi): Remove 'S' from printing asm operand.
        (arc_is_jli_call_p): New function.
        * config/arc/arc.md (movqi_insn): Remove 'S' from printing asm
        operand.
        (movhi_insn): Likewise.
        (movsi_insn): Likewise.
        (movsi_set_cc_insn): Likewise.
        (loadqi_update): Likewise.
        (load_zeroextendqisi_update): Likewise.
        (load_signextendqisi_update): Likewise.
        (loadhi_update): Likewise.
        (load_zeroextendhisi_update): Likewise.
        (load_signextendhisi_update): Likewise.
        (loadsi_update): Likewise.
        (loadsf_update): Likewise.
        (movsicc_insn): Likewise.
        (bset_insn): Likewise.
        (bxor_insn): Likewise.
        (bclr_insn): Likewise.
        (bmsk_insn): Likewise.
        (bicsi3_insn): Likewise.
        (cmpsi_cc_c_insn): Likewise.
        (movsi_ne): Likewise.
        (movsi_cond_exec): Likewise.
        (clrsbsi2): Likewise.
        (norm_f): Likewise.
        (normw): Likewise.
        (swap): Likewise.
        (divaw): Likewise.
        (flag): Likewise.
        (sr): Likewise.
        (kflag): Likewise.
        (ffs): Likewise.
        (ffs_f): Likewise.
        (fls): Likewise.
        (call_i): Remove 'S' asm letter, add jli instruction.
        (call_value_i): Likewise.
        * config/arc/arc.op (mjli-always): New option.
        * config/arc/constraints.md (Cji): New constraint.
        * config/arc/fpx.md (addsf3_fpx): Remove 'S' from printing asm
        operand.
        (subsf3_fpx): Likewise.
        (mulsf3_fpx): Likewise.
        * config/arc/simdext.md (vendrec_insn): Remove 'S' from printing
        asm operand.
        * doc/extend.texi (ARC): Document 'jli-always' and 'jli-fixed'
        function attrbutes.
        * doc/invoke.texi (ARC): Document mjli-always option.

gcc/testsuite
2018-01-26  Claudiu Zissulescu  <claziss@synopsys.com>

        * gcc.target/arc/jli-1.c: New file.
        * gcc.target/arc/jli-2.c: Likewise.

Co-Authored-By: John Eric Martin <John.Martin@emmicro-us.com>

From-SVN: r257081
2018-01-26 12:33:22 +01:00
Sebastian Perta c921c45fdb Corrected date in changelog
From-SVN: r257080
2018-01-26 10:57:53 +00:00
Sebastian Perta b0679a787b rl78.c: if operand 2 is const avoid addition with 0 and use incw and decw where possible
2018-01-25  Sebastian Perta  <sebastian.perta@renesas.com>

	* config/rl78/rl78.c: if operand 2 is const avoid addition with 0
	and use incw and decw where possible
	* testsuite/gcc.target/rl78/test_addsi3_internal.c: new file

From-SVN: r257079
2018-01-26 10:55:31 +00:00
Szabolcs Nagy 0547173960 Fix gcc.target/aarch64/sve/peel_ind_1.c for -mcmodel=tiny
gcc/testsuite/ChangeLog:

2018-01-26  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* gcc.target/aarch64/sve/peel_ind_1.c: Match (adrp|adr) in scan-assembler.
	* gcc.target/aarch64/sve/peel_ind_2.c: Likewise.
	* gcc.target/aarch64/sve/peel_ind_3.c: Likewise.

From-SVN: r257078
2018-01-26 10:46:56 +00:00
Richard Biener 5b55e6e333 re PR tree-optimization/81082 (Failure to vectorise after reassociating index computation)
2018-01-26  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/81082
	* fold-const.c (fold_plusminus_mult_expr): Do not perform the
	association if it requires casting to unsigned.
	* match.pd ((A * C) +- (B * C) -> (A+-B)): New patterns derived
	from fold_plusminus_mult_expr to catch important cases late when
	range info is available.

	* gcc.dg/vect/pr81082.c: New testcase.
	* gcc.dg/tree-ssa/loop-15.c: XFAIL the (int)((unsigned)n + -1U) * n + n
	simplification to n * n.

From-SVN: r257077
2018-01-26 10:30:36 +00:00
Rainer Orth af2e3244f5 Configure USE_HIDDEN_LINKONCE on Solaris/x86
gcc/testsuite:
	* gcc.target/i386/mcount_pic.c: Only xfail get_pc_thunk scan on
	Solaris 10.
	* gcc.target/i386/pr63620.c: Likewise.

	gcc:
	* config/i386/sol2.h (USE_HIDDEN_LINKONCE): Remove.
	* configure.ac (hidden_linkonce): New test.
	* configure: Regenerate.
	* config.in: Regenerate.

From-SVN: r257076
2018-01-26 08:32:21 +00:00
Julia Koval aad36c569d Fix various x86 avx512{bitalg, vpopcntdq, vbmi2} issues (PR target/83488)
gcc/
	* config/i386/avx512bitalgintrin.h (_mm512_bitshuffle_epi64_mask,
	_mm512_mask_bitshuffle_epi64_mask, _mm256_bitshuffle_epi64_mask,
	_mm256_mask_bitshuffle_epi64_mask, _mm_bitshuffle_epi64_mask,
	_mm_mask_bitshuffle_epi64_mask): Fix type.
	* config/i386/i386-builtin-types.def (UHI_FTYPE_V2DI_V2DI_UHI,
	USI_FTYPE_V4DI_V4DI_USI): Remove.
	* config/i386/i386-builtin.def (__builtin_ia32_vpshufbitqmb512_mask,
	__builtin_ia32_vpshufbitqmb256_mask,
	__builtin_ia32_vpshufbitqmb128_mask): Fix types.
	* config/i386/i386.c (ix86_expand_args_builtin): Remove old types.
	* config/i386/sse.md (VI1_AVX512VLBW): Change types.

gcc/testsuite/
	* gcc.target/i386/avx512bitalg-vpshufbitqmb-1.c: Add -mavx512f -mavx512bw.
	* gcc.target/i386/avx512bitalgvl-vpshufbitqmb-1.c: Add -mavx512bw.
	* gcc.target/i386/i386.exp: Fix types.

From-SVN: r257075
2018-01-26 04:14:15 +00:00
GCC Administrator 09e2984ff8 Daily bump.
From-SVN: r257073
2018-01-26 00:16:20 +00:00
Alan Modra 73598b3330 PR84033, powerpc64le -moptimize-swaps bad code with vec_vbpermq
vbpermq produces its output in bits 48..63 of the target vector reg,
so the output cannot be lane swapped.

gcc/
	PR target/84033
	* config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Exclude
	UNSPEC_VBPERMQ.  Sort other unspecs.
gcc/testsuite/
	PR target/84033
	* gcc.target/powerpc/swaps-p8-46.c: New.

From-SVN: r257070
2018-01-26 10:27:18 +10:30
Ian Lance Taylor 1bfbe9adbc compiler: look through aliases when looking for methods
Add a Type::is_alias method to remove some existing loops and avoid
    adding a new one.
    
    Test case is https://golang.org/cl/89935.
    
    Fixes golang/go#23489
    
    Reviewed-on: https://go-review.googlesource.com/89975

From-SVN: r257069
2018-01-25 23:13:31 +00:00
Ian Lance Taylor a14e122ae2 compiler: deref receiver types in mangled names
This was the original intent, as reflected in the long comment at the
    start of names.cc, but I forgot to implement it.
    
    Also, remove a leading ".0" from the final name.  That could occur for
    a method whose receiver type starts with 'u', as in that case we
    prepend a space to the mangled name, to avoid confusion with the
    Unicode mangling, and the space turns into ".0".
    
    Also, if the Unicode encoding would cause the final to start with
    "..u" or "..U", add a leading underscore.
    
    Patch gotest to not get fooled by some names.
    
    The result of these changes is that all symbols start with a letter or
    an underscore.
    
    Reviewed-on: https://go-review.googlesource.com/90015

From-SVN: r257068
2018-01-25 23:10:35 +00:00
David Malcolm 9aba6f77b4 jit: remove some unused fields from recording::union_ (PR jit/81672)
gcc::jit::recording::union_ has some stray fields, which
are duplicates of those in the compound_type base class.

It looks like these have been present since the initial merger of the jit
branch to trunk (r217374), where it had three duplicate fields:

 location *m_loc;
 string *m_name;
 fields *m_fields;

I removed the duplicate field "m_fields" in r219564 but missed the other
two.

This patch removes them.

gcc/jit/ChangeLog:
	PR jit/81672
	* jit-recording.h (gcc::jit::recording::union_): Remove fields
	"m_loc" and "m_name".

From-SVN: r257066
2018-01-25 19:19:29 +00:00
Paul Thomas 7fb43006b2 re PR fortran/37577 ([meta-bug] change internal array descriptor format for better syntax, C interop TR, rank 15)
2018-25-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37577
	* array.c (gfc_match_array_ref): If standard earlier than F2008
	it is an error if the reference dimension is greater than 7.
	libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
	dtype masks and shifts accordingly.
	* trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
	type node to check the field.
	(gfc_conv_descriptor_dtype): Access the rank field of dtype.
	(duplicate_allocatable_coarray): Access the rank field of the
	dtype descriptor rather than the dtype itself.
	* trans-expr.c (get_scalar_to_descriptor_type): Store the type
	of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
	(ie. a character).
	(gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
	get_scalar_to_descriptor_type if the actual expression is a
	constant.
	(gfc_trans_structure_assign): Assign the rank directly to the
	dtype rank field.
	* trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
	to default integer kind.
	(gfc_conv_intrinsic_sizeof): Obtain the element size from the
	'elem_len' field of the dtype.
	* trans-io.c (gfc_build_io_library_fndecls): Replace
	gfc_int4_type_node with dtype_type_node where necessary.
	(transfer_namelist_element): Use gfc_get_dtype_rank_type for
	scalars.
	* trans-types.c : Provide 'get_dtype_type_node' to acces the
	dtype_type_node and, if necessary, build it.
	The maximum size of an array element is now determined by the
	maximum value of size_t.
	Update the description of the array descriptor, including the
	type def for the dtype_type.
	(gfc_get_dtype_rank_type): Build a constructor for the dtype.
	Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
	(gfc_get_array_descriptor_base): Change the type of the dtype
	field to dtype_type_node.
	(gfc_get_array_descr_info): Get the offset to the rank field of
	the dtype.
	* trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
	* trans.h : Define the indices of the dtype fields.

2018-25-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37577
	* gfortran.dg/coarray_18.f90: Allow dimension 15 for F2008.
	* gfortran.dg/coarray_lib_this_image_2.f90: Change 'array1' to
	'array01' in the tree dump comparison.
	* gfortran.dg/coarray_lib_token_4.f90: Likewise.
	* gfortran.dg/inline_sum_1.f90: Similar - allow two digits.
	* gfortran.dg/rank_1.f90: Allow dimension 15 for F2008.

2018-25-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/37577
	* caf/single.c (_gfortran_caf_failed_images): Access the 'type'
	and 'elem_len' fields of the dtype instead of the shifts.
	(_gfortran_caf_stopped_images): Likewise.
	* intrinsics/associated.c (associated): Compare the 'type' and
	'elem_len' fields instead of the dtype.
	* caf/date_and_time.c : Access the dtype fields rather using
	shifts and masks.
	* io/transfer.c (transfer_array ): Comment on item count.
	(set_nml_var,st_set_nml_var): Change dtype type and use fields.
	(st_set_nml_dtio_var): Likewise.
	* libgfortran.h : Change definition of GFC_ARRAY_DESCRIPTOR and
	add a typedef for the dtype_type. Change the GFC_DTYPE_* macros
	to access the dtype fields.

From-SVN: r257065
2018-01-25 19:09:40 +00:00
David Edelsohn 09cf48c9de Change -march to -mcpu.
From-SVN: r257064
2018-01-25 13:50:44 -05:00
David Edelsohn a7b145f340 * doc/invoke.texi (PowerPC Options): Document 'native' cpu type.
From-SVN: r257063
2018-01-25 13:25:19 -05:00
Ian Lance Taylor 96f7c2a94a elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the desired CRC is zero.
* elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
	desired CRC is zero.
	(elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.

From-SVN: r257062
2018-01-25 18:14:04 +00:00
Ian Lance Taylor a88d1f8bb2 runtime: fix lfstackUnpack on ia64
The top three region number bits must be masked out before
    right-shifting the address bits into place, otherwise they will be
    copied down into the lower always-zero address bits.
    
    Reviewed-on: https://go-review.googlesource.com/84535

From-SVN: r257061
2018-01-25 17:44:19 +00:00
Jan Hubicka 19e502d413 re PR tree-optimization/83055 (ICE in operator>, at profile-count.h:834)
PR middle-end/83055
	* predict.c (drop_profile): Do not push/pop cfun; update also
	node->count.
	(handle_missing_profiles): Fix logic looking for zero profiles.

	* gcc.dg/torture/pr83055.c: New testcase.

From-SVN: r257059
2018-01-25 17:24:06 +00:00
Jakub Jelinek 41df0109de re PR c++/84031 (structured binding unpacks nameless padding bitfields)
PR c++/84031
	* decl.c (find_decomp_class_base): Ignore unnamed bitfields.  Ignore
	recursive calls that return ret.
	(cp_finish_decomp): Ignore unnamed bitfields.

	* g++.dg/cpp1z/decomp36.C: New test.

From-SVN: r257057
2018-01-25 17:38:40 +01:00
Ian Lance Taylor a794e494c6 * pecoff.c (coff_add): Only release syms_view if it is valid.
From-SVN: r257053
2018-01-25 15:38:41 +00:00
Ian Lance Taylor 45f3ab193d * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
From-SVN: r257052
2018-01-25 15:33:36 +00:00
Jakub Jelinek 3d8fb31133 re PR middle-end/83977 (ICE in simd_clone_clauses_extract, at omp-simd-clone.c:184)
PR middle-end/83977
	* ipa-fnsummary.c (compute_fn_summary): Clear can_change_signature
	on functions with #pragma omp declare simd or functions with simd
	attribute.
	* omp-simd-clone.c (expand_simd_clones): Revert 2018-01-24 change.
	* config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
	Remove trailing \n from warning_at calls.

	* c-c++-common/gomp/pr83977-1.c: Add -w to dg-options.

From-SVN: r257051
2018-01-25 16:32:02 +01:00
Jonathan Wakely 58078de77b PR libstdc++/81076 make __byte_operand SFINAE-friendly
PR libstdc++/81076
	* include/c_global/cstddef (__byte_operand): Define primary template.
	* testsuite/18_support/byte/81076.cc: New test.

From-SVN: r257050
2018-01-25 15:24:39 +00:00
Ian Lance Taylor e3b18df45b compiler: don't write sink constants to C header file
Reviewed-on: https://go-review.googlesource.com/89815

From-SVN: r257049
2018-01-25 15:10:03 +00:00
Tom de Vries e77a1236a7 [nvptx, PR84028] Add exit insn after noreturn call for neutered workers
2018-01-25  Tom de Vries  <tom@codesourcery.com>

	PR target/84028
	* config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
	for neutered workers.

	* testsuite/libgomp.oacc-fortran/pr84028.f90: New test.

From-SVN: r257046
2018-01-25 10:25:14 +00:00
Richard Biener 8819c9199a gcc_release (build_sources): Use getconf to get at the number of cores in the system and pass -jN to gcc_build.
2018-01-25  Richard Biener  <rguenther@suse.de>

	* gcc_release (build_sources): Use getconf to get at the number
	of cores in the system and pass -jN to gcc_build.

From-SVN: r257045
2018-01-25 10:22:38 +00:00
Richard Sandiford b254c1a232 Fix vect-reduc-or_[12].c changes in r257022
I'd somehow thought that the dump lines in these two tests were already
correctly guarded, but they weren't.

2018-01-25  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/testsuite/
	* gcc.dg/vect/vect-reduc-or_1.c: Require whole_vector_shift for
	the shift dump line.
	* gcc.dg/vect/vect-reduc-or_2.c: Likewise.

From-SVN: r257044
2018-01-25 10:21:08 +00:00
Ian Lance Taylor 017707ce06 * pecoff.c (coff_add): Use coff_read4, not memcpy.
From-SVN: r257040
2018-01-25 02:42:26 +00:00
Ian Lance Taylor 3fe3c7d749 re PR other/68239 (libbacktrace allocation is sometimes very slow)
PR other/68239
	* mmap.c (backtrace_free_locked): Don't put more than 16 entries
	on the free list.

From-SVN: r257039
2018-01-25 02:24:45 +00:00
Michael Meissner 533277ba75 re PR target/81550 (gcc.target/powerpc/loop_align.c fails starting with r250482)
[gcc/testsuite]
2018-01-24  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/81550
	* gcc.target/powerpc/loop_align.c: Use unsigned long for the loop
	index instead of int, which allows IVOPTs to properly optimize the
	loop.

From-SVN: r257038
2018-01-25 01:09:19 +00:00
David Malcolm 1983b3e029 Fix jit.dg/test-alignment* (PR jit/82846)
These testcases jit-compile functions that return char, but
were erroneously calling them as if they returned int.

This led to errors for certain target configurations (e.g.
reading from %eax (32-bit) in the harness when only %al (8-bit)
had been written to in the jit-compiled function).

gcc/testsuite/ChangeLog:
	PR jit/82846
	* jit.dg/test-alignment.c (create_aligned_code): Fix return type
	of "fn_type" typedef.
	* jit.dg/test-alignment.cc (verify_aligned_code): Likewise.

From-SVN: r257037
2018-01-25 00:45:51 +00:00
GCC Administrator 2c3babdcb0 Daily bump.
From-SVN: r257036
2018-01-25 00:16:14 +00:00
Ian Lance Taylor 4880b994d6 compiler: rationalize external symbol names
Encode all external symbol names using only ASCII alphanumeric
    characters, underscore, and dot.  Use a scheme that can be reliably
    demangled to a somewhat readable version as described in the long
    comment in names.cc.
    
    A minor cleanup discovered during this was that we were treating
    function types as different if one had a NULL parameters_ field and
    another has a non-NULL parameters_ field that has no parameters.  This
    worked because we mangled them slightly differently.  We now mangle
    them the same, so we treat them as equal, as we should anyhow.
    
    Reviewed-on: https://go-review.googlesource.com/89555

	* go.go-torture/execute/names-1.go: New test.

From-SVN: r257033
2018-01-24 23:50:09 +00:00
Joseph Myers d3719ee2c0 Fix m68k-linux-gnu libgcc build for ColdFire (PR target/68467).
PR target/68467 is libgcc failing to build for m68k-linux-gnu
configured for ColdFire.

Jeff has an analysis in the PR identifying the problem as resulting
from the callers of libcalls with 1-byte or 2-byte arguments wanting
to push just 1 or 2 bytes on the stack, while the libcall
implementations have the normal C ABI and expect 4-byte arguments.
For normal C functions, I believe the TARGET_PROMOTE_PROTOTYPES
definition would ensure such arguments get passed as 4-byte, but that
does not apply for libcalls.

This patch fixes the issue by defining TARGET_PROMOTE_FUNCTION_MODE
for m68k.  The definition is conservative, only applying promotions in
the case of arguments to libcalls; otherwise it returns the unpromoted
type, which I believe matches what the default implementation of the
hook would have done on m68k.

I have tested that this fixes the libgcc build for ColdFire, and, in
conjunction with one glibc patch, this enables glibc to build cleanly
for ColdFire and to pass the compilation parts of the glibc testsuite
except for one test unrelated to this patch (while glibc and the
compilation parts of the testsuite continue to build OK for
non-ColdFire m68k, as expected).  I have *not* run any GCC tests for
this patch, or any execution tests for m68k.

	PR target/68467
	* config/m68k/m68k.c (m68k_promote_function_mode): New function.
	(TARGET_PROMOTE_FUNCTION_MODE): New macro.

From-SVN: r257032
2018-01-24 23:36:29 +00:00
Jeff Law 5e77d9b130 re PR target/83994 (%ebx is clobbered by stack-clash probing for regparm-3 function in PIC mode)
PR target/83994
	* i386.c (get_probe_interval): Move to earlier point.
	(ix86_compute_frame_layout): If -fstack-clash-protection and
	the frame is larger than the probe interval, then use pushes
	to save registers rather than reg->mem moves.
	(ix86_expand_prologue): Remove conditional for int_registers_saved
	assertion.

	PR target/83994
	* gcc.target/i386/pr83994.c: New test.

From-SVN: r257031
2018-01-24 14:57:16 -07:00
Vladimir Makarov ffd464df03 re PR target/84014 (ICE in setup_min_max_allocno_live_range_point, at ira-build.c:2762)
2018-01-24  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/84014
	* ira-build.c (setup_min_max_allocno_live_range_point): Set up
	min/max for never referenced object.

2018-01-24  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/84014
	* gcc.target/powerpc/pr84014.c: New.

From-SVN: r257029
2018-01-24 19:45:55 +00:00
Jakub Jelinek f1542d9aee re PR middle-end/83977 (ICE in simd_clone_clauses_extract, at omp-simd-clone.c:184)
PR middle-end/83977
	* tree.c (free_lang_data_in_decl): Don't clear DECL_ABSTRACT_ORIGIN
	here.
	* omp-low.c (create_omp_child_function): Remove "omp declare simd"
	attributes from DECL_ATTRIBUTES (decl) without affecting
	DECL_ATTRIBUTES (current_function_decl).
	* omp-simd-clone.c (expand_simd_clones): Ignore DECL_ARTIFICIAL
	functions with non-NULL DECL_ABSTRACT_ORIGIN.

	* c-c++-common/gomp/pr83977-1.c: New test.
	* c-c++-common/gomp/pr83977-2.c: New test.
	* c-c++-common/gomp/pr83977-3.c: New test.
	* gfortran.dg/gomp/pr83977.f90: New test.

From-SVN: r257023
2018-01-24 17:28:47 +01:00
Richard Sandiford 556d3a2433 Remove explicit dg-do runs from gcc.dg/vect (PR 83889)
The failures in this PR were from forcing { dg-do run } even when
vect.exp chooses options that are incompatible with the runtime.
The default vect.exp behaviour is to execute when possible, so there's
no need for a dg-do at all.

The patch removes other unconditional { dg-do run }s too.  Many of them
were already failing in the same way.

Also, the dg-do run condition in vect-reduc-or* seems unnecessary:
the test should run correctly whatever happens, and the scan tests
are already guarded properly.

2018-01-24  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/testsuite/
	PR testsuite/83889
	* gcc.dg/vect/pr79920.c: Remove explicit dg-do run.
	* gcc.dg/vect/pr80631-1.c: Likewise.
	* gcc.dg/vect/pr80631-2.c: Likewise.
	* gcc.dg/vect/pr81410.c: Likewise.
	* gcc.dg/vect/pr81633.c: Likewise.
	* gcc.dg/vect/pr81815.c: Likewise.
	* gcc.dg/vect/pr82108.c: Likewise.
	* gcc.dg/vect/pr83857.c: Likewise.
	* gcc.dg/vect/vect-alias-check-8.c: Likewise.
	* gcc.dg/vect/vect-alias-check-9.c: Likewise.
	* gcc.dg/vect/vect-alias-check-10.c: Likewise.
	* gcc.dg/vect/vect-alias-check-11.c: Likewise.
	* gcc.dg/vect/vect-alias-check-12.c: Likewise.
	* gcc.dg/vect/vect-reduc-11.c: Likewise.
	* gcc.dg/vect/vect-tail-nomask-1.c: Likewise.
	* gcc.dg/vect/vect-reduc-in-order-1.c: Remove dg-do run and use
	dg-xfail-run-if instead.
	* gcc.dg/vect/vect-reduc-in-order-2.c: Likewise.
	* gcc.dg/vect/vect-reduc-in-order-3.c: Likewise.
	* gcc.dg/vect/vect-reduc-in-order-4.c: Likewise.
	* gcc.dg/vect/vect-reduc-or_1.c: Remove conditional dg-do run.
	* gcc.dg/vect/vect-reduc-or_2.c: Likewise.

From-SVN: r257022
2018-01-24 16:22:40 +00:00
Richard Sandiford 885a33e117 Fix use of boolean_true/false_node (PR 83979)
r255913 changed some constant_boolean_node calls to boolean_true_node
and boolean_false_node, which meant that the returned tree didn't
always have the right type.

2018-01-24  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	PR tree-optimization/83979
	* fold-const.c (fold_comparison): Use constant_boolean_node
	instead of boolean_{true,false}_node.

gcc/testsuite/
	PR tree-optimization/83979
	* g++.dg/pr83979.c: New test.

From-SVN: r257021
2018-01-24 16:22:30 +00:00
Jan Hubicka 35d93d1d8c ipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls with zero counts.
* ipa-profile.c (ipa_propagate_frequency_1): Fix logic skipping calls
	with zero counts.

From-SVN: r257020
2018-01-24 16:18:18 +00:00
Bill Schmidt 0976f13bee rs6000.md (*call_indirect_nonlocal_sysv<mode>): Simplify the clause that sets the length attribute.
2018-01-24  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
	Simplify the clause that sets the length attribute.
	(*call_value_indirect_nonlocal_sysv<mode>): Likewise.
	(*sibcall_nonlocal_sysv<mode>): Clean up code block; simplify the
	clause that sets the length attribute.
	(*sibcall_value_nonlocal_sysv<mode>): Likewise.

From-SVN: r257019
2018-01-24 15:42:30 +00:00
Jason Merrill 018e9cb5e6 PR c++/82249 - wrong mismatched pack length error.
* pt.c (extract_fnparm_pack, tsubst_pack_expansion): Handle
	unsubstituted function parameter pack.

From-SVN: r257018
2018-01-24 10:20:53 -05:00
Kyrylo Tkachov a84aff585b [testsuite] Fix arm options in gcc.dg/lto/20110201-1_0.c
This test fails on arm hardfloat targets because it sets an explicit -mfloat-abi=softfp.
The usual approach to setting the NEON options is to use dg-add-options arm_neon.
But in the lto tests we don't have that framework, we can only set them explicitly with dg-lto-options.

The solution is to remove the explicit -mfloat-abi=softfp and instead add an effective target check
for arm_neon_ok_no_float_abi that makes sure we only run this test if -mfpu=neon is enough to get NEON
without any -mfloat-abi options. In fact, this is what the comment above check_effective_target_arm_neon_ok_no_float_abi_nocache
recommends for lto tests.

That way on my hardfloat toolchain the test doesn't try to link the softfp binary against a hard-float runtime/test glue
and all is good. I've tested that the test is appropriately skipped when testing a --with-float=soft toolchain.


     * gcc.dg/lto/20110201-1_0.c: Remove explicit -mfloat-abi=softfp
     option.  Add arm_neon_ok_no_float_abi check.

From-SVN: r257017
2018-01-24 14:43:52 +00:00
Tom de Vries 3dede32b88 [nvptx, PR83589] Workaround for branch-around-nothing JIT bug
2018-01-24  Tom de Vries  <tom@codesourcery.com>

	PR target/83589
	* config/nvptx/nvptx.c (WORKAROUND_PTXJIT_BUG_2): Define to 1.
	(nvptx_pc_set, nvptx_condjump_label): New function. Copy from jump.c.
	Add strict parameter.
	(prevent_branch_around_nothing): Insert dummy insn between branch to
	label and label with no ptx insn inbetween.
	* config/nvptx/nvptx.md (define_insn "fake_nop"): New insn.

	* testsuite/libgomp.oacc-c-c++-common/pr83589.c: New test.

From-SVN: r257016
2018-01-24 13:52:12 +00:00
Tom de Vries be606483c9 [nvptx, PR81352] Add exit insn after noreturn call for neutered threads in warp
2018-01-24  Tom de Vries  <tom@codesourcery.com>

	PR target/81352
	* config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
	for neutered threads in warp.
	* config/nvptx/nvptx.md (define_insn "exit"): New insn.

	* testsuite/libgomp.oacc-fortran/pr81352.f90: New test.

From-SVN: r257014
2018-01-24 11:27:10 +00:00
Richard Biener 6acfd18c39 re PR tree-optimization/83176 ([graphite] ICE in set_codegen_error, at graphite-isl-ast-to-gimple.c:206)
2018-01-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/83176
	* tree-chrec.c (chrec_fold_plus_1): Handle (signed T){(T) .. }
	operands.

	* gcc.dg/graphite/pr83176.c: New testcase.

From-SVN: r257013
2018-01-24 09:37:41 +00:00
Richard Biener da37a70f55 re PR tree-optimization/82819 ([graphite] ICE in set_codegen_error, at graphite-isl-ast-to-gimple.c:206)
2018-01-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82819
	* graphite-isl-ast-to-gimple.c (binary_op_to_tree): Avoid
	code generating pluses that are no-ops in the target precision.

	* gcc.dg/graphite/pr82819.c: New testcase.

From-SVN: r257012
2018-01-24 09:31:56 +00:00
Richard Biener df9e39b16e re PR fortran/84000 (ICE in replace_loop_annotate, at tree-cfg.c:352)
2018-01-24  Richard Biener  <rguenther@suse.de>

	PR middle-end/84000
	* tree-cfg.c (replace_loop_annotate): Handle annot_expr_parallel_kind.

From-SVN: r257011
2018-01-24 08:43:40 +00:00
Jan Hubicka 97c07987a6 cfgcleanup.c (try_crossjump_to_edge): Use combine_with_count to merge probabilities.
* cfgcleanup.c (try_crossjump_to_edge): Use combine_with_count
	to merge probabilities.
	* predict.c (probably_never_executed): Also mark as cold functions
	with global 0 profile and guessed local profile.
	* profile-count.c (profile_probability::combine_with_count): New
	member function.
	* profile-count.h (profile_probability::operator*,
	profile_probability::operator*=, profile_probability::operator/,
	profile_probability::operator/=): Reduce precision to adjusted
	and set value to guessed on contradictory divisions.
	(profile_probability::combine_with_freq): Remove.
	(profile_probability::combine_wiht_count): Declare.
	(profile_count::force_nonzero):: Set to adjusted.
	(profile_count::probability_in):: Set quality to adjusted.
	* tree-ssa-tail-merge.c (replace_block_by): Use
	combine_with_count.

From-SVN: r257010
2018-01-24 08:12:40 +00:00