Commit Graph

168538 Commits

Author SHA1 Message Date
Martin Liska
a9d5227c6c Fix a plural in a param description.
2019-05-10  Martin Liska  <mliska@suse.cz>

	* params.def (PARAM_GIMPLE_FE_COMPUTED_HOT_BB_THRESHOLD):
	Fix plural form.

From-SVN: r271060
2019-05-10 09:22:54 +00:00
Jakub Jelinek
425f5fd4c4 re PR tree-optimization/90385 (ICE: tree check: expected ssa_name, have real_cst in transform_to_exit_first_loop_alt, at tree-parloops.c:1772)
PR tree-optimization/90385
	* tree-parloops.c (try_create_reduction_list): Punt on non-SSA_NAME
	arguments of the exit phis.

	* gfortran.dg/pr90385.f90: New test.

From-SVN: r271059
2019-05-10 10:20:38 +02:00
Jakub Jelinek
b5cbaee240 re PR c++/90383 (GCC generates invalid constexpr copy/move assignment operators for types with trailing padding. (Again))
PR c++/90383
	* tree-inline.h (struct copy_body_data): Add do_not_fold member.
	* tree-inline.c (remap_gimple_op_r): Avoid folding expressions if
	id->do_not_fold.
	(copy_tree_body_r): Likewise.
	(copy_fn): Set id.do_not_fold to true.

	* g++.dg/cpp1y/constexpr-90383-1.C: New test.
	* g++.dg/cpp1y/constexpr-90383-2.C: New test.

From-SVN: r271058
2019-05-10 10:19:44 +02:00
Paul Thomas
0a52429609 re PR fortran/90093 (Extended C interop: optional argument incorrectly identified as PRESENT)
2019-05-10  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/90093
	* trans-decl.c (convert_CFI_desc): Test that the dummy is
	present before doing any of the conversions.

	PR fortran/90352
	* decl.c (gfc_verify_c_interop_param): Restore the error for
	charlen > 1 actual arguments passed to bind(C) procs.
	Clean up trailing white space.

	PR fortran/90355
	* trans-array.c (gfc_trans_create_temp_array): Set the 'span'
	field to the element length for all types.
	(gfc_conv_expr_descriptor): The force_no_tmp flag is used to
	prevent temporary creation, especially for substrings.
	* trans-decl.c (gfc_trans_deferred_vars): Rather than assert
	that the backend decl for the string length is non-null, use it
	as a condition before calling gfc_trans_vla_type_sizes.
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): 'force_no_tmp'
	is set before calling gfc_conv_expr_descriptor.
	* trans.c (get_array_span): Move the code for extracting 'span'
	from gfc_build_array_ref to this function. This is specific to
	descriptors that are component and indirect references.
	* trans.h : Add the force_no_tmp flag bitfield to gfc_se.

2019-05-10  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/90093
	* gfortran.dg/ISO_Fortran_binding_12.f90: New test.
	* gfortran.dg/ISO_Fortran_binding_12.c: Supplementary code.

	PR fortran/90352
	* gfortran.dg/iso_c_binding_char_1.f90: New test.

	PR fortran/90355
	* gfortran.dg/ISO_Fortran_binding_4.f90: Add 'substr' to test
	the direct passing of substrings as descriptors to bind(C).
	* gfortran.dg/assign_10.f90: Increase the tree_dump count of
	'atmp' to account for the setting of the 'span' field.
	* gfortran.dg/transpose_optimization_2.f90: Ditto.

From-SVN: r271057
2019-05-10 07:59:42 +00:00
Jakub Jelinek
e965aaf602 re PR tree-optimization/88709 (Improve store-merging)
PR tree-optimization/88709
	PR tree-optimization/90271
	* gcc.dg/store_merging_29.c: Allow 4 stores to replace 6 stores on
	arm*-*-*.

From-SVN: r271056
2019-05-10 09:53:23 +02:00
Jakub Jelinek
8a6c4d31f0 re PR pch/90326 (Using any precompiled header breaks definition of FLT_MAX)
PR pch/90326
cp/
	* config-lang.in (gtfiles): Remove c-family/c-lex.c, add
	c-family/c-cppbuiltin.c.
objc/
	* config-lang.in (gtfiles): Add c-family/c-format.c.
objcp/
	* config-lang.in (gtfiles): Don't add c-family/c-cppbuiltin.c.
testsuite/
	* g++.dg/pch/pr90326.C: New test.
	* g++.dg/pch/pr90326.Hs: New file.

From-SVN: r271055
2019-05-10 09:39:46 +02:00
Martin Liska
ecd71fee44 Reapply r269790 which was missed during rebase.
2019-05-10  Martin Liska  <mliska@suse.cz>

	* config/i386/i386-expand.c (ix86_expand_floorceildf_32):
	Reapply changes from r269790.

From-SVN: r271054
2019-05-10 07:22:31 +00:00
Martin Liska
26f36b50ea Add params for jump-table expansion params (PR middle-end/90340).
2019-05-10  Martin Liska  <mliska@suse.cz>

	PR middle-end/90340
	* doc/invoke.texi: New params.
	* params.def (PARAM_JUMP_TABLE_MAX_GROWTH_RATIO_FOR_SIZE): New.
	(PARAM_JUMP_TABLE_MAX_GROWTH_RATIO_FOR_SPEED): Likewise.
	* tree-switch-conversion.c (jump_table_cluster::can_be_handled):
	Use it.
	* tree-switch-conversion.h (struct jump_table_cluster):
	Likewise.
2019-05-10  Martin Liska  <mliska@suse.cz>

	PR middle-end/90340
	* gcc.dg/tree-ssa/pr90340-2.c: New test.
	* gcc.dg/tree-ssa/pr90340.c: New test.

From-SVN: r271053
2019-05-10 06:32:31 +00:00
Martin Liska
38613b9baa Fix location where lto-dump is installed.
2019-05-10  Martin Liska  <mliska@suse.cz>

	* Make-lang.in: Use program_transform_name for lto-dump.
	* config-lang.in: Do not mark lto-dump compiler as we don't
	want to have it installed at
	lib/gcc/x86_64-pc-linux-gnu/10.0.0/lto-dump.

From-SVN: r271052
2019-05-10 06:31:32 +00:00
GCC Administrator
4422618161 Daily bump.
From-SVN: r271051
2019-05-10 00:16:15 +00:00
Segher Boessenkool
ddbb5da519 combine: Don't generate IF_THEN_ELSE
On all targets I managed to test (21) this results in better code.  Only
alpha ends up with slightly bigger code.


	* combine.c (combine_simplify_rtx): Don't make IF_THEN_ELSE RTL.

From-SVN: r271047
2019-05-10 02:08:41 +02:00
Joseph Myers
bd0ea08ef4 * de.po, fr.po: Update.
From-SVN: r271045
2019-05-09 22:41:07 +01:00
Cherry Zhang
8743680541 compiler: avoid copy for string([]byte) conversion used in map keys
If a string([]byte) conversion is used immediately as a key for a
    map read, we don't need to copy the backing store of the byte
    slice, as mapaccess does not keep a reference to it.
    
    The gc compiler does more than this: it also avoids the copy if
    the map key is a composite literal that contains the conversion
    as a field, like, T{ ... { ..., string(b), ... }, ... }. For now,
    we just optimize the simple case, which is probably most common.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/176197

	* go.dg/mapstring.go: New test.

From-SVN: r271044
2019-05-09 21:24:56 +00:00
Bill Schmidt
08e113f4ae loop.texi: Remove reference to FOR_EACH_LOOP_BREAK.
2019-05-09  Bill Schmidt  <wschmidt@linux.ibm.com>

	* doc/loop.texi: Remove reference to FOR_EACH_LOOP_BREAK.

From-SVN: r271042
2019-05-09 19:54:39 +00:00
Alexander Monakov
41a4d47581 sel-sched: allow negative insn priority (PR 88879)
PR rtl-optimization/88879
	* sel-sched.c (sel_target_adjust_priority): Remove assert.

From-SVN: r271039
2019-05-09 21:13:28 +03:00
Richard Earnshaw
bf822e194f [arm] PR target/90405 New test.
This time really add the test.

gcc/testsuite:
        PR target/90405
        * gcc.target/arm/pr90405.c: New test.

From-SVN: r271037
2019-05-09 16:35:56 +00:00
Richard Earnshaw
4456525c4e [arm] PR target/90405 fix regression for thumb1 with -mtpcs-leaf-frame
-mtpcs-leaf-frame causes an APCS-style backtrace frame to be created
on the stack.  This should probably be deprecated, but it did reveal
an issue with the patch I committed previously to improve the code
generation when pushing high registers, in that
thumb_find_work_register had a different idea as to which registers
were available as scratch registers.

The new code actually does a better job of finding a viable work
register and doesn't rely so much on assumptions about the ABI, so it
seems better to adapt thumb_find_work_register to the new approach.
This way we can eliminate some rather crufty code.

gcc:
	PR target/90405
	* config/arm/arm.c (callee_saved_reg_p): Move before
	thumb_find_work_register.
	(thumb1_prologue_unused_call_clobbered_lo_regs): Move before
	thumb_find_work_register.  Only call df_get_live_out once.
	(thumb1_epilogue_unused_call_clobbered_lo_regs): Likewise.
	(thumb_find_work_register): Use
	thumb1_prologue_unused_call_clobbered_lo_regs instead of ad hoc
	algorithms to locate a spare call clobbered reg.

gcc/testsuite:
	PR target/90405
	* gcc.target/arm/pr90405.c: New test.

From-SVN: r271036
2019-05-09 16:00:23 +00:00
Martin Liska
fd4485aa04 Support {MIN,MAX}_EXPR in GIMPLE FE.
2019-05-09  Martin Liska  <mliska@suse.cz>

	* gimple-pretty-print.c (dump_binary_rhs): Dump MIN_EXPR
	and MAX_EXPR in GIMPLE FE format.
2019-05-09  Martin Liska  <mliska@suse.cz>

	* gimple-parser.c (c_parser_gimple_statement): Support __MIN and
	__MAX.
	(c_parser_gimple_unary_expression): Parse also binary expression
	__MIN and __MAX.
	(c_parser_gimple_parentized_binary_expression): New function.
2019-05-09  Martin Liska  <mliska@suse.cz>

	* gcc.dg/gimplefe-39.c: New test.

From-SVN: r271035
2019-05-09 13:03:45 +00:00
Martin Liska
d276406ac1 Support profile (BB counts and edge probabilities) in GIMPLE FE.
2019-05-09  Martin Liska  <mliska@suse.cz>

	* tree-cfg.c (dump_function_to_file): Dump entry BB count.
	* gimple-pretty-print.c (dump_gimple_bb_header):
	Dump BB count.
	(pp_cfg_jump): Dump edge probability.
	* profile-count.c (profile_quality_as_string): Simplify
	with a static array.
	(parse_profile_quality): New function.
	(profile_count::dump): Simplify with a static array.
	(profile_count::from_gcov_type): Add new argument.
	* profile-count.h (parse_profile_quality): Likewise.
	* predict.h (set_hot_bb_threshold): New.
	* params.def (PARAM_GIMPLE_FE_COMPUTED_HOT_BB_THRESHOLD):
	New param.
	* predict.c (get_hot_bb_threshold): Set from the new param.
	(set_hot_bb_threshold): New.
2019-05-09  Martin Liska  <mliska@suse.cz>

	* gimple-parser.c (struct gimple_parser): Add probability.
	for gimple_parser_edge.
	(gimple_parser::push_edge): Add new argument probability.
	(c_parser_gimple_parse_bb_spec): Parse also probability
	if present.
	(c_parser_parse_gimple_body): Set edge probability.
	(c_parser_gimple_compound_statement): Consume token
	before calling c_parser_gimple_goto_stmt.
	Parse BB counts.
	(c_parser_gimple_statement): Pass new argument.
	(c_parser_gimple_goto_stmt): Likewise.
	(c_parser_gimple_if_stmt): Likewise.
	(c_parser_gimple_or_rtl_pass_list): Parse hot_bb_threshold.
	* c-parser.c (c_parser_declaration_or_fndef): Pass
	hot_bb_threshold argument.
	* c-tree.h (struct c_declspecs): Add hot_bb_threshold
	field.
	(c_parser_gimple_parse_bb_spec_edge_probability): New.
2019-05-09  Martin Liska  <mliska@suse.cz>

	* gcc.dg/gimplefe-37.c: New test.
	* gcc.dg/gimplefe-33.c: Likewise.

From-SVN: r271034
2019-05-09 13:03:28 +00:00
Paolo Carlini
555dbc42b2 2019-05-09 Paolo Carlini <paolo.carlini@oracle.com>
* Fix last ChangeLog entry.

From-SVN: r271033
2019-05-09 10:26:46 +00:00
Paolo Carlini
1ccebd3f73 re PR preprocessor/90382 (ICE in linemap_macro_map_loc_to_exp_point, at libcpp/line-map.c:1061)
/cp
2019-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/90382
	Revert:
	2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
	min_location.

/testsuite
2019-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/90382
	2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/diagnostic/trailing1.C: New.

From-SVN: r271032
2019-05-09 10:18:23 +00:00
Richard Biener
362e280d10 re PR tree-optimization/90395 (ICE: verify_flow_info failed (error: BB 2 cannot throw but has an EH edge))
2019-05-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90395
	* tree-ssa-forwprop.c (pass_forwprop::execute): Do not
	rewrite vector stores that throw internally.

	* gcc.dg/torture/pr90395.c: New testcase.

From-SVN: r271031
2019-05-09 10:09:30 +00:00
Thomas Schwinge
8de916aa94 Clean up MPX-related stuff: CIF_CHKP
..., which was forgotten in recent r268844.

	gcc/
	* cif-code.def (CHKP): Remove.

From-SVN: r271029
2019-05-09 11:52:10 +02:00
Thomas Schwinge
7d48b7adad [PR89221] Continue to default to '--disable-frame-pointer' for x86 GNU systems
The recent trunk r270914 for PR89221 "--enable-frame-pointer does not work as
intended" fixed a scripting defect in the x86 '--enable-frame-pointer'
handling.

This has the side effect that, for example, for '--target=i686-gnu' this is now
enabled by default: 'USE_IX86_FRAME_POINTER=1' is added to 'tm_defines'.  Given
that it's highly unlikely that anyone would now suddenly want
'--enable-frame-pointer' as the default for any kind of GNU system, I'm
changing the default back for GNU systems, to match that of a 'target_os' of
'linux* | darwin[8912]*'.

	gcc/
	PR target/89221
	* configure.ac (--enable-frame-pointer): Disable by default for
	GNU systems.
	* configure: Regenerate.

From-SVN: r271028
2019-05-09 11:51:59 +02:00
François Dumont
b2536b7c3d stl_deque.h (operator==(const _Deque_iterator<>&, const _Deque_iterator<>&)): Make hidden friend.
2019-05-09  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_deque.h
	(operator==(const _Deque_iterator<>&, const _Deque_iterator<>&)):
	Make hidden friend.
	(operator!=(const _Deque_iterator<>&, const _Deque_iterator<>&)):
	Likewise.
	(operator<(const _Deque_iterator<>&, const _Deque_iterator<>&)):
	Likewise.
	(operator<=(const _Deque_iterator<>&, const _Deque_iterator<>&)):
	Likewise.
	(operator>(const _Deque_iterator<>&, const _Deque_iterator<>&)):
	Likewise.
	(operator>=(const _Deque_iterator<>&, const _Deque_iterator<>&)):
	Likewise.
	(_Deque_iterator<>::operator+(difference_type)): Likewise and allow NRVO
	copy elision.
	(_Deque_iterator<>::operator-(difference_type)): Likewise.

From-SVN: r271027
2019-05-09 05:28:42 +00:00
GCC Administrator
20a7c51dca Daily bump.
From-SVN: r271026
2019-05-09 00:16:28 +00:00
Alan Modra
20d70cd271 [RS6000] PR89271, gcc.target/powerpc/vsx-simode2.c
This patch makes a number of corrections to rs6000_register_move_cost,
adds a new register union class, GEN_OR_VSX_REGS, and adjusts insn
alternative costs to suit.

The patch initially just corrected register move cost when direct
moves are available, but that resulted in regressions.  Inspection of
those regressions showed ALL_REGS being used as the register allocno
class, which isn't ideal.  gcc/doc/tm.texi says: "You should define a
class for the union of two classes whenever some instruction allows
both classes".  Thus, define GEN_OR_VSX_REGS for the register
allocator.  (IRA wants to use the union of two register classes when
the costs of the classes are below memory cost, which happens more
often with the low direct move cost.)

As per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89271#c11 we ought
to be returning the minimal cost for union classes.  That can be done
by rs6000_register_move_cost testing for vsx first, where the number
of regs for a given mode might be smaller than the same mode in gprs,
and changing the LINK_OR_CTR_REGS case to exclude SPEC_OR_GEN_REGS and
NON_FLOAT_REGS.

I removed the VECTOR_MEM_VSX_P test since that leads to silly results
for scalar mode moves between altivec and float when TARGET_VSX.  eg.
rs6000_register_move_cost:, ret=2, mode=DF, from=FLOAT_REGS, to=FLOAT_REGS
rs6000_register_move_cost:, ret=16, mode=DF, from=FLOAT_REGS, to=ALTIVEC_REGS
rs6000_register_move_cost:, ret=2, mode=DF, from=FLOAT_REGS, to=VSX_REGS

The patch also fixes wrong results for moves within and between any of
the non-gpr, non-vsx special reg classes.  The comment about "moving
between two similar registers is just one instruction" is false.  We
can't move lr to ctr directly, for example.  I believe the intent of
the "reg_classes_intersect_p (to, from)" was to cover moves within
float or altivec, so I moved that test inside the code handling vsx,
and made sure the intersection wasn't anything besides vsx by masking
off everything else.  Masking isn't strictly necessary at the moment,
but would be if we create a GEN_OR_ALTIVEC_REGS class some time in the
future.

TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS is needed for rs6000 in order
to fix the 20% cactus_adm spec regression when using GEN_OR_VSX_REGS
as an allocno class.  It is similar to the aarch64 version but without
any selection by regno mode if the best class is a union class.

	PR target/89271
	* config/rs6000/rs6000.h (enum reg_class, REG_CLASS_NAMES),
	(REG_CLASS_CONTENTS): Add GEN_OR_VSX_REGS class.
	* config/rs6000/rs6000.c (rs6000_register_move_cost): Correct
	cost for general <-> vsx when direct moves are available.
	Cost union classes at minimal cost for any reg in the class.
	Correct calculation for moves between vsx, float, and altivec.
	Don't return a low cost for moves between special regs.  Don't
	use hard coded register numbers.
	(TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS): Define.
	(rs6000_ira_change_pseudo_allocno_class): New function.
	* config/rs6000/rs6000.md (movsi_internal1, mov<mode>_internal),
	(movdi_internal32, movdi_internal64): Remove '*' from vsx register
	alternatives.
	(movsi_internal1): Don't disparage vector alternatives.
	(mov<mode>_internal): Likewise, excepting alternative that
	will be split.
	* config/rs6000/vsx.md (vsx_splat_<mode>_reg): Don't disparage
	we <- b alternative.

From-SVN: r271022
2019-05-09 08:37:26 +09:30
Cherry Zhang
3407d1658f compiler: avoid copy for string([]byte) conversion used in string comparison
If a string([]byte) conversion is used immediately in a string
    comparison, we don't need to copy the backing store of the byte
    slice, as the string comparison doesn't hold any reference to
    it. Instead, just create a string header from the byte slice and
    pass it for comparison.
    
    A new type of expression, String_value_expression, is introduced,
    for constructing string headers.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/170894

	* go.dg/cmpstring.go: New test.

From-SVN: r271021
2019-05-08 23:06:52 +00:00
Ian Lance Taylor
8238b660fb libgo: add Debugging section to README
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/176001

From-SVN: r271019
2019-05-08 22:07:40 +00:00
Thomas Koenig
6328ce1f83 re PR fortran/90351 (-fc-prototypes does not dump prototypes for external procedures)
2019-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/90351
    PR fortran/90329
    * gfortran.dg/dump-parse-tree.c: Include version.h.
    (gfc_dump_external_c_prototypes): New function.
    (get_c_type_name): Select "char" as a name for a simple char.
    Adjust to handling external functions. Also handle complex.
    (write_decl): Add argument bind_c. Adjust for dumping of external
    procedures.
    (write_proc): Likewise.
    (write_interop_decl): Add bind_c argument to call of write_proc.
    * gfortran.h: Add prototype for gfc_dump_external_c_prototypes.
    * lang.opt: Add -fc-prototypes-external flag.
    * parse.c (gfc_parse_file): Move dumping of BIND(C) prototypes.
    Call gfc_dump_external_c_prototypes if option is set.
    * invoke.texi: Document -fc-prototypes-external.

From-SVN: r271018
2019-05-08 21:55:13 +00:00
Ian Lance Taylor
8ba2bda8e4 compiler: generate memmove for non-pointer slice copy
The builtin copy function is lowered to runtime functions
    slicecopy, stringslicecopy, or typedslicecopy. The first two are
    basically thin wrappers of memmove. Instead of making a runtime
    call, we can just use __builtin_memmove. This gives the compiler
    backend opportunities for further optimizations.
    
    Move the lowering of builtin copy function to flatten phase for
    the ease of rewriting.
    
    Also do this optimization for the copy part of append(s1, s2...).
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/170005

From-SVN: r271017
2019-05-08 20:08:32 +00:00
Cherry Zhang
fbe4e644c0 runtime: use builtin memmove directly
We can use the intrinsic memmove directly, without going through
    C.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/170004

	* go-gcc.cc (Gcc_backend::Gcc_backend): Define memmove builtin.

From-SVN: r271016
2019-05-08 17:40:45 +00:00
Nathan Sidwell
5345ac5a11 [C++ PATCH] Kill DECL_SAVED_FUNCTION_DATA
https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00377.html
	Kill DECL_SAVED_FUNCTION_DATA .
	* cp-tree.h (language_function): Remove x_auto_return_pattern.
	(current_function_auto_return_pattern): Delete.
	(lang_decl_fn): Replace saved_language_function with
	saved_auto_return type.
	(DECL_SAVED_FUNCTION_DATA): Delete.
	(DECL_SAVED_AUTO_RETURN_TYPE): New.
	(FNDECL_USED_AUTO): Correct documentation.
	* decl.c (duplicate_decls): Adjust AUTO return handling.
	(start_preparsed_function): Replace
	current_function_auto_return_pattern with
	DECL_SAVED_AUTO_RETURN_TYPE.  Remove DECL_SAVED_FUNCTION_DATA
	zapping.
	(finish_function): Likewise.
	(save_function_data): Delete.
	(fndecl_declared_return_type): Reimplement.
	* mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
	* method.c (make_thunk, make_alias_for): Likewise.
	* parser.c (cp_parser_jump_statement): Likewise.
	* pt.c (do_auto_deduction): Likewise.
	* typeck.c (check_return_expr): Likewise.

From-SVN: r271015
2019-05-08 17:32:30 +00:00
Ian Lance Taylor
18922fbdbf compiler: remove trailing spaces
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/175557

From-SVN: r271014
2019-05-08 17:08:18 +00:00
Jakub Jelinek
ab87ac8d53 re PR c++/59813 (tail-call elimination didn't fire for left-shift of char to cout)
PR c++/59813
	PR tree-optimization/89060
	* tree-ssa-live.h (live_vars_map): New typedef.
	(compute_live_vars, live_vars_at_stmt, destroy_live_vars): Declare.
	* tree-ssa-live.c: Include gimple-walk.h and cfganal.h.
	(struct compute_live_vars_data): New type.
	(compute_live_vars_visit, compute_live_vars_1, compute_live_vars,
	live_vars_at_stmt, destroy_live_vars): New functions.
	* tree-tailcall.c: Include tree-ssa-live.h.
	(live_vars, live_vars_vec): New global variables.
	(find_tail_calls): Perform variable life analysis before punting.
	(tree_optimize_tail_calls_1): Clean up live_vars and live_vars_vec.
	* tree-inline.h (struct copy_body_data): Add eh_landing_pad_dest
	member.
	* tree-inline.c (add_clobbers_to_eh_landing_pad): Remove BB argument.
	Perform variable life analysis to select variables that really need
	clobbers added.
	(copy_edges_for_bb): Don't call add_clobbers_to_eh_landing_pad here,
	instead set id->eh_landing_pad_dest and assert it is the same.
	(copy_cfg_body): Call it here if id->eh_landing_pad_dest is non-NULL.

	* gcc.dg/tree-ssa/pr89060.c: New test.

From-SVN: r271013
2019-05-08 19:06:46 +02:00
Mihail Ionescu
69708e0afb [arm][PR88167] Fix __builtin_return_address returns invalid address
This patch fixes a problem with the thumb1 prologue code where the link
register could be unconditionally used as a scratch register even if the
return value was still live at the end of the prologue.

Additionally, the patch improves the code generated when we are not
using many low call-saved registers to make use of any unused call
clobbered registers to help with the saving of high registers that
cannot be pushed directly (quite rare in normal code as the register
allocator correctly prefers low registers).

2019-05-08  Mihail Ionescu  <mihail.ionescu@arm.com>
	    Richard Earnshaw  <rearnsha@arm.com>

gcc:

	PR target/88167
	* config/arm/arm.c (thumb1_prologue_unused_call_clobbered_lo_regs): New
	function.
	(thumb1_epilogue_unused_call_clobbered_lo_regs): New function.
	(thumb1_compute_save_core_reg_mask): Don't force a spare work
	register if both the epilogue and prologue can use call-clobbered
	regs.
	(thumb1_unexpanded_epilogue): Use
	thumb1_epilogue_unused_call_clobbered_lo_regs.  Reverse the logic for
	picking temporaries for restoring high regs to match that of the
	prologue where possible.
	(thumb1_expand_prologue): Add any usable call-clobbered low registers to
	the list of work registers.  Detect if the return address is still live
	at the end of the prologue and avoid using it for a work register if so.
	If the return address is not live, add LR to the list of pushable regs
	after the first pass.

gcc/testsuite:

	PR target/88167
	* gcc.target/arm/pr88167-1.c: New test.
	* gcc.target/arm/pr88167-2.c: New test.


Co-Authored-By: Richard Earnshaw <rearnsha@arm.com>

From-SVN: r271012
2019-05-08 14:36:15 +00:00
François Dumont
857c72026e re PR libstdc++/90277 (Debug Mode test failures)
2019-05-08  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/90277
	* testsuite/23_containers/unordered_multiset/insert/24061-multiset.cc
	(test01): Reserve for number of insertions to avoid rehash during test.
	* testsuite/23_containers/unordered_multimap/insert/24061-multimap.cc
	(test01): Likewise.
	* testsuite/23_containers/unordered_multimap/insert/24061-multimap.cc
	(test01): Likewise.
	(test02): Likewise.
	(test03): Likewise.

From-SVN: r271011
2019-05-08 13:03:32 +00:00
Bin Cheng
8363a2f1f7 re PR tree-optimization/90078 (ICE with deep templates caused by overflow)
PR tree-optimization/90078
	* tree-ssa-loop-ivopts.c (INFTY): Increase value for infinite cost.
	(struct comp_cost): Promote type of members to int64_t.
	(infinite_cost): Don't set complexity in initialization.
	(comp_cost::operator +,-,+=,-+,/=,*=): Assert when cost computation
	overflows to infinite_cost.
	(adjust_setup_cost): Promote type of parameter and cost computation
	to int64_t.
	(struct ainc_cost_data, struct iv_ca): Promote type of member to
	int64_t.
	(get_scaled_computation_cost_at, determine_iv_cost): Promote type of
	cost computation to int64_t.
	(determine_group_iv_costs, iv_ca_dump, find_optimal_iv_set): Use
	int64_t's format specifier in dump.

	gcc/testsuite
	* g++.dg/tree-ssa/pr90078.C: New test.

From-SVN: r271008
2019-05-08 11:37:45 +00:00
Bin Cheng
98d8f14213 re PR tree-optimization/90240 (ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:6694)
PR tree-optimization/90240
	* tree-ssa-loop-ivopts.c (get_scaled_computation_cost_at): Scale cost
	with respect to scaling factor pre-computed for each basic block.
	(try_improve_iv_set): Return bool if best_cost equals to iv_ca cost.
	(find_optimal_iv_set_1): Free iv_ca set if it has infinite_cost.
	(COST_SCALING_FACTOR_BOUND, determine_scaling_factor): New.
	(tree_ssa_iv_optimize_loop): Call determine_scaling_factor.  Extend
	live range for array of loop's basic blocks.  Cleanup aux field of
	loop's basic blocks.

	gcc/testsuite
	* gfortran.dg/graphite/pr90240.f: New test.

From-SVN: r271007
2019-05-08 11:24:38 +00:00
Hongtao Liu
4f0e90fae9 Enable support for bfloat16 which will be in Future Cooper Lake.
There are 3 instructions for AVX512BF16: VCVTNE2PS2BF16, VCVTNEPS2BF16 and
DPBF16PS instructions, which are Vector Neural Network Instructions
supporting:
    
- VCVTNE2PS2BF16: Convert Two Packed Single Data to One Packed BF16 Data.
- VCVTNEPS2BF16: Convert Packed Single Data to Packed BF16 Data.
- VDPBF16PS: Dot Product of BF16 Pairs Accumulated into Packed Single Precision.

2019-05-07  Wei Xiao  <wei3.xiao@intel.com>

	* common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX512BF16_SET
	OPTION_MASK_ISA_AVX512BF16_UNSET, OPTION_MASK_ISA2_AVX512BW_UNSET): New.
	(OPTION_MASK_ISA2_AVX512F_UNSET): Add OPTION_MASK_ISA_AVX512BF16_UNSET.
	(ix86_handle_option): Handle -mavx512bf16.
	* config.gcc: Add avx512bf16vlintrin.h and avx512bf16intrin.h
	to extra_headers.
	* config/i386/avx512bf16vlintrin.h: New.
	* config/i386/avx512bf16intrin.h: New.
	* config/i386/cpuid.h (bit_AVX512BF16): New.
	* config/i386/driver-i386.c (host_detect_local_cpu): Detect BF16.
	* config/i386/i386-builtin-types.def: Add new types.
	* config/i386/i386-builtin.def: Add new builtins.
	* config/i386/i386-c.c (ix86_target_macros_internal): Define
	__AVX512BF16__.
	* config/i386/i386-option.c (ix86_target_string): Add -mavx512bf16.
	(ix86_option_override_internal): Handle BF16.
	(ix86_valid_target_attribute_inner_p): Ditto.
	* config/i386/i386-expand.c (ix86_expand_args_builtin): Ditto.
	* config/i386/i386-builtin.c (enum processor_features): Add
	F_AVX512BF16.
	(static const _isa_names_table isa_names_table): Ditto.
	* config/i386/i386.h (TARGET_AVX512BF16, TARGET_AVX512BF16_P): New.
	(PTA_AVX512BF16): Ditto.
	* config/i386/i386.opt: Add -mavx512bf16.
	* config/i386/immintrin.h: Include avx512bf16intrin.h
	and avx512bf16vlintrin.h.
	* config/i386/sse.md (avx512f_cvtne2ps2bf16_<mode><mask_name>,
	avx512f_cvtneps2bf16_<mode><mask_name>,
	avx512f_dpbf16ps_<mode><mask_half_name>): New define_insn patterns.
	* config/i386/subst.md (mask_half): Add new subst.
	* doc/invoke.texi: Document -mavx512bf16.

2019-05-07  Wei Xiao  <wei3.xiao@intel.com>

	* gcc.target/i386/avx512bf16-vcvtne2ps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16-vcvtneps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16-vdpbf16ps-1.c: New test.
	* gcc.target/i386/avx512bf16vl-vcvtne2ps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16vl-vdpbf16ps-1.c: New test.
	* gcc.target/i386/builtin_target.c: Handle avx512bf16.
	* gcc.target/i386/sse-12.c: Add -mavx512bf16.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-14.c: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* g++.dg/other/i386-2.C: Ditto.
	* g++.dg/other/i386-3.C: Ditto.

2019-05-07  Hongtao Liu  <hongtao.liu@intel.com>

	* config/i386/cpuinfo.c (get_available_features): Detect BF16.
	* config/i386/cpuinfo.h (enum processor_features): Add
	FEATURE_AVX512BF16.

From-SVN: r271006
2019-05-08 10:21:40 +00:00
Thomas Schwinge
da2d30c199 Address compiler diagnostics in libgomp.oacc-c-c++-common/pr87835.c
source-gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/pr87835.c: In function 'main':
    source-gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/pr87835.c:45: warning: ignoring #pragma loop gang [-Wunknown-pragmas]
       45 |     #pragma loop gang
          |
    source-gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/pr87835.c:19:7: warning: unused variable 'b' [-Wunused-variable]
       19 |   int b[n];
          |       ^

	libgomp/
	PR target/87835
	* testsuite/libgomp.oacc-c-c++-common/pr87835.c: Update.

From-SVN: r271004
2019-05-08 12:01:30 +02:00
Arnaud Charlet
1927f64070 * standard.ads.h: New file.
From-SVN: r271003
2019-05-08 11:57:15 +02:00
Li Jia He
d486dbfbb3 re PR other/90381 (New test case gcc.dg/tree-ssa/pr88676-2.c fails with its introduction in r270934)
PR other/90381
	* gcc.dg/tree-ssa/pr88676-2.c: Add 'target le' option to limit the
	test case to run on the little endian machine.

From-SVN: r271002
2019-05-08 07:52:26 +00:00
Jakub Jelinek
f7b7e5d047 re PR tree-optimization/90356 (Missed optimization for variables initialized to 0.0)
PR tree-optimization/90356
	* match.pd ((X +/- 0.0) +/- 0.0): Optimize into X +/- 0.0 if possible.

	* gcc.dg/tree-ssa/pr90356-1.c: New test.
	* gcc.dg/tree-ssa/pr90356-2.c: New test.
	* gcc.dg/tree-ssa/pr90356-3.c: New test.
	* gcc.dg/tree-ssa/pr90356-4.c: New test.

From-SVN: r271001
2019-05-08 09:21:48 +02:00
Ian Lance Taylor
b65b77cc80 reflect: correctly handle direct interface typed receiver in Value.call
A direct interface type's value method takes value receiver now.
    Don't pass pointer to the method function.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/175798

From-SVN: r271000
2019-05-08 04:39:19 +00:00
Ian Lance Taylor
d9b120ce89 compiler: don't add pointer twice to value method of direct interface type
For a direct interface type T with a value method M, its pointer
    type (*T)'s method table includes a stub method of M which takes
    a (*T) as the receiver instead of a T. However, for the "typ"
    field of the method table entry, we added another layer of
    indirection, which makes it appear to take a **T, which is wrong.
    This causes problems when using reflect.Type.Method to get the
    method. This CL fixes the second, incorrect, indirection.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/175837

From-SVN: r270999
2019-05-08 04:29:46 +00:00
GCC Administrator
8c4a409974 Daily bump.
From-SVN: r270997
2019-05-08 00:16:19 +00:00
Cherry Zhang
f837b9c41a compiler: add an option to emit optimization diagnostics
Add a -fgo-debug-optimization option to emit optimization
    diagnostics. This can be used for testing optimizations. Apply
    this to the range clear optimizations of maps and arrays.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/170002

gcc/go:

	* lang.opt (-fgo-debug-optimization): New option.
	* go-c.h (struct go_create_gogo_args): Add debug_optimization
	field.
	* go-lang.c (go_langhook_init): Set debug_optimization field.
	* gccgo.texi (Invoking gccgo): Document -fgo-debug-optimization.

gcc/testsuite:

	* go.dg/arrayclear.go: New test.
	* go.dg/mapclear.go: New test.

From-SVN: r270993
2019-05-08 00:14:17 +00:00
Joseph Myers
a88158bc4d Update .po files.
* be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, hr.po, id.po,
	ja.po, nl.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po,
	zh_TW.po: Update.

From-SVN: r270991
2019-05-08 01:05:06 +01:00
Jonathan Wakely
041aa6abe4 Improve API docs for Filesystem TS and Networking TS
* include/experimental/bits/fs_path.h: Improve docs.
	* include/experimental/bits/net.h: Fix wrong header name in comment.
	Do not document implementation details.
	* include/experimental/netfwd: Fix doxygen grouping.

From-SVN: r270990
2019-05-08 00:22:01 +01:00