Joseph Myers [Tue, 4 Jul 2017 10:25:10 +0000 (11:25 +0100)]
Use ucontext_t not struct ucontext in linux-unwind.h files.
Current glibc no longer gives the ucontext_t type the tag struct
ucontext, to conform with POSIX namespace rules. This requires
various linux-unwind.h files in libgcc, that were previously using
struct ucontext, to be fixed to use ucontext_t instead. This is
similar to the removal of the struct siginfo tag from siginfo_t some
years ago.
This patch changes those files to use ucontext_t instead. As the
standard name that should be unconditionally safe, so this is not
restricted to architectures supported by glibc, or conditioned on the
glibc version.
Tested compilation together with current glibc with glibc's
build-many-glibcs.py.
Those two changes aren't actually applicable to 5. Sorry for the noise.
Revert:
Backports from trunk:
2017-04-12 Segher Boessenkool <segher@kernel.crashing.org>
PR target/80382
* config/rs6000/sync.md (atomic_load<mode>, atomic_store<mode): Test
for quad_address_p for TImode, instead of just not indexed_address.
2017-06-09 Segher Boessenkool <segher@kernel.crashing.org>
PR target/80966
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Assert that
gen_add3_insn did not fail.
* config/rs6000/rs6000.md (add<mode>3): If asked to add a constant to
r0, construct that number in a temporary reg and add that reg to r0.
If asked to put the result in r0 as well, fail.
Revert:
Backport from trunk:
2017-06-09 Segher Boessenkool <segher@kernel.crashing.org>
PR target/80966
* gcc.target/powerpc/stack-limit.c: New testcase.
2016-08-15 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/73650
* lra-constraints.c (simple_move_p): If the insn is multiple_sets
it is not a simple move.
2017-01-20 Segher Boessenkool <segher@kernel.crashing.org>
PR target/61729
PR target/77850
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Adjust address to
read from, for big endian.
2017-04-12 Segher Boessenkool <segher@kernel.crashing.org>
PR target/80382
* config/rs6000/sync.md (atomic_load<mode>, atomic_store<mode): Test
for quad_address_p for TImode, instead of just not indexed_address.
2017-05-17 Segher Boessenkool <segher@kernel.crashing.org>
PR middle-end/80692
* real.c (do_compare): Give decimal_do_compare preference over
comparing just the signs.
2017-05-31 Segher Boessenkool <segher@kernel.crashing.org>
PR target/80618
* config/rs6000/vector.md (*vector_uneq<mode>): Write the nor in the
splitter result in the canonical way.
2017-06-09 Segher Boessenkool <segher@kernel.crashing.org>
PR target/80966
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Assert that
gen_add3_insn did not fail.
* config/rs6000/rs6000.md (add<mode>3): If asked to add a constant to
r0, construct that number in a temporary reg and add that reg to r0.
If asked to put the result in r0 as well, fail.
2017-06-23 Segher Boessenkool <segher@kernel.crashing.org>
PR middle-end/80902
* builtins.c (expand_builtin_atomic_fetch_op): If emitting code after
a call, force the call to not be a tail call.
gcc/testsuite/
Backports from trunk:
2017-05-17 Segher Boessenkool <segher@kernel.crashing.org>
PR middle-end/80692
* gcc.c-torture/execute/pr80692.c: New testcase.
2017-06-09 Segher Boessenkool <segher@kernel.crashing.org>
PR target/80966
* gcc.target/powerpc/stack-limit.c: New testcase.
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.