Commit Graph

170375 Commits

Author SHA1 Message Date
Martin Sebor
b631bdb3c1 PR tree-optimization/91183 - strlen of a strcpy result with a conditional source not folded
PR tree-optimization/91183 - strlen of a strcpy result with a conditional source not folded
PR tree-optimization/86688 - missing -Wstringop-overflow using a non-string local array in strnlen with excessive bound

gcc/ChangeLog:

	PR tree-optimization/91183
	PR tree-optimization/86688
	* builtins.c (compute_objsize): Handle MEM_REF.
	* tree-ssa-strlen.c (class ssa_name_limit_t): New.
	(get_min_string_length): Remove.
	(count_nonzero_bytes): New function.
	(handle_char_store): Rename...
	(handle_store): to this.  Handle multibyte stores via integer types.
	(strlen_check_and_optimize_stmt): Adjust conditional and the called
	function name.

gcc/testsuite/ChangeLog:

	PR tree-optimization/91183
	PR tree-optimization/86688
	* gcc.dg/Wstringop-overflow-14.c: New test.
	* gcc.dg/attr-nonstring-2.c: Remove xfails.
	* gcc.dg/strlenopt-70.c: New test.
	* gcc.dg/strlenopt-71.c: New test.
	* gcc.dg/strlenopt-72.c: New test.
	* gcc.dg/strlenopt-8.c: Remove xfails.

From-SVN: r273783
2019-07-24 18:29:17 -06:00
GCC Administrator
7214f11d47 Daily bump.
From-SVN: r273782
2019-07-25 00:16:24 +00:00
Jozef Lawrynowicz
378a578aff Fix non-GNU style in previous commits
2019-07-24  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config.gcc (msp430*-*-*): Fix non-GNU style in r273774.
	* config/msp430/msp430.h (ENDFILE_SPEC): Fix non-GNU style in
	r273773.

From-SVN: r273775
2019-07-24 21:37:29 +00:00
Jozef Lawrynowicz
c46d171720 config.gcc (msp430*-*-*): Enable initfini_array by default unless explicitly disabled with...
2019-07-24  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config.gcc (msp430*-*-*): Enable initfini_array by default unless
	explicitly disabled with --disable-initfini-array.

From-SVN: r273774
2019-07-24 21:13:54 +00:00
Jozef Lawrynowicz
d4c972b7eb msp430.h (ENDFILE_SPEC): Wrap uses of crtn*.o in if-exists.
2019-07-24  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/msp430.h (ENDFILE_SPEC): Wrap uses of crtn*.o in
	if-exists.

From-SVN: r273773
2019-07-24 21:08:34 +00:00
Martin Sebor
fa5baeedd4 PR driver/80545 - option -Wstringop-overflow not recognized by Fortran
gcc/cp/ChangeLog:

	PR driver/80545
	* decl.c (finish_function): Use lang_mask.

gcc/testsuite/ChangeLog:

	PR driver/80545
	* gcc.misc-tests/help.exp: Add tests.
	* lib/options.exp: Handle C++.

gcc/ChangeLog:

	PR driver/80545
	* diagnostic.c (diagnostic_classify_diagnostic): Use lang_mask.
	(diagnostic_report_diagnostic): Same.
	* diagnostic.h (diagnostic_context::option_enabled): Add an argument.
	(diagnostic_context::lang_mask): New data member.
	* ipa-pure-const.c (suggest_attribute): Use
	lang_hooks.option_lang_mask ().
	* opts-common.c (option_enabled): Handle new argument.
	(get_option_state): Pass an additional argument.
	* opts.c (print_filtered_help): Print supported languages for
	unsupported options.  Adjust printing of current state.
	* opts.h (option_enabled): Add argument.
	* toplev.c (print_switch_values): Use lang_mask.
	(general_init): Set global_dc->lang_mask.

From-SVN: r273771
2019-07-24 14:34:03 -06:00
Iain Sandoe
e346167470 [Darwin] Partial reversion of 273749.
We still need to cater for pr80556, for the single-arch case.

2019-07-24  Iain Sandoe  <iain@sandoe.co.uk>

gcc/

	PR bootstrap/87030
	* config/i386/darwin.h (REAL_LIBGCC_SPEC): Revert r273749.

From-SVN: r273768
2019-07-24 19:59:22 +00:00
Giuliano Belinassi
856bb3ef93 cgraphunit.c (symbol_table::compile): Start and stop TV_CGRAPH_IPA_PASSES and TV_CGRAPH_FUNC_EXPANSION timers.
* cgraphunit.c (symbol_table::compile): Start and stop
	TV_CGRAPH_IPA_PASSES and TV_CGRAPH_FUNC_EXPANSION timers.
	* timevar.def (TV_CGRAPH_IPA_PASSES, TV_CGRAPH_FUNC_EXPANSION): New.

From-SVN: r273767
2019-07-24 13:10:36 -06:00
Oliver Browne
efab3e3a73 gimplify.c (flag_instrument_functions_exclude_p): Include namespace/class information in the printable name.
* gimplify.c (flag_instrument_functions_exclude_p): Include
	namespace/class information in the printable name.
	* opts.c (add_comma_separated_to_vector): Add NUL terminator
	to tokens entered into the vector.

From-SVN: r273766
2019-07-24 12:08:51 -06:00
Eric Botcazou
58f3f2c397 tree-nested.c (build_simple_mem_ref_notrap): New function.
* tree-nested.c (build_simple_mem_ref_notrap): New function.
	(get_static_chain): Call it instead of build_simple_mem_ref.
	(get_frame_field): Likewise.
	(get_nonlocal_debug_decl): Likewise.
	(convert_nonlocal_reference_op): Likewise.

From-SVN: r273763
2019-07-24 15:29:34 +00:00
Claudiu Zissulescu
ce9dbf20f4 [ARC] Fix and refurbish the interrupts.
When entering an interrupt, not only the call save registers needs to
be place on stack but also the call clobbers one. More over, the
ARC700 return from interrupt instruction needs to be rtie, the same
like ARCv2 CPUs. While the ARC6xx family uses j.f [ilinkX]
instruction. Additionally, we need to save the state of the ZOL
machinery, namely the lp_count, lp_end and lp_start registers. For
architectures which are using extension registers (i.e., HS48) we need
to save/restore them as well.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc-protos.h (arc_output_function_epilogue): Delete
	declaration.
	(arc_compute_frame_size): Millicode is disabled when compiling
	ISR.
	(arc_return_address_register): Likewise.
	(arc_compute_function_type): Likewise.
	(arc_compute_frame_size): Likewise.
	(secondary_reload_info): Likewise.
	(arc_get_unalign): Likewise.
	(arc_can_use_return_insn): Declare.
	* config/arc/arc.c (AUX_LP_START): Define
	(AUX_LP_END): Likewise.
	(arc_frame_info): Update gmask member to 64-bit datum.
	(GMASK_LEN): Update.
	(arc_compute_function_type): Make it static, move it forward.
	(arc_must_save_register): Update, consider the extra regs.
	(arc_compute_millicode_save_restore_regs): Update to use the 64
	bit gmask.
	(arc_compute_frame_size): Likewise.
	(arc_enter_leave_p): Likewise.
	(arc_save_callee_saves): Likewise.
	(arc_restore_callee_saves): Likewise.
	(arc_save_callee_enter): Likewise.
	(arc_restore_callee_leave): Likewise.
	(arc_save_callee_milli): Likewise.
	(arc_restore_callee_milli): Likewise.
	(arc_expand_prologue): Add new interrupt handling.
	(arc_return_address_register): Make it static, move it forward.
	(arc_expand_epilogue): Add new interrupt handling.
	(arc_get_unalign): Delete.
	(arc_epilogue_uses): Make sure we do not remove the extra
	saved/restored registers when interrupt.
	(arc_can_use_return_insn): New function.
	(push_reg): Likewise.
	(pop_reg): Likewise.
	(arc_save_callee_saves): Add ZOL and FPX aux registers saving
	procedures.
	(arc_restore_callee_saves): Likewise, but restoring.
	* config/arc/arc.md (VUNSPEC_ARC_ARC600_RTIE): Define.
	(R33_REG): Likewise.
	(R34_REG): Likewise.
	(R35_REG): Likewise.
	(R36_REG): Likewise.
	(R37_REG): Likewise.
	(R38_REG): Likewise.
	(R39_REG): Likewise.
	(R45_REG): Likewise.
	(R46_REG): Likewise.
	(R47_REG): Likewise.
	(R48_REG): Likewise.
	(R49_REG): Likewise.
	(R50_REG): Likewise.
	(R51_REG): Likewise.
	(R52_REG): Likewise.
	(R53_REG): Likewise.
	(R54_REG): Likewise.
	(R55_REG): Likewise.
	(R56_REG): Likewise.
	(R58_REG): Likewise.
	(type): Add rtie attribute.
	(in_call_delay_slot): Use RETURN_ADDR_REGNUM.
	(movsi_insn): Accept moves to lp_count.
	(rtie): Update pattern.
	(simple_return): Simplify it, don't use this pattern as a return
	from an interrupt.
	(arc600_rtie): New pattern.
	(p_return_i): Clean up.
	(return): Likewise.
	* config/arc/builtins.def (rtie): Only available for non ARC6xx
	family CPUs.
	* config/arc/predicates.md (move_src_operand): Consider lp_count
	as a register.

gcc/testsuite
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* gcc.target/arc/arc.exp (check_effective_target_accregs): New
	predicate.
	* gcc.target/arc/builtin_special.c: Update test/
	* gcc.target/arc/interrupt-1.c: Likewise.
	* gcc.target/arc/interrupt-10.c: New test.
	* gcc.target/arc/interrupt-11.c: Likewise.
	* gcc.target/arc/interrupt-12.c: Likewise.

update

From-SVN: r273761
2019-07-24 14:21:38 +02:00
Andreas Krebbel
4caa6bab76 S/390: Add add/sub/mul overflow check patterns
This patch implements the addv, subv, and mulv patterns for signed
integers.

gcc/ChangeLog:

2019-07-24  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/predicates.md (addv_const_operand): New predicate.
	* config/s390/s390-modes.def (CCO): New condition code mode.
	* config/s390/s390.c (s390_match_ccmode_set): Handle E_CCOmode.
	(s390_branch_condition_mask): Likewise.
	* config/s390/s390.md ("addv<mode>4", "subv<mode>4")
	("mulv<mode>4"): New expanders.
	("*addv<mode>3_ccoverflow", "*addv<mode>3_ccoverflow_const")
	("*subv<mode>3_ccoverflow", "*mulv<mode>3_ccoverflow"): New
	pattern definitions.

gcc/testsuite/ChangeLog:

2019-07-24  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/addsub-signed-overflow-1.c: New test.
	* gcc.target/s390/addsub-signed-overflow-2.c: New test.
	* gcc.target/s390/mul-signed-overflow-1.c: New test.
	* gcc.target/s390/mul-signed-overflow-2.c: New test.

From-SVN: r273759
2019-07-24 11:27:56 +00:00
Prathamesh Kulkarni
21caa1a264 re PR middle-end/91166 ([SVE] Unfolded ZIPs of constants)
2019-07-24  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	PR middle-end/91166
	* match.pd (vec_perm_expr(v, v, mask) -> v): New pattern.
	(define_predicates): Add entry for uniform_vector_p.
	(vec_same_elem_p): New match pattern.

testsuite/
	* gcc.target/aarch64/sve/pr91166.c: New test.

From-SVN: r273758
2019-07-24 07:20:24 +00:00
Martin Liska
7012184434 Fix off-by-one in simple-object-elf.c (PR lto/91228).
2019-07-24  Martin Liska  <mliska@suse.cz>

	PR lto/91228
	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
	Find first '\0' starting from gnu_lto + 1.

From-SVN: r273757
2019-07-24 07:00:48 +00:00
Bin Cheng
fe1a06fc57 Fixup ChangeLog entry for revision 273570.
From-SVN: r273756
2019-07-24 01:40:59 +00:00
GCC Administrator
55ac9c5ce5 Daily bump.
From-SVN: r273753
2019-07-24 00:16:23 +00:00
Iain Sandoe
c2ff710457 [Darwin] Fix PR87030 add missed commit hunks.
Messed up the commit, and missed changes to gcc/config.gcc and to the comments
in some of the headers.

2019-07-24  Iain Sandoe  <iain@sandoe.co.uk>

gcc/

	PR bootstrap/87030
	* config/i386/darwin.h (REAL_LIBGCC_SPEC): Move from here...
	* config/i386/darwin32-biarch.h .. to here.
	* config/i386/darwin64-biarch.h: Adjust comments.
	* config/rs6000/darwin32-biarch.h: Likewise.
	* config/rs6000/darwin64-biarch.h: Likewise.
	* config.gcc: Missed commit from r273746
	(*-*-darwin*): Don't include CPU t-darwin here.
	(i[34567]86-*-darwin*): Adjust to use biarch files. Produce
	an error message if i686-darwin configuration is attempted for
	Darwin >= 18.

From-SVN: r273749
2019-07-23 23:20:31 +00:00
Steven G. Kargl
c078c9f447 re PR fortran/54072 (BOZ with -std=f2008: wrongly accepted to TRANSFER/ABS/...; two BOZ not rejected for IOR/IEOR/IAND)
2019-07-23  Steven G. Kargl  <kargl@gcc.gnu.org>

 PR fortran/54072
 * check.c (gfc_invalid_boz): Fix comment.
 (illegal_boz_arg): New function.
 (gfc_check_transfer): Use to arguments.
 (gfc_check_storage_size): Ditto.
 (gfc_check_complex): Remove leftover comment from BOZ patch.
 * primary.c (match_boz_constant): Remove leftover comment. 

2019-07-23  Steven G. Kargl  <kargl@gcc.gnu.org>

 PR fortran/54072
 * gfortran.dg/illegal_boz_arg_1.f90: New tests.

From-SVN: r273748
2019-07-23 23:02:07 +00:00
Steven G. Kargl
8dc63166e0 arith.c (gfc_convert_integer, [...]): Move to ...
2019-07-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	* arith.c (gfc_convert_integer, gfc_convert_real, gfc_convert_complex):
	Move to ...
	* primary.c (convert_integer, convert_real, convert_complex): ... here.
	Rename and make static functions.
	(match_integer_constant): Use convert_integer
	(match_real_constant): Use convert_real.
	(match_complex_constant: Use convert_complex.
	* arith.h (gfc_convert_integer, gfc_convert_real, gfc_convert_complex):
	Remove prototypes.
	* array.c (match_array_cons_element): A BOZ cannot be a data 
	statement value.  Jump to a common exit point.
	* check.c (gfc_invalid_boz): New function.  Emit error or warning
	for a BOZ in an invalid context.
	(boz_args_check): Move to top of file to prevent need of forward
	declaration.
	(is_boz_constant): New function.  Check that BOZ expr is constant.
	(gfc_b	z2real): New function. In-place conversion of BOZ literal
	constant to REAL in accordance to F2018.
	(gfc_boz2int): New function. In-place conversion of BOZ literal
 	onstant to INTEGER in accordance to F2018.
	(gfc_check_achar, gfc_check_char, gfc_check_float): Use gfc_invalid_boz.
	Convert BOZ as needed.
	(gfc_check_bge_bgt_ble_blt): Enforce F2018 requirements on BGE, 
	BGT, BLE, and BLT intrinsic functions.
	(gfc_check_cmplx): Re-organize to check kind, if present, first.
	Convert BOZ real and/or imaginary parts as needed in accordance to
	F2018.
	(gfc_check_complex):  Use gfc_invalid_boz.  Convert BOZ as needed.
	(gfc_check_dcmplx, gfc_check_dble ): Convert BOZ as needed.
	(gfc_check_dshift):  Make dshift[lr] conform to F2018 standard.
	 gfc_check_float (gfc_expr *a)
	(gfc_check_iand_ieor_ior):  Make IAND, IEOR, and IOR conform to 
	F2018 standard.
	(gfc_check_int): Conform to F2018 standard.
	(gfc_check_intconv): Deprecate SHORT and LONG aliases for INT2 and
	INT.  Simply return for a BOZ argument. See gfc_simplify_intconv.
	(gfc_check_merge_bits): Make MERGE_BITS conform to Fortran 2018
	standard.
	(gfc_check_real): Remove incorrect comment. Check kind, if present,
	first.  Simply return for a BOZ argument. See gfc_simplify_real.
	(gfc_check_and): Re-do error handling for BOZ arguments.  Remove
	special casing ts.type != BT_INTEGER or BT_LOGICAL.
	* decl.c (match_old_style_init): Check for BOZ in old-style
	initialization.  Issue error or warning depending on
	-fallow-invalid-boz option.  Issue error if variable is not an
	INTEGER or REAL and the value is BOZ.
	* expr.c (gfc_copy_expr): Copy a BT_BOZ gfc_expr.
	(gfc_check_assign): Re-do error handling for a BOZ in an assignment
	statement.  Do in-place conversion of RHS based on LHS type of
	INTEGER or REAL.
	* gfortran.h (gfc_expr): Add a boz component.  Remove is_boz component.
	(gfc_boz2int, gfc_boz2real, gfc_invalid_boz): New prototypes.
	* interface.c (gfc_extend_assign): Guard against replacing an 
	intrinsic involving a BOZ literal constant on RHS.
	* invoke.texi: Doument -fallow-invalid-boz.
	* lang.opt: New option. -fallow-invalid-boz.
	* libgfortran.h (bt): Elevate BOZ to a basic type.
	* misc.c (gfc_basic_typename, gfc_typename): Translate BT_BOZ to BOZ.
	* primary.c (convert_integer, convert_real, convert_complex): to here.
	Rename and make static functions.
	* primary.c(match_boz_constant): Rewrite parsing of a BOZ. Re-do
	error handling.  Deprecate 'X' for hexidecimal and postfix notation.
	Use -fallow-invalid-boz and gfc_invalid_boz to accept deprecated code.
	* resolve.c (resolve_ordinary_assign): Rework a RHS that is a
	BOZ literal constant.  Use gfc_invalid_boz to allow previous
	nonstandard behavior.  Remove range checking of BOZ conversion.
	* simplify.c (convert_boz): Remove function.
	(simplify_cmplx): Remove conversion of BOZ constants, because
	conversion is done in gfc_check_cmplx.
	(gfc_simplify_float): Remove conversion of BOZ constant, because
	conversion is done in gfc_check_float.
	(simplify_intconv): Use gfc_boz2int to convert BOZ to INTEGER.
	Remove range checking for BOZ conversion.
	(gfc_simplify_real): Use k, if present, to determine kind.  Convert
	BOZ to REAL.  Remove range checking for BOZ conversion.
	target-memory.c (gfc_convert_boz): Rewrite to deal with convert of
	a BOZ to a REAL value.

2019-07-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	* gfortran.dg/achar_5.f90: Fix for new BOZ handling.
	* arithmetic_overflow_1.f90: Ditto.
	* gfortran.dg/boz_11.f90: Ditto.
	* gfortran.dg/boz_12.f90: Ditto.
	* gfortran.dg/boz_4.f90: Ditto.
	* gfortran.dg/boz_5.f90: Ditto.
	* gfortran.dg/boz_6.f90: Ditto.
	* gfortran.dg/boz_7.f90: Ditto.
	* gfortran.dg/boz_8.f90: Ditto.
	* gfortran.dg/dec_structure_6.f90: Ditto.
	* gfortran.dg/dec_union_1.f90: Ditto.
	* gfortran.dg/dec_union_2.f90: Ditto.
	* gfortran.dg/dec_union_5.f90: Ditto.
	* gfortran.dg/dshift_3.f90: Ditto.
	* gfortran.dg/gnu_logical_2.f90: Ditto.
	* gfortran.dg/int_conv_1.f90: Ditto.
	* gfortran.dg/ishft_1.f90: Ditto.
	* gfortran.dg/nan_4.f90: Ditto.
	* gfortran.dg/no_range_check_3.f90: Ditto.
	* gfortran.dg/pr16433.f: Ditto.
	* gfortran.dg/pr44491.f90: Ditto.
	* gfortran.dg/pr58027.f90: Ditto.
	* gfortran.dg/pr81509_2.f90: Ditto.
	* gfortran.dg/unf_io_convert_1.f90: Ditto.
	* gfortran.dg/unf_io_convert_2.f90: Ditto.
	* gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90:
	Ditto.
	* gfortran.fortran-torture/execute/intrinsic_mvbits.f90: Ditto.
	* gfortran.fortran-torture/execute/intrinsic_nearest.f90: Ditto.
	* gfortran.fortran-torture/execute/seq_io.f90: Ditto.
	* gfortran.dg/gnu_logical_1.F: Delete test.
	* gfortran.dg/merge_bits_3.f90: New test.
	* gfortran.dg/merge_bits_3.f90: Ditto.
	* gfortran.dg/boz_int.f90: Ditto.
	* gfortran.dg/boz_bge.f90: Ditto.
	* gfortran.dg/boz_complex_1.f90: Ditto.
	* gfortran.dg/boz_complex_2.f90: Ditto.
	* gfortran.dg/boz_complex_3.f90: Ditto.
	* gfortran.dg/boz_dble.f90: Ditto.
	* gfortran.dg/boz_dshift_1.f90: Ditto.
	* gfortran.dg/boz_dshift_2.f90: Ditto.
	* gfortran.dg/boz_float_1.f90: Ditto.
	* gfortran.dg/boz_float_2.f90: Ditto.
	* gfortran.dg/boz_float_3.f90: Ditto.
	* gfortran.dg/boz_iand_1.f90: Ditto.
	* gfortran.dg/boz_iand_2.f90: Ditto.

2019-07-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	* testsuite/libgomp.fortran/reduction4.f90: Update BOZ usage
	* testsuite/libgomp.fortran/reduction5.f90: Ditto.

From-SVN: r273747
2019-07-23 21:43:21 +00:00
Iain Sandoe
000a002072 [Darwin] Fix PR87030 and tidy config fragments.
This is about 32/64b host and multilib support across the range of Darwin
systems.

Prior to Darwin8 (OS X 10.4), the toolchains support only PowerPC and only 32b.

On Darwin8 it is possible to target a 64b multilib, but with support limited
to a few of the main libraries on the system (not a recommended configuration).

From Darwin9 to Darwin17 (OSX 10.5 to 10.13) it is possible to have either
32 or 64b hosted toolchains, with support for a 64 or 32b multilib respectively.

On Darwin9 the kernel is 32b, but with support for 64b executables, so it's
conventional to build a 32b host toolchain supporting a 64b multilib.  However
this is not enforced (merely a convention).

There is also some platform hardware supporting Darwin10/11 which is only 32b
and for which the same situation applies.  However, from Darwin10 to Darwin17,
the majority of platform hardware supports a 64b kernel and it's conventional
to build a 64b host toolchain with support for a 32b multilib.

On/from Darwin18 (OS X 10.14), the development headers (in the SDK) no longer
expose the interfaces for the 32b multilib support (although sufficient runtime
support remains installed that the testsuite can be run for a 32b multilib).

The PR is raised against this latter situation since the absence of exposed
interfaces causes a 'default' bootstrap fail regardless of the availability of
the runtimes.  Given the number of permutations, I felt it warranted a general
solution, especially since the current scheme of target headers and t-make
fragments has become somewhat messy.

The changes here enforce the single 32b PowerPC multilib for Darwin < 8 and the
single X86 64b multilib for Darwin >= 18.  This means that there is no longer
any need to configure Darwin18+ '--disable-multilib', but also that if you want
to use the ability to continue to test the compiler's 32b multilib there, you
need to make a configuration targeting an earlier OS version (and using the
SDK from that).

gcc/

	PR bootstrap/87030
	* config.gcc (*-*-darwin*): Don't include CPU t-darwin here.
	(i[34567]86-*-darwin*): Adjust to use biarch files. Produce
	an error message if i686-darwin configuration is attempted for
	Darwin >= 18.
	(x86_64-*-darwin*): Switch to single multilib for Darwin >= 18.
	(powerpc-*-darwin*): Use biarch files where needed.
	(powerpc64-*-darwin*): Likewise.
	* config/i386/darwin.h (REAL_LIBGCC_SPEC): Move to new biarch file.
	(DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single
	arch case.
	* config/i386/darwin32-biarch.h: New.
	* config/i386/darwin64.h: Rename.
	* gcc/config/i386/darwin64-biarch.h: To this.
	* config/i386/t-darwin: Rename.
	* gcc/config/i386/t-darwin32-biarch: To this.
	* config/i386/t-darwin64: Rename.
	* gcc/config/i386/t-darwin64-biarch: To this.
	* config/rs6000/darwin32-biarch.h: New.
	* config/rs6000/darwin64.h: Rename.
	* config/rs6000/darwin64-biarch.h: To this.
	(DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single
	arch case.
	* config/rs6000/t-darwin8: Rename.
	* config/rs6000/t-darwin32-biarch: To this.
	* config/rs6000/t-darwin64 Rename.
	* config/rs6000/t-darwin64-biarch: To this.

From-SVN: r273746
2019-07-23 20:31:26 +00:00
Jeff Law
d8e54c6203 Add PR markers to recent DSE changes. And...
PR tree-optimization/86061
	* gcc.dg/tree-ssa/pr86061.c: New test.

From-SVN: r273745
2019-07-23 14:05:48 -06:00
Ian Lance Taylor
40768ee0bc compiler: use correct value type in 2-case select send
In the channel-send case, the value to be sent may needs an
    (implicit) type conversion to the channel element type. This CL
    ensures that we use the correct value type for the send.
    
    Fixes golang/go#33235.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/187177

From-SVN: r273743
2019-07-23 17:20:36 +00:00
Martin Sebor
9bf4008473 configure.ac (ACX_PROG_CXX_WARNING_OPTS): Revert r273311.
gcc/ChangeLog:
	* configure.ac (ACX_PROG_CXX_WARNING_OPTS): Revert r273311.

From-SVN: r273742
2019-07-23 11:03:13 -06:00
Vladislav Ivanishin
d894bafc5b gdbinit.in: add reload-gdbhooks (rh) command
gcc/ChangeLog:

2019-07-23  Vladislav Ivanishin <vlad@ispras.ru>

	* gdbinit.in (reload-gdbhooks): New command with an attached doc string.
	(rh): New alias for it.

From-SVN: r273738
2019-07-23 14:05:14 +00:00
Vladislav Ivanishin
e41dd06873 make gdbhooks.py idempotent with respect to reloading
gcc/ChangeLog:

2019-07-23  Vladislav Ivanishin <vlad@ispras.ru>

	* gdbhooks.py: Pass replace=True to
	gdb.printing.register_pretty_printer.

From-SVN: r273737
2019-07-23 13:57:43 +00:00
Richard Biener
0bd65f4fde re PR debug/91231 (ICE in dwarf2out_inline_entry, at dwarf2out.c:27642)
2019-07-23  Richard Biener  <rguenther@suse.de>

	PR debug/91231
	* lto-streamer-in.c (input_function): Drop inline-entry markers
	that ended up with an unknown location block.

From-SVN: r273733
2019-07-23 10:45:59 +00:00
Richard Biener
62e3e66f13 re PR tree-optimization/83518 (Missing optimization: useless instructions should be dropped)
2019-07-23  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/83518
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Handle aggregate
	init from a constant even when partial defs are already recorded.

	c/
	* gimple-parser.c (c_parser_parse_gimple_body): When we have
	a CFG also rebuild cgraph edges.

	* gcc.dg/tree-ssa/ssa-fre-79.c: New testcase.

From-SVN: r273732
2019-07-23 10:00:24 +00:00
Jan Hubicka
e1eb82f5aa i386-common.c: Use PROCESSOR_ZNVER2 scheduler for znver2.
* i386-common.c: Use PROCESSOR_ZNVER2 scheduler for znver2.
	* config/i386/znver1.md: Enable patterns for znver2 and add store
	variants which use extra AGU unit.

From-SVN: r273731
2019-07-23 09:38:49 +00:00
Jan Hubicka
105c2795b0 i386-options.c (ix86_option_override_internal): Default PARAM_AVOID_FMA_MAX_BITS to 256 for znver2.
* config/i386/i386-options.c (ix86_option_override_internal): Default
	PARAM_AVOID_FMA_MAX_BITS to 256 for znver2.

From-SVN: r273730
2019-07-23 09:35:18 +00:00
Jan Hubicka
ef893a2a76 * config/i386/x86-tune.def (X86_TUNE_AVOID_256FMA_CHAINS): Set of ZNVER2.
From-SVN: r273729
2019-07-23 09:32:44 +00:00
Jan Hubicka
187dd65de8 x86-tune-costs.h (znver2_memcpy): Update.
* config/i386/x86-tune-costs.h (znver2_memcpy): Update.
	(znver2_costs): Update 256 bit SSE costs and multiplication.

From-SVN: r273728
2019-07-23 09:27:11 +00:00
Ed Schonberg
4e2a165210 [Ada] Aspect CPU may depend on a discriminant of a task type
2019-07-23  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations,
	Freeze_Entity_Checks): Include Aspect_CPU with other aspects
	whose expresssion may depend on a discriminant, and thus require
	that components of the type be made visible.

gcc/testsuite/

	* gnat.dg/task4.adb: New testcase.

From-SVN: r273726
2019-07-23 08:13:41 +00:00
Eric Botcazou
67460d4575 [Ada] Plug small loophole in Generate_Range_Check
The Generate_Range_Check routine is responsible for generating range
checks in the scalar case.  It automatically deals with possible
overflow in the process when the source and the target base types are
different.

However there is one case where overflow is not dealt with correctly,
namely when the target base type is narrower than the source base type
and both are floating-point types. In this case, the routine will
convert the source type to the target base type without checking for
overflow. In practice this does not matter much because the conversion
would yield an infinity on overflow, which would then fail the
subsequent range check. However it's more correct to have a proper
overflow check with -gnateF than relying on the infinity.

2019-07-23  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* checks.adb (Convert_And_Check_Range): Add Suppress parameter
	and pass it in the call to Insert_Actions.  Rename local
	variable.
	(Generate_Range_Check): Minor comment fixes.  Pass Range_Check
	in the first call to Convert_And_Check_Range and All_Checks in
	the second call.
	* exp_ch4.adb (Expand_N_Type_Conversion): Reset the
	Do_Overflow_Check flag in the float-to-float case too if there
	is also a range check.

gcc/testsuite/

	* gnat.dg/range_check5.adb: New testcase.

From-SVN: r273725
2019-07-23 08:13:32 +00:00
Eric Botcazou
a7191e0118 [Ada] Eliminate redundant overflow checks for conversions from fixed-point
This eliminates redundant overflow checks that are generated for
conversions from fixed-point to integer types when range checks are also
enabled (which is the default), as the former checks are subsumed into
the latter checks.

No functional changes.

2019-07-23  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* checks.adb (Activate_Overflow_Check): Remove redundant
	argument.
	* exp_ch4.adb (Discrete_Range_Check): Reset the overflow flag.
	(Expand_N_Type_Conversion): Do not reset it here.

From-SVN: r273724
2019-07-23 08:13:26 +00:00
Eric Botcazou
f9534f4bd6 [Ada] Minor tweak to -gnatR output
This makes sure that the numbers present in the -gnatR output are
printed in decimal format in all cases, since the hexadecimal format is
not compatible with the JSON syntax.

2019-07-23  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* repinfo.adb (List_Component_Layout): Pass Decimal to UI_Write.
	(Write_Val): Likewise.

From-SVN: r273723
2019-07-23 08:13:21 +00:00
Ed Schonberg
c910db7162 [Ada] Iterators are view-specific
Operational aspects, such as Default_Iterator, are view-specific, and if
such an aspect appears on the full view of a private type, an object of
the type cannot be iterated upon if it is not in the scope of the full
view, This patch diagnoses properly an attempt to iterate over such an
object.

2019-07-23  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* aspects.ads: New table Operational_Aspect, used to distinguish
	between aspects that are view-specific, such as those related to
	iterators, and representation aspects that apply to all views of
	a type.
	* aspects.adb (Find_Aspect): If the aspect being sought is
	operational, do not ecamine the full view of a private type to
	retrieve it.
	* sem_ch5.adb (Analyze_Iterator_Specification): Improve error
	message when the intended domain of iteration does not implement
	the required iterator aspects.

gcc/testsuite/

	* gnat.dg/iter5.adb: Add an expected error.
	* gnat.dg/iter6.adb: New testcase.

From-SVN: r273722
2019-07-23 08:13:15 +00:00
Yannick Moy
15e79d66f0 [Ada] Issue error on SPARK ownership rule violation
A modified rule in SPARK RM specifies that object declarations of
anonymous access type should only occur immediately in subprogram, entry
or block. Now checked.

There is no impact on compilation.

2019-07-23  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_spark.ads (Is_Local_Context): New function.
	* sem_spark.adb (Check_Declaration): Issue errors on violations
	of SPARK RM 3.10(4)
	(Process_Path): Do not issue error on borrow/observe during
	elaboration, as these are caught by the new rule.

From-SVN: r273721
2019-07-23 08:13:09 +00:00
Yannick Moy
39c20502ef [Ada] Fix binding of ghost units with finalizer
Linking of an enabled ghost unit which requires a finalizer lead to an
error, as the name generated by the binder for calling the finalizer was
not the same as the name chosen by the compiler. Now fixed.

2019-07-23  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* exp_ch7.adb (Create_Finalizer): Force finalizer not to be
	Ghost enabled.
	* exp_dbug.adb (Get_External_Name): Explain special case of
	Ghost finalizer.

gcc/testsuite/

	* gnat.dg/ghost6.adb, gnat.dg/ghost6_pkg.ads: New testcase.

From-SVN: r273720
2019-07-23 08:13:01 +00:00
Jan Beulich
58b8c5a87b x86/AVX512: improve generated code for mask-to-vector-register conversions
Conversion of comparison results to full vectors does, when VPMOVM2* are
unavailable, not require any intermediate VMOVDQ{A,U}*: Simply use
embedded masking on VPTERNLOG* right away, which is available with
AVX512F (while VPMOVM2{D,Q} are available only with AVX512DQ).

Note that the chosen immediate is only one of many possible ones; I was
trying to make the insn here distinguishable from the pre-existing uses
of vpternlog.

gcc/
2019-07-23  Jan Beulich  <jbeulich@suse.com>

	* config/i386/sse.md (<avx512>_cvtmask2<ssemodesuffix><mode>):
	Require only AVX512F.
	(*<avx512>_cvtmask2<ssemodesuffix><mode>): Likewise.  Add
	alternative expanding to vpternlog.

From-SVN: r273719
2019-07-23 08:07:49 +00:00
Ren Kimura
b1bc0f5035 libiberty: Check zero value shstrndx in simple-object-elf.c
From-SVN: r273718
2019-07-23 07:33:32 +00:00
Martin Liska
c0cdef59af Use -flto instead of -flto=N in DWARF producer string.
2019-07-23  Martin Liska  <mliska@suse.cz>

	* dwarf2out.c (gen_producer_string): Canonize -flto=N
	to -flto in dwarf producer string.

From-SVN: r273717
2019-07-23 07:31:50 +00:00
Richard Biener
9215b32807 tree-cfg.c (label_for_bb): Remove global var.
2019-07-23  Richard Biener  <rguenther@suse.de>

	* tree-cfg.c (label_for_bb): Remove global var.
	(main_block_label): Take label_for_bb as argument.
	(cleanup_dead_labels_eh): Likewise, adjust.
	(cleanup_dead_labels): Adjust.

From-SVN: r273716
2019-07-23 06:58:39 +00:00
Paul A. Clarke
0ac608a2cb [rs6000] Add documentation for __builtin_mtfsf
2019-07-22  Paul A. Clarke  <pc@us.ibm.com>

[gcc]

	* doc/extend.texi (Basic PowerPC Built-in Functions Available on all
	Configurations): Add documentation for __builtin_mtfsf.

From-SVN: r273715
2019-07-23 02:54:28 +00:00
Ilia Diachkov
ffbb9818b0 RISC-V: Add -malign-data= option.
gcc/
	Ilia Diachkov  <ilia.diachkov@optimitech.com>
	* config/riscv/riscv-opts.h (struct riscv_align_data): New.
	* config/riscv/riscv.c (riscv_constant_alignment): Use
	riscv_align_data_type.
	* config/riscv/riscv.h (RISCV_EXPAND_ALIGNMENT): New.
	(DATA_ALIGNMENT): Use RISCV_EXPAND_ALIGNMENT.
	(LOCAL_ALIGNMENT): Use RISCV_EXPAND_ALIGNMENT.
	* config/riscv/riscv.opt (malign-data): New.
	* doc/invoke.texi (RISC-V Options): Document -malign-data=.

From-SVN: r273714
2019-07-22 18:29:34 -07:00
Ian Lance Taylor
1d46067b34 compiler: follow-on fix for finalizing imported methods
This patch is a revision to CL 185518, which added code to perform
    finalization of methods on types created by the importer and not
    directly reachable until inlining is done.
    
    The original fix invoked the finalization code at the end of
    Import::read_types(), but it turns out this doesn't handle the case
    where a type with methods is read in due to a reference from something
    later in the export data (a function or variable). The fix is to move
    the import finalization call to the end of Import::import().
    
    Testcase for this bug is in CL 187057.
    
    Fixes golang/go#33219.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/187058

From-SVN: r273713
2019-07-23 00:34:38 +00:00
GCC Administrator
22e4efa142 Daily bump.
From-SVN: r273712
2019-07-23 00:16:30 +00:00
Giuliano Belinassi
34e646226f cgraph.c (dump_graphviz): New function.
* cgraph.c (dump_graphviz): New function.
	* cgraph.h (dump_graphviz): New function.
	* symtab.c (dump_graphviz): New function.

	* lang.opt (flag_dump_callgraph): New flag.
	* lto-dump.c (dump_symtab_graphviz): New function.
	(dump_tool_help): New option.
	(lto_main): Handle graphviz dumping.

From-SVN: r273708
2019-07-22 15:41:48 -06:00
Jonathan Wakely
2ac8e32236 Rename testsuite directory to match P0553R4 stable names
* testsuite/26_numerics/bit/bitops.count/*: Rename to ...
	* testsuite/26_numerics/bit/bit.count/*: Here.

From-SVN: r273707
2019-07-22 17:57:40 +01:00
Jonathan Wakely
f35da524a2 Adjust std::rotl, std::rotr etc to match final P0553R4 proposal
This proposal has now been accepted for C++20, with a few changes. This
patch adjusts std::rotl and std::rotr to match the final specification
and declares the additions for C++2a mode even when __STRICT_ANSI__ is
defined.

	* include/std/bit (__rotl, __rotr): Change second parameter from
	unsigned int to int and handle negative values.
	(rotl, rotr): Remove check for __STRICT_ANSI__. Change second
	parameter from unsigned int to int. Add nodiscard attribute.
	* testsuite/26_numerics/bit/bitops.rot/rotl.cc: Rename to ...
	* testsuite/26_numerics/bit/bit.rotate/rotl.cc: Here. Test negative
	shifts.
	* testsuite/26_numerics/bit/bitops.rot/rotr.cc: Rename to ...
	* testsuite/26_numerics/bit/bit.rotate/rotr.cc: Here. Test negative
	shifts.

From-SVN: r273706
2019-07-22 17:53:36 +01:00
Jonathan Wakely
281ab2fbff Change std::ceil2 to be undefined if the result can't be represented
* include/std/bit (__ceil2): Make unrepresentable results undefined,
	as per P1355R2. Add debug assertion. Perform one left shift, not two,
	so that out of range values cause undefined behaviour. Ensure that
	shift will still be undefined if left operand is promoted.
	* testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Replace checks for
	unrepresentable values with checks that they are not core constant
	expressions.
	* testsuite/26_numerics/bit/bit.pow.two/ceil2_neg.cc: New test.

From-SVN: r273705
2019-07-22 17:53:27 +01:00