Eric Botcazou [Tue, 5 Sep 2017 08:31:50 +0000 (08:31 +0000)]
trans.c (Call_to_gnu): If this is a function call and there is no target...
* gcc-interface/trans.c (Call_to_gnu): If this is a function call and
there is no target, do not create a temporary for the return value for
an allocator either.
Jonathan Wakely [Mon, 4 Sep 2017 16:52:30 +0000 (17:52 +0100)]
PR libstdc++/81751 don't call fflush(NULL)
Backport from mainline
2017-08-09 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/79820
PR libstdc++/81751
* config/io/basic_file_stdio.cc (sys_open(FILE*, ios_base::openmode)):
Call fflush on the stream instead of calling sync() while _M_cfile is
null. Restore original value of errno.
* testsuite/ext/stdio_filebuf/char/79820.cc: New.
* testsuite/ext/stdio_filebuf/char/81751.cc: New.
Michael Meissner [Wed, 30 Aug 2017 13:38:27 +0000 (13:38 +0000)]
backport: re PR target/81593 (Optimize PowerPC vector set from vector extract)
[gcc]
2017-08-30 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk
2017-08-07 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81593
* config/rs6000/vsx.md (vsx_concat_<mode>_1): New combiner insns
to recognize inserting into a vector from a double word element
that was extracted from another vector, and eliminate extra
XXPERMDI instructions.
(vsx_concat_<mode>_2): Likewise.
(vsx_concat_<mode>_3): Likewise.
(vsx_set_<mode>, VSX_D): Rewrite vector set in terms of vector
concat to allow optimizing inserts from previous extracts.
[gcc/testsuite]
2017-08-30 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk
2017-08-07 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81593
* gcc.target/powerpc/vec-setup.h: New tests to test various
combinations of setting up vectors of 2 double word elements.
* gcc.target/powerpc/vec-setup-long.c: Likewise.
* gcc.target/powerpc/vec-setup-double.c: Likewise.
* gcc.target/powerpc/vec-setup-be-long.c: Likewise.
* gcc.target/powerpc/vec-setup-be-double.c: Likewise.
* gcc.target/powerpc/vsx-extract-6.c: New tests for optimzing
vector inserts from vector extracts.
* gcc.target/powerpc/vsx-extract-7.c: Likewise.
Michael Meissner [Tue, 29 Aug 2017 21:06:21 +0000 (21:06 +0000)]
<add missing ChangeLogs>
[gcc]
2017-07-13 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk
2017-07-12 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81193
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): If GLIBC
provides the hardware capability bits, define the macro
__BUILTIN_CPU_SUPPORTS__.
* config/rs6000/rs6000.c (cpu_expand_builtin): Generate a warning
if GLIBC does not provide the hardware capability bits. Add a
gcc_unreachable call if the built-in cpu function is neither
__builtin_cpu_is nor __builtin_cpu_supports.
* doc/extend.texi (PowerPC built-in functions): Document that
GLIBC 2.23 or newer is needed by __builtin_cpu_is and
__builtin_cpu_supports. Document the macros defined by GCC if the
newer GLIBC is available.
[gcc/testsuite]
2017-07-13 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk
2017-06-28 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81193
* lib/target-supports.exp
(check_ppc_cpu_supports_hw_available): New test to make sure
__builtin_cpu_supports works on power7 and newer.
Back port from trunk
2017-07-12 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81193
* gcc.target/powerpc/cpu-builtin-1.c: Add guard against using
__builtin_cpu_supports with old GLIBC's.
Alan Modra [Tue, 29 Aug 2017 08:27:02 +0000 (17:57 +0930)]
[RS6000] linux startfile/endfile
These need to match the gnu-user.h definitions to support
--enable-default-pie. Otherwise we end up linking the wrong startup
files when defaulting to PIE.
PR target/81170
PR target/81295
* config/rs6000/sysv4.h (STARTFILE_LINUX_SPEC): Upgrade to
match gnu-user.h startfile.
(ENDFILE_LINUX_SPEC): Similarly.
Alan Modra [Tue, 29 Aug 2017 08:25:17 +0000 (17:55 +0930)]
PR driver/81523: Make -static override -pie
-static and -pie together behave differently depending on whether GCC is
configured with --enable-default-pie. On x86, "-static -pie" fails to
create executable when --enable-default-pie isn't used, but creates a
static executable when --enable-default-pie is used. This patch makes
-static completely override -pie to create a static executable, regardless
if --enable-default-pie is used to configure GCC.
PR target/81170
PR target/81295
PR driver/81523
* gcc.c (NO_PIE_SPEC): Delete.
(PIE_SPEC): Define as !no-pie/pie. Move static|shared|r
exclusion..
(LINK_PIE_SPEC): ..to here.
(LINK_COMMAND_SPEC): Support -no-pie.
* config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Correct
chain of crtbegin*.o selection, update for PIE_SPEC changes and
format.
(GNU_USER_TARGET_ENDFILE_SPEC): Similarly.
* config/sol2.h (STARTFILE_CRTBEGIN_SPEC): Similarly.
(ENDFILE_CRTEND_SPEC): Similarly.
Georg-Johann Lay [Tue, 22 Aug 2017 07:57:40 +0000 (07:57 +0000)]
backport: re PR target/81910 ([avr] ICE with "address" attribute on type)
Backport from 2017-08-22 trunk r251256.
PR target/81910
* config/avr/avr.c (avr_handle_addr_attribute): Early return if
not VAR_P. Filter attribute warnings with OPT_Wattributes.
(avr_attribute_table) <io, io_low, address>: Initialize
.decl_required with true.
Jakub Jelinek [Mon, 31 Jul 2017 08:56:03 +0000 (10:56 +0200)]
re PR sanitizer/81604 (Ubsan type reporting can be bogus in some cases)
PR sanitizer/81604
* ubsan.c (ubsan_type_descriptor): For UBSAN_PRINT_ARRAY don't
change type to the element type, instead add eltype variable and
use it where we are interested in the element type.
Jakub Jelinek [Thu, 27 Jul 2017 09:32:33 +0000 (11:32 +0200)]
re PR tree-optimization/81555 (Wrong code at -O1)
PR tree-optimization/81555
PR tree-optimization/81556
* tree-ssa-reassoc.c (rewrite_expr_tree): Add NEXT_CHANGED argument,
if true, force CHANGED for the recursive invocation.
(reassociate_bb): Remember original length of ops array, pass
len != orig_len as NEXT_CHANGED in rewrite_expr_tree call.
* gcc.c-torture/execute/pr81555.c: New test.
* gcc.c-torture/execute/pr81556.c: New test.
backport: re PR target/79883 (avr i18n: untranslated "interrupt" or "signal")
gcc/
Backport from 2016-06-15 trunk r237486.
Backport from 2017-07-12 trunk r250156.
PR target/79883
PR target/67353
* config/avr/avr.c (avr_set_current_function): Warn misspelled ISR
only if -Wmisspelled-isr is on. In diagnostic messages: Quote
keywords and (parts of) identifiers.
[WITH_AVRLIBC]: Warn functions named "ISR", "SIGNAL" or "INTERUPT".
* doc/invoke.texi (AVR Options) <-Wmisspelled-isr>: Decument.
backport: re PR lto/81487 ([mingw32] ld.exe: error: asprintf failed)
lto-plugin/
Backport from 2017-07-26 gcc-7-branch r250562.
PR lto/81487
* lto-plugin.c (claim_file_handler): Use xasprintf instead of
asprintf.
[hi!=0]: Swap hi and lo arguments supplied to xasprintf.
gcc/
Backport from 2017-07-26 gcc-7-branch r250562.
PR 81487
* hsa-brig.c (brig_init): Use xasprintf instead of asprintf.
* tree-ssa-structalias.c (alias_get_name): Same.
Ian Lance Taylor [Thu, 20 Jul 2017 22:03:48 +0000 (22:03 +0000)]
re PR go/81393 (Bootstrap failure on s390x-linux while building libgo against recent glibc)
PR go/81393
syscall: don't use GETREGS/SETREGS on s390
They were removed in recent glibc.
This is a backport of https://golang.org/cl/48231 to earlier branches.
Define required type and constants in syscall package directly, don't
try to pull them from the system header files.
Michael Meissner [Wed, 19 Jul 2017 22:05:20 +0000 (22:05 +0000)]
backport: re PR target/81193 (PowerPC GCC __builtin_cpu_is and __builtin_cpu_supports should warn about old libraries)
[gcc]
2017-07-19 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk
2017-07-12 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81193
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): If GLIBC
provides the hardware capability bits, define the macro
__BUILTIN_CPU_SUPPORTS__.
* config/rs6000/rs6000.c (cpu_expand_builtin): Generate a warning
if GLIBC does not provide the hardware capability bits. Add a
gcc_unreachable call if the built-in cpu function is neither
__builtin_cpu_is nor __builtin_cpu_supports.
* doc/extend.texi (PowerPC built-in functions): Document that
GLIBC 2.23 or newer is needed by __builtin_cpu_is and
__builtin_cpu_supports. Document the macros defined by GCC if the
newer GLIBC is available.
[gcc/testsuite]
2017-07-19 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk
2017-07-12 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81193
* gcc.target/powerpc/cpu-builtin-1.c: Change test to use #ifdef
__BUILTIN_CPU_SUPPORTS to see if the GLIBC is new enough that
__builtin_cpu_is and __builtin_cpu_supports are supported.
re PR target/81471 (internal compiler error: in curr_insn_transform, at lra-constraints.c:3495)
PR target/81471
* config/i386/i386.md (rorx_immediate_operand): New mode attribute.
(*bmi2_rorx<mode>3_1): Use rorx_immediate_operand as
operand 2 predicate.
(*bmi2_rorxsi3_1_zext): Use const_0_to_31_operand as
operand 2 predicate.
(ror,rol -> rorx splitters): Use const_int_operand as
operand 2 predicate.
testsuite/ChangeLog:
PR target/81471
* gcc.target/i386/pr81471.c: New test.
2017-03-23 Kelvin Nilsen <kelvin@gcc.gnu.org>
* config/rs6000/rs6000.c (rs6000_option_override_internal): Change
handling of certain combinations of target options, including the
combinations -mpower8-vector vs. -mno-vsx, -mpower8-vector vs.
-mno-power8-vector, and -mpower9_dform vs. -mno-power9-vector.
2017-03-27 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/80103
* config/rs6000/rs6000.c (rs6000_option_override_internal): Add
special handling for target option conflicts between dform options
(-mpower9-dform, -mpower9-dform-vector, -mpower9-dform-scalar) and
-mno-direct-move.
2017-05-08 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/80101
* config/rs6000/power6.md: Replace store_data_bypass_p calls with
rs6000_store_data_bypass_p in seven define_bypass directives and
in several comments.
* config/rs6000/rs6000-protos.h: Add prototype for
rs6000_store_data_bypass_p function.
* config/rs6000/rs6000.c (rs6000_store_data_bypass_p): New
function implements slightly different (rs6000-specific) semantics
than store_data_bypass_p, returning false rather than aborting
with assertion error when arguments do not satisfy the
requirements of store data bypass.
(rs6000_adjust_cost): Replace six calls of store_data_bypass_p with
rs6000_store_data_bypass_p.
gcc/testsuite/ChangeLog:
2017-07-14 Kelvin Nilsen <kelvin@gcc.gnu.org>
Backports from trunk:
2017-01-23 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/66669
* gcc.dg/loop-8.c: Modify dg-skip-if directive to exclude this
test on powerpc targets.
2017-02-08 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/68972
* g++.dg/cpp1y/vla-initlist1.C: Add dg-skip-if directive to
disable this test on power architecture.
2017-03-23 Kelvin Nilsen <kelvin@gcc.gnu.org>
* gcc.target/powerpc/p9-options-1.c: New test.
2017-03-27 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/80103
* gcc.target/powerpc/pr80103-1.c: New test.
2017-05-08 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/80101
* gcc.target/powerpc/pr80101-1.c: New test.