2017-06-23 Thomas Preud'homme <thomas.preudhomme@arm.com>
Backport from mainline
2017-05-04 Prakhar Bahuguna <prakhar.bahuguna@arm.com>
gcc/
* gcc/config/arm/arm-builtins.c (arm_init_builtins): Rename
__builtin_arm_ldfscr to __builtin_arm_get_fpscr, and rename
__builtin_arm_stfscr to __builtin_arm_set_fpscr.
gcc/testsuite/
* gcc.target/arm/fpscr.c: New file.
Backport from mainline
2017-05-26 Martin Liska <mliska@suse.cz>
PR ipa/80663
* g++.dg/ipa/pr80212.C: Remove the test as it does not longer
split at the problematic spot.
* gcc.dg/ipa/pr48195.c: Change 101 to 100 as 101 is no longer
a valid value of the param.
Martin Liska [Thu, 22 Jun 2017 11:26:58 +0000 (13:26 +0200)]
Backport r247371
2017-06-22 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-04-28 Martin Liska <mliska@suse.cz>
PR driver/56469
* coverage.c (coverage_remove_note_file): New function.
* coverage.h: Declare the function.
* toplev.c (finalize): Clean if an error has been seen.
Jonathan Wakely [Fri, 16 Jun 2017 12:55:17 +0000 (13:55 +0100)]
Backport libstdc++ doc improvements from mainline
* doc/xml/manual/appendix_contributing.xml: Link to the list of bad
names, and link to the test docs and note higher DejaGnu version
requirement.
* doc/xml/manual/allocator.xml: Fix ViewCVS URLs.
* doc/xml/manual/mt_allocator.xml: Likewise.
* doc/html/*: Regenerate.
Max Filippov [Tue, 30 May 2017 23:42:48 +0000 (23:42 +0000)]
gcc: xtensa: fix fprintf format specifiers
HOST_WIDE_INT may not be long as assumed in print_operand and
xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
format strings instead of %ld/0x%lx. This fixes incorrect assembly code
generation by the compiler running on armhf host.
2017-05-30 Max Filippov <jcmvbkbc@gmail.com>
gcc/
Backport from mainline
2017-05-29 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/xtensa.c (xtensa_emit_call): Use
HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
(print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
format string.
Max Filippov [Tue, 30 May 2017 23:40:34 +0000 (23:40 +0000)]
xtensa: don't use unwind-dw2-fde-dip with elf targets
Define LIB2ADDEH_XTENSA_UNWIND_DW2_FDE to unwind-dw2-fde.c in
xtensa/t-elf and to unwind-dw2-fde-dip.c in xtensa/t-linux and use
LIB2ADDEH_XTENSA_UNWIND_DW2_FDE in LIB2ADDEH definition.
This fixes build for elf target with windowed xtensa core that currently
breaks with the following error message:
unwind-dw2-fde-dip.c:36:40: fatal error: elf.h: No such file or directory
2017-05-30 Max Filippov <jcmvbkbc@gmail.com>
libgcc/
Backport from mainline
2016-10-18 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/t-elf (LIB2ADDEH_XTENSA_UNWIND_DW2_FDE): New
definition.
* config/xtensa/t-linux (LIB2ADDEH_XTENSA_UNWIND_DW2_FDE): New
definition.
* config/xtensa/t-windowed (LIB2ADDEH): Use
LIB2ADDEH_XTENSA_UNWIND_DW2_FDE defined by either xtensa/t-elf
or xtensa/t-linux.
Max Filippov [Tue, 30 May 2017 23:39:41 +0000 (23:39 +0000)]
xtensa: fix libgcc build with --text-section-literals
Functions __muldf3_aux, __divdf3_aux, __mulsf3_aux and __divsf3_aux
don't start with leaf_entry, so they need explicit .literal_position,
otherwise libgcc build fails in the presence of --text-section-literals.
2017-05-30 Max Filippov <jcmvbkbc@gmail.com>
libgcc/
Backport from mainline
2016-02-17 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/ieee754-df.S (__muldf3_aux, __divdf3_aux): Add
.literal_position before the function.
* config/xtensa/ieee754-sf.S (__mulsf3_aux, __divsf3_aux):
Likewise.
Max Filippov [Tue, 30 May 2017 23:37:42 +0000 (23:37 +0000)]
xtensa: fix TLS calls for call0 ABI
2017-05-30 Max Filippov <jcmvbkbc@gmail.com>
gcc/
Backport from mainline
2015-09-15 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/xtensa.c (xtensa_call_tls_desc): Use a10 or a2
to pass TLS call argument, according to current ABI.
* config/xtensa/xtensa.md (tls_call pattern): Use callx8 or
callx0 for TLS call, according to current ABI.
Max Filippov [Tue, 30 May 2017 23:32:21 +0000 (23:32 +0000)]
xtensa: fix _Unwind_GetCFA
Returning context->cfa in _Unwind_GetCFA makes CFA point one stack frame
higher than what was actually used by code at context->ra. This results
in invalid CFA value in signal frames and premature unwinding completion
in forced unwinding used by uClibc NPTL thread cancellation.
Returning context->sp from _Unwind_GetCFA makes all CFA values valid and
matching code that used them.
2017-05-30 Max Filippov <jcmvbkbc@gmail.com>
libgcc/
Backport from mainline
2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return
context->sp instead of context->cfa.
Jakub Jelinek [Tue, 30 May 2017 08:26:33 +0000 (10:26 +0200)]
backport: re PR rtl-optimization/80385 (Segfault in commutative_operand_precedence() rtlanal.c:3373)
Backported from mainline
2017-04-11 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/80385
* simplify-rtx.c (simplify_unary_operation_1): Don't transform
(not (neg X)) into (plus X -1) for complex or non-integral modes.
Jakub Jelinek [Tue, 30 May 2017 08:23:29 +0000 (10:23 +0200)]
backport: re PR target/80286 (AVX2 _mm_cvtsi128_si32 doesn't return a proper 32bits int)
Backported from mainline
2017-04-04 Jakub Jelinek <jakub@redhat.com>
PR target/80286
* config/i386/i386.c (ix86_expand_args_builtin): If op has scalar
int mode, convert_modes it to mode as unsigned, otherwise use
lowpart_subreg to mode rather than SImode.
* config/i386/sse.md (<mask_codefor>ashr<mode>3<mask_name>,
ashr<mode>3, ashr<mode>3<mask_name>, <shift_insn><mode>3<mask_name>):
Use DImode instead of SImode for the shift count operand.
* config/i386/mmx.md (mmx_ashr<mode>3, mmx_<shift_insn><mode>3):
Likewise.
* gcc.target/i386/avx-pr80286.c: New test.
* gcc.dg/pr80286.c: New test.
Jakub Jelinek [Tue, 30 May 2017 08:22:41 +0000 (10:22 +0200)]
backport: re PR debug/80025 (ICE w/ -O2 (-O3, -Ofast) -g -ftracer (infinite recursion in rtx_equal_for_cselib_1))
Backported from mainline
2017-03-31 Jakub Jelinek <jakub@redhat.com>
PR debug/80025
* cselib.c (cselib_hasher::equal): Pass 0 to rtx_equal_for_cselib_1.
(rtx_equal_for_cselib_1): Add depth argument. If depth
is 128, don't look up VALUE locs and punt. Increment
depth in recursive calls when walking VALUE locs.
Jakub Jelinek [Tue, 30 May 2017 08:20:45 +0000 (10:20 +0200)]
backport: re PR sanitizer/80168 (ICE in make_decl_rtl, at varasm.c:1311 w/ VLA and -fsanitize=address)
Backported from mainline
2017-03-27 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/80168
* asan.c (instrument_derefs): Copy over last operand from
original COMPONENT_REF to the new COMPONENT_REF with
DECL_BIT_FIELD_REPRESENTATIVE.
* ubsan.c (instrument_object_size): Likewise.
Jakub Jelinek [Tue, 30 May 2017 08:17:54 +0000 (10:17 +0200)]
backport: re PR c++/80141 (ICE with pragma omp declare)
Backported from mainline
2017-03-22 Jakub Jelinek <jakub@redhat.com>
PR c++/80141
* semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
processing_template_decl.
Jakub Jelinek [Tue, 30 May 2017 08:15:55 +0000 (10:15 +0200)]
backport: re PR c++/79896 (ICE in gimplify_expr, at gimplify.c:11950 on non-int128 target)
Backported from mainline
2017-03-10 Jakub Jelinek <jakub@redhat.com>
PR c++/79896
* decl.c (finish_enum_value_list): If value is error_mark_node,
don't copy it and change its type.
* init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
of CONST_DECL is error_mark_node.
Jakub Jelinek [Tue, 30 May 2017 08:15:05 +0000 (10:15 +0200)]
backport: re PR c++/79896 (ICE in gimplify_expr, at gimplify.c:11950 on non-int128 target)
Backported from mainline
2017-03-10 Jakub Jelinek <jakub@redhat.com>
PR c++/79896
* decl.c (finish_enum_value_list): If value is error_mark_node,
don't copy it and change its type.
* init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
of CONST_DECL is error_mark_node.
Jakub Jelinek [Tue, 30 May 2017 08:13:33 +0000 (10:13 +0200)]
backport: re PR sanitizer/79944 (asan: incorrect instrumentation of atomic operations)
Backported from mainline
2017-03-09 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/79944
* asan.c (get_mem_refs_of_builtin_call): For BUILT_IN_ATOMIC* and
BUILT_IN_SYNC*, determine the access type from the size suffix and
always build a MEM_REF with that type. Handle forgotten
BUILT_IN_SYNC_FETCH_AND_NAND_16 and BUILT_IN_SYNC_NAND_AND_FETCH_16.
Jakub Jelinek [Tue, 30 May 2017 08:07:03 +0000 (10:07 +0200)]
backport: re PR target/79807 (ICE in extract_insn, at recog.c:2311 (error: unrecognizable insn))
Backported from mainline
2017-03-03 Jakub Jelinek <jakub@redhat.com>
PR target/79807
* config/i386/i386.c (ix86_expand_multi_arg_builtin): If target
is a memory operand, increase num_memory.
(ix86_expand_args_builtin): Likewise.
Jakub Jelinek [Tue, 30 May 2017 08:00:48 +0000 (10:00 +0200)]
backport: re PR target/79568 (ICE in extract_insn, at recog.c:2311 for pr70325.c (with -mavx512bw))
Backported from mainline
2017-02-20 Jakub Jelinek <jakub@redhat.com>
PR target/79568
* config/i386/i386.c (ix86_expand_builtin): Handle
OPTION_MASK_ISA_AVX512VL and OPTION_MASK_ISA_64BIT in
ix86_builtins_isa[fcode].isa as a requirement of those
flags and any other flag in the bitmask.
(ix86_init_mmx_sse_builtins): Use 0 instead of
~OPTION_MASK_ISA_64BIT as mask.
* config/i386/i386-builtin.def (bdesc_special_args,
bdesc_args): Likewise.
* gcc.target/i386/pr79568-1.c: New test.
* gcc.target/i386/pr79568-2.c: New test.
* gcc.target/i386/pr79568-3.c: New test.
Jakub Jelinek [Tue, 30 May 2017 07:59:29 +0000 (09:59 +0200)]
backport: re PR target/79559 (ICE in ix86_print_operand, at config/i386/i386.c:18189)
Backported from mainline
2017-02-18 Jakub Jelinek <jakub@redhat.com>
PR target/79559
* config/i386/i386.c (ix86_print_operand): Use output_operand_lossage
instead of gcc_assert for K, r and R code checks. Formatting fixes.
Jakub Jelinek [Tue, 30 May 2017 07:58:01 +0000 (09:58 +0200)]
backport: re PR tree-optimization/79411 (ICE: SSA corruption (fail_abnormal_edge_coalesce))
Backported from mainline
2017-02-10 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/79411
* tree-ssa-reassoc.c (is_reassociable_op): Return false if
stmt operands are SSA_NAMEs used in abnormal phis.
(can_reassociate_p): Return false if op is SSA_NAME used in abnormal
phis.
Jakub Jelinek [Tue, 30 May 2017 07:57:10 +0000 (09:57 +0200)]
backport: re PR middle-end/79399 (GCC fails to compile big source at -O0)
Backported from mainline
2017-02-07 Jakub Jelinek <jakub@redhat.com>
Richard Biener <rguenther@suse.de>
PR middle-end/79399
* ira-int.h (struct target_ira_int): Change x_max_struct_costs_size
type from int to size_t.
* ira-costs.c (struct_costs_size): Change type from int to size_t.
Jakub Jelinek [Tue, 30 May 2017 07:56:11 +0000 (09:56 +0200)]
backport: re PR target/79197 (ICE in extract_insn in gcc/recog.c:2311)
Backported from mainline
2017-02-02 Jakub Jelinek <jakub@redhat.com>
PR target/79197
* config/rs6000/rs6000.md (*fixuns_trunc<mode>di2_fctiduz): Rename to ...
(fixuns_trunc<mode>di2): ... this, remove previous expander. Put all
conditions on a single line.
* gcc.target/powerpc/pr79197.c: New test.
* gcc.c-torture/compile/pr79197.c: New test.
Jakub Jelinek [Tue, 30 May 2017 07:55:06 +0000 (09:55 +0200)]
backport: re PR c++/78341 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler error: in cp_parser_std_attribute_spec, at cp/parser.c:24597))
Backported from mainline
2017-01-11 Jakub Jelinek <jakub@redhat.com>
Jakub Jelinek [Tue, 30 May 2017 07:51:12 +0000 (09:51 +0200)]
backport: re PR ipa/77905 (ICE at -Os and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in ipa_comdats, at ipa-comdats.c:352))
Backported from mainline
2016-12-13 Jakub Jelinek <jakub@redhat.com>
PR ipa/77905
* ipa-pure-const.c (cdtor_p): Return true for
DECL_STATIC_{CON,DE}STRUCTOR even when it is
DECL_LOOPING_CONST_OR_PURE_P.
Jakub Jelinek [Tue, 30 May 2017 07:46:27 +0000 (09:46 +0200)]
backport: re PR c++/78649 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in build_value_init_noctor, at cp/init.c:380))
Backported from mainline
2016-12-02 Jakub Jelinek <jakub@redhat.com>
PR c++/78649
* pt.c (tsubst_init): Don't call build_value_init if decl's type
is error_mark_node.
Jakub Jelinek [Tue, 30 May 2017 07:45:47 +0000 (09:45 +0200)]
backport: re PR fortran/78298 (ICE in lookup_decl_in_outer_ctx, bei omp-low.c:4115)
Backported from mainline
2016-11-28 Jakub Jelinek <jakub@redhat.com>
PR fortran/78298
* tree-nested.c (convert_local_reference_stmt): After adding
shared (FRAME.NN) clause to omp parallel, task or target,
add it also to all outer omp parallel, task or target constructs.
Jakub Jelinek [Tue, 30 May 2017 07:44:51 +0000 (09:44 +0200)]
backport: re PR middle-end/69183 (ICE when using OpenMP PRIVATE keyword in OMP DO loop not explicitly encapsulated in OMP PARALLEL region)
Backported from mainline
2016-11-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/69183
* omp-low.c (build_outer_var_ref): Change lastprivate argument
to code, pass it recursively, adjust uses. For OMP_CLAUSE_PRIVATE
on worksharing constructs, treat it like clauses on simd construct.
Formatting fix.
(lower_rec_input_clauses): For OMP_CLAUSE_PRIVATE_OUTER_REF pass
OMP_CLAUSE_PRIVATE as last argument to build_outer_var_ref.
(lower_lastprivate_clauses): Pass OMP_CLAUSE_LASTPRIVATE instead
of true as last argument to build_outer_var_ref.