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.
From-SVN: r250993
Libgo's implementation of math.Ldexp declared the libc "ldexp" as
taking an 'int' exponent argument, which is not quite right for 64-bit
platforms (exp arg is always int32); this could yield incorrect
results for exponent values outside the range of Minint32/Maxint32.
Fix by upating the type for the libc version of ldexp, and adding
guards to screen for out-of-range exponents.
Fixes#21323.
Reviewed-on: https://go-review.googlesource.com/54250
From-SVN: r250992
-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.
gcc/
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.
gcc/testsuite/
PR driver/81523
* gcc.dg/pie-7.c: New test.
* gcc.dg/pie-static-1.c: Likewise.
* gcc.dg/pie-static-2.c: Likewise.
From-SVN: r250974
2017-08-08 Richard Biener <rguenther@suse.de>
PR middle-end/81719
* tree-ssa-loop-niter.c: Include tree-dfa.h.
(expand_simple_operations): Also look through ADDR_EXPRs with
MEM_REF bases treating them as POINTER_PLUS_EXPR.
* g++.dg/tree-ssa/pr81719.C: New testcase.
From-SVN: r250954
2017-08-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/81723
* tree-vect-slp.c (struct bst_traits): New hash traits.
(bst_fail): New global.
(vect_build_slp_tree_2): New worker, split out from ...
(vect_build_slp_tree): ... this now wrapping it with using
bst_fail set to cache SLP tree build fails. Properly handle
max_tree_size.
(vect_analyze_slp_instance): Allocate and free bst_fail.
* gfortran.dg/pr81723.f: New testcase.
From-SVN: r250953
2017-08-08 Martin Liska <mliska@suse.cz>
PR tree-opt/81696
* ipa-icf-gimple.c (func_checker::compare_cst_or_decl): Consider
LABEL_DECLs that can be from a different function.
2017-08-08 Martin Liska <mliska@suse.cz>
PR tree-opt/81696
* gcc.dg/ipa/pr81696.c: New test.
From-SVN: r250951
PR tree-optimization/81744
* tree-predcom.c (prepare_finalizers_chain): Deep copy expr of
loop's number of iterations.
gcc/testsuite
* gcc.dg/tree-ssa/pr81744.c: New.
From-SVN: r250950
PR c++/81607
* cp-gimplify.c (cp_fold): If folding exposed a branch of
a COND_EXPR, convert it to the original type of the COND_EXPR, if
they differ.
* g++.dg/other/bitfield6.C: New test.
From-SVN: r250948
[gcc]
2017-08-07 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/81593
* config/rs6000/vsx.md (vsx_concat_<mode>, VSX_D): Cleanup
constraints since the -mupper-regs-* switches have been
eliminated.
(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-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.
From-SVN: r250936
2017-08-07 Douglas Rupp <rupp@adacore.com>
* Makefile.in (install-mkheaders): Fix typo, where the multi_dir
variable was referenced as multidir in command.
From-SVN: r250930
2017-08-07 Martin Liska <mliska@suse.cz>
* config/m32c/m32c.c: Add include of stringpool.h and attribs.h.
* config/rl78/rl78.c: Add include of attribs.h.
* config/sh/sh.c: Likewise.
* config/v850/v850.c: Likewise.
From-SVN: r250926
2017-08-07 Tom de Vries <tom@codesourcery.com>
PR middle-end/78266
* omp-expand.c (expand_oacc_for): Ensure diff_type is large enough.
* testsuite/libgomp.oacc-c-c++-common/vprop-2.c: New test.
* testsuite/libgomp.oacc-c-c++-common/vprop.c: Remove xfail.
From-SVN: r250925
The frame code uses a mixture of gen_rtx_MEM and gen_frame_mem for
callee-saves. Callee-saves never alias with local variables, so using
gen_frame_mem is best.
gcc/
* config/aarch64/aarch64.c (aarch64_pushwb_single_reg):
Use gen_frame_mem.
(aarch64_pop_regs): Likewise.
(aarch64_gen_load_pair): Likewise.
(aarch64_save_callee_saves): Likewise.
(aarch64_restore_callee_saves): Likewise.
From-SVN: r250919
Build only if pre-increment is supported. Given there is no config test,
add a list of targets which have HAVE_PRE_INCREMENT set.
testsuite/
PR middle-end/46932
* gcc.dg/pr46932.c: Compile on targets with pre-increment.
From-SVN: r250918
When there is no stack access, there is no need to use frame pointer
even if -fno-omit-frame-pointer is used.
gcc/
PR target/81736
* config/i386/i386.c (ix86_finalize_stack_realign_flags): Renamed
to ...
(ix86_finalize_stack_frame_flags): This. Also clear
frame_pointer_needed if -fno-omit-frame-pointer is used without
stack access.
(ix86_expand_prologue): Replace ix86_finalize_stack_realign_flags
with ix86_finalize_stack_frame_flags.
(ix86_expand_epilogue): Likewise.
(ix86_expand_split_stack_prologue): Likewise.
gcc/testsuite/
PR target/81736
* gcc.target/i386/pr81736-1.c: New test.
* gcc.target/i386/pr81736-2.c: Likewise.
* gcc.target/i386/pr81736-3.c: Likewise.
* gcc.target/i386/pr81736-4.c: Likewise.
From-SVN: r250916
The difference between Nehalem and Westmere is AES. We should set
priority to P_AES for Westmere, not P_PROC_SSE4_2 which is for Nehalem.
Otherwise, we will pick Nehalem implementation on Westmere. Tested on
Westmere.
PR target/81743
* config/i386/i386.c (get_builtin_code_for_version): Set priority
to P_AES for Westmere.
From-SVN: r250915
This patch is in use by Cygwin for years, upstream to GCC.
* gcc/config/i386/mingw.opt (fset-stack-executable): Removed.
* gcc/config/i386/cygming.opt (fset-stack-executable): Moved
from mingw.opt.
* gcc/config/i386/cygwin.h: Define CHECK_EXECUTE_STACK_ENABLED.
* ligcc/config.host (*-cygwin): Include file from mingw
config/i386/enable-execute-stack-mingw32.c
From-SVN: r250914
Slim RTL dumps print the RTL code NOT as !, but that is misleading:
its semantics are like the C operator ~. This fixes it.
* print-rtl.c (print_exp): Print NOT as "~" instead of as "!".
From-SVN: r250913
2017-08-07 Martin Liska <mliska@suse.cz>
* attribs.h (canonicalize_attr_name): New function.
(cmp_attribs): Move from c-format.c and adjusted.
(is_attribute_p): Moved from tree.h.
* tree-inline.c: Add new includes.
* tree.c (cmp_attrib_identifiers): Use cmp_attribs.
(private_is_attribute_p): Remove.
(private_lookup_attribute): Likewise.
(private_lookup_attribute_by_prefix): Simplify.
(remove_attribute): Use is_attribute_p.
* tree.h: Remove removed declarations.
2017-08-07 Martin Liska <mliska@suse.cz>
* array-notation-common.c: Add new includes.
* c-format.c( handle_format_attribute): Canonicalize a format
function name.
* c-lex.c (c_common_has_attribute): Canonicalize name of an
attribute.
* c-pretty-print.c: Add new include.
2017-08-07 Martin Liska <mliska@suse.cz>
* parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
attribute.
(cp_parser_std_attribute): Likewise.
* tree.c: Add new include.
2017-08-07 Martin Liska <mliska@suse.cz>
* c-parser.c (c_parser_attributes): Canonicalize name of an
attribute.
2017-08-07 Martin Liska <mliska@suse.cz>
* go-gcc.cc (Gcc_backend::function): Look up for no_split_stack
and not __no_split_stack__.
2017-08-07 Martin Liska <mliska@suse.cz>
* g++.dg/cpp0x/pr65558.C: Update scanned pattern.
* gcc.dg/parm-impl-decl-1.c: Likewise.
* gcc.dg/parm-impl-decl-3.c: Likewise.
* gcc.dg/Wattributes-5.c: New test.
From-SVN: r250911
PR middle-end/81698
* stmt.c (emit_case_dispatch_table): Add DEFAULT_EDGE argument,
instead of computing it in the function. Formatting fix.
(expand_case): Don't rely on default_edge being the first edge,
clear it if removing it, pass default_edge to
emit_case_dispatch_table.
(expand_sjlj_dispatch_table): Pass NULL as DEFAULT_EDGE, formatting
fix.
From-SVN: r250909