Commit Graph

171696 Commits

Author SHA1 Message Date
John David Anglin
c49af82c5f fptr.c: Disable -Warray-bounds warning.
* config/pa/fptr.c: Disable -Warray-bounds warning.

From-SVN: r276556
2019-10-03 23:51:42 +00:00
John David Anglin
320be74c5c pa.h (MAX_PCREL17F_OFFSET): Adjust.
* config/pa/pa.h (MAX_PCREL17F_OFFSET): Adjust.

From-SVN: r276555
2019-10-03 23:32:53 +00:00
John David Anglin
4a6cb9c0da pa.c (pa_output_call): Remove 64-bit sibcall sequence.
* config/pa/pa.c (pa_output_call): Remove 64-bit sibcall sequence.
	(pa_attr_length_call): Adjust length for 64-bit plabel sequence.

From-SVN: r276543
2019-10-03 22:39:49 +00:00
Aaron Sawdey
5d8bb3897e expr.c (emit_block_move_hints): Slightly cleaner fix to can_move_by_pieces issue.
2019-10-03  Aaron Sawdey <acsawdey@linux.ibm.com>

	* expr.c (emit_block_move_hints): Slightly cleaner fix to
	can_move_by_pieces issue.

From-SVN: r276542
2019-10-03 17:19:14 -05:00
Eduard-Mihai Burtescu
e1cb00db67 rust-demangle.c (looks_like_rust): Remove.
* rust-demangle.c (looks_like_rust): Remove.
	(rust_is_mangled): Don't check escapes.
	(is_prefixed_hash): Allow 0-9a-f permutations.
	(rust_demangle_sym): Don't bail on unknown escapes.
	* testsuite/rust-demangle-expected: Update 'main::$99$' test.

From-SVN: r276539
2019-10-03 15:54:47 -06:00
Steven G. Kargl
e23390d29e re PR fortran/91497 (-Wconversion warns when doing explicit type conversion)
2019-10-03  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91497
	* simplify.c (gfc_simplify_dble, simplify_intconv, gfc_simplify_real,
	gfc_simplify_sngl): Disable -Wconversion and -Wconversion-extra
	warnings for explicit conversion of literal constants.

2019-10-03  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91497
	* gfortran.dg/pr91497.f90: New test.

From-SVN: r276532
2019-10-03 20:46:26 +00:00
Iain Sandoe
24ec3cc957 [Darwin] Pick up SDKROOT as the sysroot fallback.
For compatibility with xcrun and the behaviour of the clang driver, make use
of the setting of the SDKROOT environment variable when it is available.
This applies to both finding headers and libraries (i.e. it is also passed to
ld64).

Priority:
 1. User's command-line specified --sysroot= or -isysroot.
 2. The SDKROOT variable when set, and validated.
 3. Any sysroot provided by --with-sysroot= configuration parameter.
 
SDKROOT is checked thus:
  1. Presence.
  2. That it starts with "/" (i.e. 'absolute').
  3. That it is not "/" only (since that's the default).
  4. That it is readable by the process executing the driver.

This is pretty much the same rule set as used by the clang driver.

NOTE: (3) might turn out to be overly restrictive in the case that we
have configured with --with-sysroot= and then we want to run on a system
with an installation of the headers/libraries in /.  We can revisit this
if that turns out to be an important use-case.

So one can do:

xcrun --sdk macosx /path/to/gcc ....

and that provides the SDK path as the sysroot to GCC as expected.

CAVEAT: An unfortunate effect of the fact that "gcc" (and "g++") are
executables in the Xcode installation, which are found ahead of any such
named in the $PATH:

PATH=/path/to/gcc/install:$PATH
xcrun --sdk macosx gcc .... 

does *not* work, instead that executes the clang from the xcode/commmand
line tools installation.

PATH=/path/to/gcc/install:$PATH
xcrun --sdk macosx x64_64-apple-darwinXX-gcc ... 

does work as expected, however.

gcc/ChangeLog:

2019-10-03  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/87243
	* config/darwin-driver.c (maybe_get_sysroot_from_sdkroot): New.
	(darwin_driver_init): Use the sysroot provided by SDKROOT when that
	is available and the user has not set one on the command line.

From-SVN: r276530
2019-10-03 20:19:18 +00:00
Jan Hubicka
cfcf3551c4 * g++.dg/tree-ssa/pr61034.C: Add --param max-inline-insns-single-O2=200.
From-SVN: r276527
2019-10-03 19:45:23 +00:00
Dragan Mladjenovic
206c926ae2 re PR target/91769 (wrong code with -O2 on MIPS)
Fix PR target/91769

This fixes the issue by checking that addr's base reg is not part of dest
multiword reg instead just checking the first reg of dest.

gcc/ChangeLog:

2019-10-03  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	PR target/91769
	* config/mips/mips.c (mips_split_move): Use reg_overlap_mentioned_p
	instead of REGNO equality check on addr.reg.

gcc/testsuite/ChangeLog:

2019-10-03  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	PR target/91769
	* gcc.target/mips/pr91769.c: New test.

From-SVN: r276525
2019-10-03 19:17:20 +00:00
Julian Brown
6c7e076b74 Libgomp magic offset value self-documentation
2019-10-02  Julian Brown  <julian@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>

	libgomp/
	* libgomp.h (OFFSET_INLINED, OFFSET_POINTER, OFFSET_STRUCT): Define.
	* target.c (FIELD_TGT_EMPTY): Define.
	(gomp_map_val): Use OFFSET_* macros instead of magic constants.  Write
	as switch instead of list of ifs.
	(gomp_map_vars_internal): Use OFFSET_* and FIELD_TGT_EMPTY macros.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>

From-SVN: r276519
2019-10-03 17:48:36 +00:00
Bernd Edlinger
5dbe01a1ff primary.c (match_real_constant): Remove shadowing local vars.
2019-10-03  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * primary.c (match_real_constant): Remove shadowing local vars.
        Rename local vars.  Fix undefined behavior in loop termination.
        (gfc_convert_to_structure_constructor): Rename local var.

From-SVN: r276518
2019-10-03 17:03:43 +00:00
Jan Hubicka
2925cad215 params.def (PARAM_INLINE_HEURISTICS_HINT_PERCENT, [...]): New.
* params.def (PARAM_INLINE_HEURISTICS_HINT_PERCENT,
	PARAM_INLINE_HEURISTICS_HINT_PERCENT_O2): New.
	* doc/invoke.texi (inline-heuristics-hint-percent,
	inline-heuristics-hint-percent-O2): Document.
	* tree-inline.c (inline_insns_single, inline_insns_auto): Add new
	hint attribute.
	(can_inline_edge_by_limits_p): Use it.

From-SVN: r276516
2019-10-03 15:08:21 +00:00
Rainer Orth
ebf8247e7b Avoid reserved identifier in include/parallel/multiway_merge.h
* include/parallel/multiway_merge.h (_RAIter3): Replace _C by _Cp.

From-SVN: r276515
2019-10-03 14:35:35 +00:00
Rainer Orth
a164d19acb Check init_priority in g++.dg/cpp0x/gen-attrs-67.C
gcc/testsuite:
	* g++.dg/cpp0x/gen-attrs-67.C: Expect constructor priorities error
	on any !init_priority target.

From-SVN: r276510
2019-10-03 13:23:52 +00:00
Richard Sandiford
eec306385d [arm] Fix rtl-checking failure in arm_print_value
Noticed while debugging the arm bootstrap failure.

2019-10-03  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/arm/arm.c (arm_print_value): Use real_to_decimal
	to print CONST_DOUBLEs.

From-SVN: r276508
2019-10-03 13:05:31 +00:00
Andrea Corallo
12e088ba57 re PR jit/91928 (libgccjit fails on subsequent compilations in ipa-cp)
PR jit/91928

	* ipa-cp.c (ipa_cp_c_finalize): Release ipcp_transformation_sum.
	* ipa-prop.c (ipcp_free_transformation_sum): New function.
	* ipa-prop.h (ipcp_free_transformation_sum): Add declaration.

From-SVN: r276507
2019-10-03 12:39:55 +00:00
Thomas Koenig
3aad513c68 re PR fortran/84487 (Large rodate section increase in 465.tonto with r254427)
2019-10-03  Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/84487
	* trans-decl.c (gfc_get_symbol_decl): For __def_init, set
	DECL_ARTIFICAL and do not set TREE_READONLY.

2019-10-03  Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/84487
	* gfortran.dg/typebound_call_22.f03: xfail.

From-SVN: r276506
2019-10-03 12:39:42 +00:00
Mark Eggleston
f61e54e59c Character typenames in errors and warnings
Character type names now incorporate length, kind is only shown if
the default character is not being used.
    
Examples:
   
  character(7) is reported as CHARACTER(7)
  character(len=20,kind=4) is reported as CHARACTER(20,4)
   
dummy character variables with assumed length:
    
  character(*) is reported as CHARACTER(*)
  character(*,kind=4) is reported as CHARACTER(*,4)

From-SVN: r276505
2019-10-03 09:40:23 +00:00
Aldy Hernandez
38a734350f Makefile.in (OBJS): Add range.o and range-op.o.
* Makefile.in (OBJS): Add range.o and range-op.o.
	Remove wide-int-range.o.
	* function-tests.c (test_ranges): New.
	(function_tests_c_tests): Call test_ranges.
	* ipa-cp.c (ipa_vr_operation_and_type_effects): Call
	range_fold_unary_expr instead of extract_range_from_unary_expr.
	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Same.
	* range-op.cc: New file.
	* range-op.h: New file.
	* range.cc: New file.
	* range.h: New file.
	* selftest.h (range_tests): New prototype.
	* ssa.h: Include range.h.
	* tree-vrp.c (value_range_base::value_range_base): New
	constructors.
	(value_range_base::singleton_p): Do not call
	ranges_from_anti_range until sure we will need to.
	(value_range_base::type): Rename gcc_assert to
	gcc_checking_assert.
	(vrp_val_is_max): New argument.
	(vrp_val_is_min): Same.
	(wide_int_range_set_zero_nonzero_bits): Move from
	wide-int-range.cc.
	(extract_range_into_wide_ints): Remove.
	(extract_range_from_multiplicative_op): Remove.
	(extract_range_from_pointer_plus_expr): Abstract POINTER_PLUS code
	from extract_range_from_binary_expr.
	(extract_range_from_plus_minus_expr): Abstract PLUS/MINUS code
	from extract_range_from_binary_expr.
	(extract_range_from_binary_expr): Remove.
	(normalize_for_range_ops): New.
	(range_fold_binary_expr): New.
	(range_fold_unary_expr): New.
	(value_range_base::num_pairs): New.
	(value_range_base::lower_bound): New.
	(value_range_base::upper_bound): New.
	(value_range_base::upper_bound): New.
	(value_range_base::contains_p): New.
	(value_range_base::invert): New.
	(value_range_base::union_): New.
	(value_range_base::intersect): New.
	(range_compatible_p): New.
	(value_range_base::operator==): New.
	(determine_value_range_1): Call range_fold_*expr instead of
	extract_range_from_*expr.
	* tree-vrp.h (class value_range_base): Add new constructors.
	Add methods for union_, intersect, operator==, contains_p,
	num_pairs, lower_bound, upper_bound, invert.
	(vrp_val_is_min): Add handle_pointers argument.
	(vrp_val_is_max): Same.
	(extract_range_from_unary_expr): Remove.
	(extract_range_from_binary_expr): Remove.
	(range_fold_unary_expr): New.
	(range_fold_binary_expr): New.
	* vr-values.c (vr_values::extract_range_from_binary_expr): Call
	range_fold_binary_expr instead of extract_range_from_binary_expr.
	(vr_values::extract_range_basic): Same.
	(vr_values::extract_range_from_unary_expr): Call
	range_fold_unary_expr instead of extract_range_from_unary_expr.
	* wide-int-range.cc: Remove.
	* wide-int-range.h: Remove.

From-SVN: r276504
2019-10-03 08:08:50 +00:00
Michael Meissner
0a8c8f4d65 Undo unintended change to predicates.md in subversion id 276498
From-SVN: r276503
2019-10-03 00:17:56 +00:00
GCC Administrator
e6f53878db Daily bump.
From-SVN: r276502
2019-10-03 00:16:19 +00:00
Michael Meissner
e5ec901cec Use the SIGNED_16BIT_OFFSET_EXTRA_P macro for 16-bit signed tests.
2019-10-02   Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.c (mem_operand_gpr): Use
	SIGNED_16BIT_OFFSET_EXTRA_P.
	(mem_operand_ds_form): Use SIGNED_16BIT_OFFSET_EXTRA_P.
	(rs6000_mode_dependent_address): Use SIGNED_16BIT_OFFSET_EXTRA_P.

From-SVN: r276498
2019-10-03 00:13:40 +00:00
Joseph Myers
202be58655 Define WIDTH macros for C2x.
As part of the integration of TS 18661-1 into C2x, many features
became unconditional features not depending on any feature test macro
being defined.  This patch updates the conditionals on the *_WIDTH
macros in limits.h and stdint.h accordingly so that they are defined
for C2x.  The macro CR_DECIMAL_DIG in float.h does still require
__STDC_WANT_IEC_60559_BFP_EXT__ to be defined, and a test for this is
added.

Bootstrapped with no regressions on x86_64-pc-linux-gnu.

gcc:
	* ginclude/stdint-gcc.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Change
	condition on WIDTH macros to [__STDC_WANT_IEC_60559_BFP_EXT__ ||
	(__STDC_VERSION__ && __STDC_VERSION__ > 201710L)].
	* glimits.h: Likewise.

gcc/testsuite:
	* gcc.dg/cr-decimal-dig-2.c: New test.
	* gcc.dg/limits-width-2.c: New test.  Based on limits-width-1.c.
	* gcc.dg/stdint-width-2.c: New test.  Based on stdint-width-1.c.

From-SVN: r276497
2019-10-03 00:50:58 +01:00
Paolo Carlini
f5fc32e4a3 init.c (build_new): Use cp_expr_loc_or_input_loc in two places.
/cp
2019-10-03  Paolo Carlini  <paolo.carlini@oracle.com>

	* init.c (build_new): Use cp_expr_loc_or_input_loc in two places.
	* name-lookup.c (do_pushdecl): Use DECL_SOURCE_LOCATION.
	(push_class_level_binding_1): Likewise.
	(set_decl_namespace): Likewise.

/testsuite
2019-10-03  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/diagnostic/integral-array-size-1.C: New.
	* g++.dg/cpp0x/alias-decl-1.C: Test location(s) too.
	* g++.dg/init/new43.C: Likewise.
	* g++.dg/lookup/friend12.C: Likewise.
	* g++.dg/lookup/pr79766.C: Likewise.
	* g++.dg/lookup/pr84375.C: Likewise.
	* g++.dg/other/new-size-type.C: Likewise.

From-SVN: r276496
2019-10-02 23:23:51 +00:00
Jakub Jelinek
775eaa4d83 re PR rtl-optimization/91976 (RTL check: expected code 'const_int', have 'reg' in emit_block_move_hints, at expr.c:1627)
PR rtl-optimization/91976
	* expr.c (emit_block_move_hints): Don't call can_move_by_pieces if
	size is not CONST_INT_P, set pieces_ok to false in that case.  Simplify
	CONST_INT_P (size) && pieces_ok to pieces_ok.  Formatting fix.

From-SVN: r276495
2019-10-03 00:33:39 +02:00
Jakub Jelinek
1006c9d439 constexpr.c (cxx_eval_constant_expression): If not skipping upon entry to body...
* constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>: If
	not skipping upon entry to body, run cleanup with the same *jump_target
	as it started to run the cleanup even if the body returns, breaks or
	continues.
	(potential_constant_expression_1): Allow CLEANUP_STMT.

	* g++.dg/ext/constexpr-attr-cleanup1.C: New test.

From-SVN: r276494
2019-10-03 00:32:56 +02:00
Jakub Jelinek
276a52d556 constexpr.c (cxx_eval_store_expression): Formatting fix.
* constexpr.c (cxx_eval_store_expression): Formatting fix.  Handle
	const_object_being_modified with array type.

From-SVN: r276493
2019-10-03 00:31:58 +02:00
Martin Sebor
bead578432 Add changelog entries for r276491.
From-SVN: r276492
2019-10-02 16:04:00 -06:00
Martin Sebor
d1090a8a80 PR tree-optimization/80936 - bcmp, bcopy, and bzero not declared nonnull
gcc/testsuite/ChangeLog:

	PR tree-optimization/80936
	* gcc.dg/Wnonnull-2.c: New test.
	* gcc.dg/Wnonnull-3.c: New test.
	* gcc.dg/nonnull-3.c: Expect more warnings.

gcc/ChangeLog:

	PR tree-optimization/80936
	* builtins.def (bcmp, bcopy, bzero): Declare nonnull.

From-SVN: r276491
2019-10-02 16:00:42 -06:00
Richard Sandiford
aa29ed6db6 Fix ALL_REGS thinko in initialisation of function_used_regs
My change to the -fipa-ra bookkeeping used ALL_REGS as the supposedly
safe default assumption, but ALL_REGS isn't literally all registers,
just a close approximation.

This caused a bootstrap failure on arm-linux-gnu, where the condition
code register isn't in ALL_REGS and so was being masked out of some
call-clobbered sets.

2019-10-02  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* cgraph.c (cgraph_node::rtl_info): Use SET_HARD_REG_SET
	instead of reg_class_contents[ALL_REGS].

From-SVN: r276489
2019-10-02 21:19:35 +00:00
Ian Lance Taylor
b7c4123032 runtime: mark go-context.S as no-executable-stack and split-stack supported
The .note.GNU-stack section tells the linker that this object does not
    require an executable stack.
    
    The .note.GNU-split-stack section tells the linker that functions in
    this object can be called directly by split-stack functions, without
    require a large stack.
    
    The .note.GNU-no-split-stack section tells the linker that functions
    in this object do not have a split-stack prologue.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/198440

From-SVN: r276488
2019-10-02 20:11:35 +00:00
Jason Merrill
b830c28b56 Improve C++ fold caching efficiency.
While looking at concepts caching I noticed that we were clearing the caches
unnecessarily for non-constant initialization, which shouldn't affect
folding.

	* typeck2.c (store_init_value): Only clear_cv_and_fold_caches if the
	value is constant.

From-SVN: r276487
2019-10-02 16:01:42 -04:00
Jason Merrill
c89844e5d3 Add some hash_map_safe_* functions like vec_safe_*.
gcc/
	* hash-map.h (default_hash_map_size): New variable.
	(create_ggc): Use it as default argument.
	(hash_map_maybe_create, hash_map_safe_get)
	(hash_map_safe_get_or_insert, hash_map_safe_put): New fns.
gcc/cp/
	* constexpr.c (maybe_initialize_fundef_copies_table): Remove.
	(get_fundef_copy): Use hash_map_safe_get_or_insert.
	* cp-objcp-common.c (cp_get_debug_type): Use hash_map_safe_*.
	* decl.c (store_decomp_type): Remove.
	(cp_finish_decomp): Use hash_map_safe_put.
	* init.c (get_nsdmi): Use hash_map_safe_*.
	* pt.c (store_defaulted_ttp, lookup_defaulted_ttp): Remove.
	(add_defaults_to_ttp): Use hash_map_safe_*.

From-SVN: r276484
2019-10-02 15:26:47 -04:00
Andreas Tobler
d61bff850d Testsuite, remove alloca header
2019-10-02  Andreas Tobler  <andreast@gcc.gnu.org>

	* testsuite/libgomp.oacc-c-c++-common/loop-default.h: Remove alloca.h
	include. Replace alloca () with __builtin_alloca ().
	* testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c: Likewise.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>

From-SVN: r276479
2019-10-02 21:05:35 +02:00
Steven G. Kargl
c20a90e0c8 re PR fortran/91784 (ICE in gfc_real2complex, at fortran/arith.c:2208)
2019-10-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91784
	* simplify.c (gfc_convert_constant): Simplify expression if the
	expres	ion type is EXPR_OP.

2019-10-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91784
	* gfortran.dg/pr91784.f90: New test.

From-SVN: r276474
2019-10-02 17:17:55 +00:00
Steven G. Kargl
307de10071 re PR fortran/91785 (ICE in check_assumed_size_reference, at fortran/resolve.c:1601)
2019-10-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91785
	* primary.c (gfc_match_varspec): Ensure an inquiry parameter has
	it locus set.

2019-10-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91785
	* gfortran.dg/pr91785.f90: New test.

From-SVN: r276473
2019-10-02 17:09:45 +00:00
Steven G. Kargl
939e9f696b re PR fortran/91942 (ICE in match_vtag, at fortran/io.c:1485)
2019-10-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91942
	* io.c (match_vtag): Check for non-NULL result->symtree.
	(match_out_tag): Check for invalid constant due to inquiry parameter.
	(match_filepos): Instead of a syntax error, go to cleanup to get better
	error messages.

2019-10-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91942
	* gfortran.dg/pr91587.f90: Update dg-error regex.
	* gfortran.dg/pr91942.f90: New test.

From-SVN: r276472
2019-10-02 17:04:57 +00:00
Steven G. Kargl
8b4e5e711d re PR fortran/91943 (ICE in gfc_conv_constant_to_tree, at fortran/trans-const.c:370)
2019-10-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91943
	* match.c (gfc_match_call): BOZ cannot be an actual argument in
	a subroutine reference.
	* resolve.c (resolve_function): BOZ cannot be an actual argument in
	a function reference.
 
2019-10-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91943
	gfortran.dg/pr91943.f90

From-SVN: r276471
2019-10-02 17:01:30 +00:00
Jan Hubicka
b1fb82e525 cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT, [...]): New.
* cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT,
	MAX_INLINE_INSNS_AUTO_O2_LIMIT): New.
	* ipa-inline.c (inline_insns_single, inline_insns_auto): New functions.
	(can_inline_edge_by_limits_p): Use it.
	(big_speedup_p): Use PARAM_INLINE_MIN_SPEEDUP_O2.
	(want_inline_small_function_p): Use O2 bounds.
	(edge_badness): LIkewise.
	* opts.c (default_options): Add OPT_finline_functions.
	* params.def (PARAM_INLINE_MIN_SPEEDUP_O2,
	PARAM_MAX_INLINE_INSNS_SINGLE_O2, PARAM_MAX_INLINE_INSNS_AUTO_O2):
	New parameters.

	* g++.dg/tree-ssa/pr53844.C: Add -fno-inline-functions --param
	max-inline-insns-single-O2=200.
	* gcc.c-torture/execute/builtins/builtins.exp: Add
	-fno-inline-functions to additional_flags.
	* gcc.dg/ipa/inline-7.c: Add -fno-inline-functions.
	* gcc.dg/optimize-bswapsi-5.c: Add -fno-inline-functions.
	* gcc.dg/tree-ssa/ssa-thread-12.c: Add --param
	early-inlining-insns-O2=14 -fno-inline-functions; revert previous
	change.
	* gcc.dg/winline-3.c: Use --param max-inline-insns-single-O2=1
	--param inline-min-speedup-O2=100
	instead of --param max-inline-insns-single=1 --param
	inline-min-speedup=100

	* invoke.texi (-finline-functions): Update documentation.
	(max-inline-insns-single-O2, max-inline-insns-auto-O2,
	inline-min-speedup-O2): Document.
	(early-inlining-insns-O2): Simplify docs.

From-SVN: r276470
2019-10-02 16:02:16 +00:00
Jan Hubicka
562d1e9556 cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT, [...]): New.
* cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT,
	MAX_INLINE_INSNS_AUTO_O2_LIMIT): New.
	* ipa-inline.c (inline_insns_single, inline_insns_auto): New functions.
	(can_inline_edge_by_limits_p): Use it.
	(big_speedup_p): Use PARAM_INLINE_MIN_SPEEDUP_O2.
	(want_inline_small_function_p): Use O2 bounds.
	(edge_badness): LIkewise.
	* opts.c (default_options): Add OPT_finline_functions.
	* params.def (PARAM_INLINE_MIN_SPEEDUP_O2,
	PARAM_MAX_INLINE_INSNS_SINGLE_O2, PARAM_MAX_INLINE_INSNS_AUTO_O2):
	New parameters.

	* g++.dg/tree-ssa/pr53844.C: Add -fno-inline-functions --param
	max-inline-insns-single-O2=200.
	* gcc.c-torture/execute/builtins/builtins.exp: Add
	-fno-inline-functions to additional_flags.
	* gcc.dg/ipa/inline-7.c: Add -fno-inline-functions.
	* gcc.dg/optimize-bswapsi-5.c: Add -fno-inline-functions.
	* gcc.dg/tree-ssa/ssa-thread-12.c: Add --param
	early-inlining-insns-O2=14 -fno-inline-functions; revert previous
	change.
	* gcc.dg/winline-3.c: Use --param max-inline-insns-single-O2=1
	--param inline-min-speedup-O2=100
	instead of --param max-inline-insns-single=1 --param
	inline-min-speedup=100

	* invoke.texi (-finline-functions): Update documentation.
	(max-inline-insns-single-O2, max-inline-insns-auto-O2,
	inline-min-speedup-O2): Document.
	(early-inlining-insns-O2): Simplify docs.

From-SVN: r276469
2019-10-02 16:01:47 +00:00
Jonathan Wakely
352d2690f1 Remove greedy wildcards from libstdc++ linker script
The only symbols matched by std::e[a-q]* and std::e[s-z]* that are
supposed to be in the GLIBCXX_3.4 version are std::exception::* and
std::endl and std::ends. The latter two already have explicit patterns
matching them, so we just need to match std::exception::*.

This change ensures that any new symbols with a return type of
std::enable_if<...> are not added to the GLIBCXX_3.4 version.

	* config/abi/pre/gnu.ver: Tighten up greedy wildcards.

From-SVN: r276468
2019-10-02 16:52:41 +01:00
Alexander Monakov
1764d63bd9 ifcvt: improve cost estimation (PR 87047)
PR rtl-optimization/87047
	* ifcvt.c (average_cost): New static function.  Use it...
	(noce_process_if_block): ... here.

testsuite/
	* gcc.dg/pr87047.c: New test.

From-SVN: r276466
2019-10-02 18:37:12 +03:00
Martin Jambor
a264ea9a5b [PR testsuite/91842] Skip gcc.dg/ipa/ipa-sra-19.c on power
2019-10-02  Martin Jambor  <mjambor@suse.cz>

	PR testsuite/91842
	* gcc.dg/ipa/ipa-sra-19.c: Skip on powerpc.

From-SVN: r276465
2019-10-02 17:09:37 +02:00
Jan Hubicka
408b33fcc3 module.c (load_commons): Initialize flags to 0 to silecne -Wmaybe-uninitialized warning.
* module.c (load_commons): Initialize flags to 0 to silecne
	-Wmaybe-uninitialized warning.
	(read_module): Likewise for n and comp_name.

From-SVN: r276464
2019-10-02 15:07:52 +00:00
Jonathan Wakely
709310e7a4 Document non-conformance of parallel mode to recent C++ standards
* doc/xml/manual/parallel_mode.xml: Add caveat about support for
	recent standards.
	* doc/html/*: Regenerate.

From-SVN: r276463
2019-10-02 15:56:57 +01:00
Aaron Sawdey
c8241327cd rs6000-protos.h (expand_block_move): Change prototype.
2019-10-02  Aaron Sawdey <acsawdey@linux.ibm.com>

	* config/rs6000/rs6000-protos.h (expand_block_move): Change prototype.
	* config/rs6000/rs6000-string.c (expand_block_move): Add
	might_overlap parm.
	* config/rs6000/rs6000.md (movmemsi): Add new pattern.
	(cpymemsi): Add might_overlap parm to expand_block_move() call.

From-SVN: r276462
2019-10-02 09:26:09 -05:00
Aaron Sawdey
03a9b90aa6 builtins.c (expand_builtin_memory_copy_args): Add might_overlap parm.
2019-10-02  Aaron Sawdey <acsawdey@linux.ibm.com>

	* builtins.c (expand_builtin_memory_copy_args): Add might_overlap parm.
	(expand_builtin_memcpy): Use might_overlap parm.
	(expand_builtin_mempcpy_args): Use might_overlap parm.
	(expand_builtin_memmove): Call expand_builtin_memory_copy_args.
	(expand_builtin_memory_copy_args): Add might_overlap parm.
	* expr.c (emit_block_move_via_cpymem): Rename to
	emit_block_move_via_pattern, add might_overlap parm, use cpymem
	or movmem optab as appropriate.
	(emit_block_move_hints): Add might_overlap parm, do the right
	thing for might_overlap==true.
	* expr.h (emit_block_move_hints): Update prototype.

From-SVN: r276461
2019-10-02 09:23:51 -05:00
Eric Botcazou
629387a658 tree-eh.h (unsplit_eh_edges): Declare.
* tree-eh.h (unsplit_eh_edges): Declare.
	* tree-eh.c (maybe_remove_unreachable_handlers): Detect more cases.
	(unsplit_eh_edges): New function wrapping unsplit_all_eh.
	* gimple-ssa-store-merging.c: Include cfganal.h cfgcleanup.h except.h.
	(struct store_immediate_info): Add lp_nr field.
	(store_immediate_info::store_immediate_info): Add NR2 parameter and
	initialize lp_nr with it.
	(struct merged_store_group): Add lp_nr and only_constants fields.
	(merged_store_group::merged_store_group): Initialize them.
	(merged_store_group::can_be_merged_into): Deal with them.
	(pass_store_merging): Rename terminate_and_release_chain into
	terminate_and_process_chain.
	(pass_store_merging::terminate_and_process_all_chains): Adjust to above
	renaming and remove useless assertions.
	(pass_store_merging::terminate_all_aliasing_chains): Small tweak.
	(stmts_may_clobber_ref_p): Be prepared for different basic blocks.
	(imm_store_chain_info::coalesce_immediate_stores): Use only_constants
	instead of always recomputing it and compare lp_nr.
	(imm_store_chain_info::output_merged_store): If the group is in an
	active EH region, register new stores if they can throw.  Moreover,
	if the insertion has created new basic blocks, adjust the PHI nodes
	of the post landing pad.
	(imm_store_chain_info::output_merged_stores): If the original stores
	are in an active EH region, deregister them.
	(lhs_valid_for_store_merging_p): Prettify.
	(adjust_bit_pos): New function extracted from...
	(mem_valid_for_store_merging): ...here.  Use it for the base address
	and also for the offset if it is the addition of a constant.
	(lp_nr_for_store): New function.
	(pass_store_merging::process_store): Change return type to bool.
	Call lp_nr_for_store to initialize the store info.  Propagate the
	return status of various called functions to the return value.
	(store_valid_for_store_merging_p): New predicate.
	(enum basic_block_status): New enumeration.
	(get_status_for_store_merging): New function.
	(pass_store_merging::execute): If the function can throw and catch
	non-call exceptions, unsplit the EH edges on entry and clean up the
	CFG on exit if something changed.  Call get_status_for_store_merging
	for every basic block and keep the chains open across basic blocks
	when possible.  Terminate and process open chains at the end, if any.

From-SVN: r276459
2019-10-02 13:35:40 +00:00
Richard Sandiford
ea4b29d53a Fix shadowing in globalize_reg
2019-10-02  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* reginfo.c (globalize_reg): Fix shadowed variable in
	function_abis walk.

From-SVN: r276457
2019-10-02 13:12:37 +00:00
Richard Sandiford
4bdb8c3dca Fix MIPS call-clobbered-*.c tests
Jeff pointed out that gcc.target/mips/call-clobbered-4.c started
failing after the function-abi series.  This is because IRA used
to treat partly call-clobbered registers as hard conflicts and
so wouldn't consider them for -fcaller-saves.  Now that we treat
call clobbers the same way regardless of where they come from,
we can use $f21 as a caller-save register.  This in turn means
that -Os is no longer a special case in call-clobbered-3.c.

(The new code is the same size as the old code.)

2019-10-02  Richard Sandiford  <richard.sandiford@arm.com>

gcc/testsuite/
	* gcc.target/mips/call-clobbered-3.c: Remove skip for -Os.
	* gcc.target/mips/call-clobbered-4.c: Delete.

From-SVN: r276456
2019-10-02 13:11:45 +00:00