Commit Graph

173079 Commits

Author SHA1 Message Date
Tobias Burnus
90ca6847bb PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0
PR middle-end/92463
        * configure.ac: Use MPFR_RNDN instead of GMP's MP_RNDN.
        * configure: Regenerate

        gcc/
        PR middle-end/92463
        * builtins.c (do_mpfr_ckconv, do_mpc_ckconv, do_mpfr_remquo,
        do_mpfr_lgamma_r, do_mpc_arg2): Use MPFR_RNDx instead of GMP_RNDx,
        mpfr_rnd_t instead of mp_rnd_t.
        * fold-const-call.c (do_mpfr_ckconv, do_mpfr_arg1, do_mpfr_sincos,
        do_mpfr_arg2, do_mpfr_arg3, do_mpc_arg1, do_mpc_arg2): Likewise.
        * gimple-ssa-sprintf.c (format_floating_max, format_floating):
        Use mpfr_exp_t instead of mp_exp_t.
        * real.c (real_from_string, dconst_e_ptr, dconst_sqrt2_ptr): Use
        MPFR_RNDx instead of GMP_RNDx.
        * realmpfr.c (real_from_mpfr, mpfr_from_real): Use mpfr_rnd_t and
        mpfr_exp_t instead mp_rnd_t and mp_exp_t, respectively.
        * realmpfr.h (real_from_mpfr, mpfr_from_real): Use mpfr_rnd_t instead
        of mp_rnd_t and remove MPFR_RNDx poisoning.
        * ubsan.c (ubsan_instrument_float_cast): MPFR_RNDx instead of GMP_RNDx.

        fortran/
        PR middle-end/92463
        * arith.c (gfc_check_real_range): Replace mp_exp_t by mpfr_exp_t.

From-SVN: r278761
2019-11-27 10:16:24 +01:00
Kewen Lin
1f9fae2809 [PATCH] Fix PR91790 by considering different first_stmt_info for realign
As PR91790 exposed, when we have one slp node whose first_stmt_info_for_drptr
is different from first_stmt_info, it's possible that the first_stmt DR isn't
initialized yet before stmt SLP_TREE_SCALAR_STMTS[0] of slp node. So we
shouldn't use first_stmt_info for vect_setup_realignment, instead we can use
the one based on first_stmt_info_for_drptr DR with additional adjustment by
bumping the distance from first_stmt DR.

gcc/ChangeLog

2019-11-27  Kewen Lin  <linkw@gcc.gnu.org>

    PR tree-optimization/91790
    * gcc/tree-vect-stmts.c (vectorizable_load): Use the adjusted DR for
    vect_setup_realignment when first_stmt_info is different from
    first_stmt_info_for_drptr.

From-SVN: r278760
2019-11-27 09:08:20 +00:00
Jakub Jelinek
66143cdfd1 re PR c++/92524 (ICE in short program with constexpr and std::array)
PR c++/92524
	* tree.c (replace_placeholders_r): Don't walk constructor elts with
	RANGE_EXPR indexes.

	* g++.dg/cpp0x/pr92524.C: New test.

From-SVN: r278759
2019-11-27 10:04:40 +01:00
Richard Biener
1fa715db54 re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang)
2019-11-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92645
	* tree-ssa-forwprop.c (simplify_vector_constructor): Handle
	CTORs with just a subset of the original vectors.

	* gcc.target/i386/pr92645-2.c: New testcase.
	* gcc.target/i386/pr92645-3.c: Likewise.

From-SVN: r278758
2019-11-27 08:56:23 +00:00
Richard Biener
cd3f923b0d re PR lto/92674 (ICE in gimple_phi_arg, at gimple.h:4406 since r240291)
2019-11-27  Richard Biener  <rguenther@suse.de>

	PR middle-end/92674
	* tree-inline.c (expand_call_inline): Delay purging EH/abnormal
	edges and instead record blocks in bitmap.
	(gimple_expand_calls_inline): Adjust.
	(fold_marked_statements): Delay EH cleanup until all folding is
	done.
	(optimize_inline_calls): Do EH/abnormal cleanup for calls after
	inlining finished.

From-SVN: r278757
2019-11-27 08:52:17 +00:00
Bernd Schmidt
af2f620578 Allow autoinc in jumps, but only when using reload.
* auto-inc-dec.c (merge_in_block): Allow autoinc in jumps unless
	LRA is enabled.
	* combine.c (can_combine_p): Disallow autoinc in jumps unless LRA is
	disabled.

From-SVN: r278756
2019-11-27 03:31:24 +00:00
Jason Merrill
6821245b3f Remember the location of a variable template-id.
I noticed that tsubst of a TEMPLATE_ID_EXPR was losing the location
information from its EXPR_LOCATION.  Then I noticed that
cxx_eval_constant_expression was also throwing away location information for
variable references.

	* pt.c (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Remember the
	location of a variable template-id.
	* constexpr.c (cxx_eval_constant_expression): Get expr location
	before stripping location wrappers.
	(non_const_var_error): Take location argument.

From-SVN: r278755
2019-11-26 22:14:33 -05:00
Jakub Jelinek
88b34a4811 re PR debug/92664 (Wrong .debug_line section information when compiling stdin input with -g3)
PR debug/92664
	* dwarf2out.c (lookup_filename): Use "<stdin>" instead of "".

From-SVN: r278752
2019-11-27 01:23:39 +01:00
GCC Administrator
b592c0ea86 Daily bump.
From-SVN: r278751
2019-11-27 00:16:19 +00:00
Paolo Carlini
24243b5a8a typeck.c (cp_build_unary_op): Consistently use the accurate location in seven additional diagnostic messages.
/cp
2019-11-26  Paolo Carlini  <paolo.carlini@oracle.com>

	* typeck.c (cp_build_unary_op): Consistently use the accurate
	location in seven additional diagnostic messages.
	(cp_build_compound_expr): Use cp_expr_loc_or_input_loc in one place.

/testsuite
2019-11-26  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp1z/bool-increment1.C: Test location(s) too.
	* g++.dg/expr/bitfield3.C: Likewise.
	* g++.dg/expr/bitfield4.C: Likewise.
	* g++.dg/expr/bitfield5.C: Likewise.
	* g++.dg/expr/bitfield6.C: Likewise.
	* g++.dg/expr/bool1.C: Likewise.
	* g++.dg/expr/bool2.C: Likewise.
	* g++.dg/expr/bool3.C: Likewise.
	* g++.dg/expr/bool4.C: Likewise.
	* g++.dg/expr/lval3.C: Likewise.
	* g++.dg/other/error18.C: Likewise.
	* g++.dg/warn/Wpointer-arith-1.C: Likewise.
	* g++.old-deja/g++.bugs/900212_01.C: Likewise.
	* g++.old-deja/g++.bugs/900428_02.C: Likewise.
	* g++.old-deja/g++.jason/rfg14.C: Likewise.
	* g++.old-deja/g++.other/overload11.C: Likewise.

From-SVN: r278743
2019-11-27 00:00:35 +00:00
Martin Sebor
d86d8b35dd PR tree-optimization/92683 - strncmp incorrect result with equal substrings and non-const bound
gcc/testsuite/ChangeLog:

	PR tree-optimization/92683
	* gcc.dg/strcmpopt_8.c: New test.
	* gcc.dg/strcmpopt_9.c: New test.

gcc/ChangeLog:

	PR tree-optimization/92683
	* gimple-fold.c (gimple_fold_builtin_string_compare): Restore a test
	inadvertently removed in a previous change.  Rename local variable
	for clarity.

From-SVN: r278742
2019-11-26 16:56:22 -07:00
Joel Hutton
e4c935cb98 Update vect_char_add target selector to use its own cache
This patch updates the vect_char_add target selector to use its own
cache instead of the vect_int cache.

This was causing a situation where bb-slp-40.c would fail on sparc when
run after other tests that use the vect_int target selector, but pass
when run on its own.

2019-11-26  Joel Hutton  <Joel.Hutton@arm.com>

gcc/testsuite/
	PR testsuite/92391
	* lib/target-supports.exp (check_effective_target_vect_char_add):
	Use a separate cache entry from vect_int.

From-SVN: r278738
2019-11-26 22:11:39 +00:00
Jakub Jelinek
4e4a8c28f3 re PR c++/92648 (Handling of unknown attributes)
PR c++/92648
	* parser.c (cp_parser_std_attribute): For unknown attributes,
	skip balanced token seq instead of trying to parse
	attribute-argument-clause as expression list.  Formatting fix.

	* g++.dg/cpp0x/gen-attrs-71.C: New test.

From-SVN: r278737
2019-11-26 22:58:22 +01:00
Jakub Jelinek
05d6cb1a85 re PR c++/61414 (enum class bitfield size-checking needs a separate warning flag controlling it)
PR c++/61414
	* c-attribs.c (handle_mode_attribute): Add mode attribute to
	ENUMERAL_TYPEs.

	* class.c (enum_to_min_precision): New hash_map.
	(enum_min_precision): New function.
	(check_bitfield_decl): Use it.

	* g++.dg/cpp0x/enum23.C: Remove xfail.
	* g++.dg/cpp0x/enum28.C: New test.

From-SVN: r278736
2019-11-26 22:57:27 +01:00
Jerry DeLisle
1f7ed00ebf Insert missed log entry.
From-SVN: r278735
2019-11-26 21:29:30 +00:00
Jerry DeLisle
bfbafcb6b2 Remove entry committed to wrong log.
From-SVN: r278734
2019-11-26 21:28:14 +00:00
Tobias Burnus
9e68f1778a Unbreak objc build – with --enable-maintainer-mode
* Makefile.in (aclocal_deps): Fix path to cet.m4.

From-SVN: r278732
2019-11-26 21:16:30 +01:00
François Dumont
e32b9ce4d5 libstdc++: Use C++98 syntax to instantiate input_iterator_tag
* include/debug/helper_functions.h (__valid_range_aux): Use C++98
	std::input_iterator_tag default constructor invocation.

From-SVN: r278731
2019-11-26 19:23:11 +00:00
Richard Biener
1e89ab6ce5 re PR target/92669 (ICE in pre_and_rev_post_order_compute_fn at gcc/cfganal.c:1034 since r278666)
2019-11-26  Richard Biener  <rguenther@suse.de>

	PR middle-end/92669
	* cfganal.c (pre_and_rev_post_order_compute_fn): Deal with
	NULL pre_order.

From-SVN: r278723
2019-11-26 12:03:58 +00:00
Jakub Jelinek
4abc46b51a re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer)
PR sanitizer/92154
	* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick
	llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce.
	* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.

From-SVN: r278722
2019-11-26 10:08:31 +01:00
Robin Dapp
754f54aa01 S/390: Add undef for MUSL_DYNAMIC_LINKERxx
This fixes the s390 bootstrap by undefining existing defines before
redefining them.


gcc/ChangeLog:

2019-11-26  Robin Dapp  <rdapp@linux.ibm.com>

  * config/s390/linux.h: Add undef for MUSL_DYNAMIC_LINKERxx.

From-SVN: r278721
2019-11-26 09:00:26 +00:00
Jakub Jelinek
89789ec91d re PR tree-optimization/92644 (ICE in wide_int_to_tree_1, at tree.c:1530)
PR tree-optimization/92644
	* tree-ssa-phiopt.c (minmax_replacement): Add INTEGRAL_TYPE_P check
	next to INTEGER_CST checks.

	* g++.dg/opt/pr92644.C: New test.

From-SVN: r278720
2019-11-26 09:43:27 +01:00
Richard Biener
f4a74d2786 re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang)
2019-11-26  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92645
	* tree-vect-slp.c (vect_build_slp_tree_2): For unary ops
	do not build the operation from scalars if the operand is.

	* gcc.target/i386/pr92645.c: New testcase.

From-SVN: r278719
2019-11-26 08:32:38 +00:00
François Dumont
59d37e9709 libstdc++: Add C++20 P1032 constexpr to _GLIBCXX_DEBUG array
* include/debug/array (array<>::fill): Add C++20 constexpr.
	(array<>::swap): Likewise.

From-SVN: r278718
2019-11-26 06:12:34 +00:00
François Dumont
db58c8e919 libstdc++: Add _GLIBCXX_DEBUG safe iterator C++20 iterator concept
* include/debug/safe_iterator.h
	[__cpp_lib_concepts](_Safe_iterator<>::iterator_concept): Define for
	C++20.

From-SVN: r278717
2019-11-26 06:07:23 +00:00
GCC Administrator
616f21732e Daily bump.
From-SVN: r278716
2019-11-26 00:16:15 +00:00
Jakub Jelinek
1d04770f5b * gfortran.dg/dec-comparison.f90: Change dg-do from run to compile.
From-SVN: r278713
2019-11-26 00:24:40 +01:00
Jakub Jelinek
c2ecce6da1 Fix typo in C++2a paper number - P1920R1 -> P1902R1
From-SVN: r278707
2019-11-25 22:48:24 +01:00
Harald Anlauf
c514496674 re PR fortran/92629 (internal compiler error: in convert_mpz_to_unsigned, at fortran/simplify.c:173)
2019-11-25  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/92629
	* simplify.c (convert_mpz_to_unsigned): Skip assert for argument
	range when -fno-range-check is specified.

	PR fortran/92629
	* gfortran.dg/pr92629.f90: New testcase.

From-SVN: r278699
2019-11-25 19:50:38 +00:00
Jonathan Wakely
7def9bd7cd libstdc++: Add move_sentinel, common_iterator and counted_iterator
This implements most of the remaining C++20 additions to the <iterator>
header.

	* include/bits/iterator_concepts.h (ranges::iter_swap): Fix parameter
	types of poison pill overload. Use remove_reference_t when checking
	constraints.
	* include/bits/stl_iterator.h (move_sentinel): Define for C++20.
	(move_iterator): Adjust definitions of nested types for C++20. Add
	hidden friends for move_sentinel operations, iter_move and iter_swap.
	(common_iterator, counted_iterator): Define for C++20.
	* testsuite/24_iterators/move_iterator/cust.cc: New test.
	* testsuite/24_iterators/move_iterator/sentinel.cc: New test.
	* testsuite/24_iterators/common_iterator/1.cc: New test.
	* testsuite/24_iterators/counted_iterator/1.cc: New test.

From-SVN: r278698
2019-11-25 19:02:03 +00:00
Jonathan Wakely
d6039f5ce1 PR libstdc++/91786 fix compilation error with Clang
PR libstdc++/91786
	* include/bits/fs_path.h (filesystem_error): Move definition before
	the use in u8path.

From-SVN: r278697
2019-11-25 19:01:58 +00:00
Tobias Burnus
d222e47058 config/gcn/mkoffload.c – remove unused static vars
* config/gcn/mkoffload.c (COMMENT_PREFIX, struct id_map,
        func_ids, funcs_tail, var_ids, vars_tail) Remove unused
        definitions.

From-SVN: r278688
2019-11-25 15:25:17 +01:00
Martin Liska
7650c805d6 Update dump message in IPA ICF.
2019-11-25  Martin Liska  <mliska@suse.cz>

	* ipa-icf.c (sem_item_optimizer::dump_cong_classes): Clean
	up used dump message.

From-SVN: r278687
2019-11-25 14:02:55 +00:00
Martin Liska
dd86c8da3f Comment too strict checking assert.
2019-11-25  Martin Liska  <mliska@suse.cz>

	PR bootstrap/92653
	* ipa-fnsummary.c (ipa_fn_summary::account_size_time): Comment out
	too strict checking assert.

From-SVN: r278686
2019-11-25 13:57:00 +00:00
Paolo Carlini
3554d8ffc5 typeck.c (cp_build_indirect_ref_1): Add location_t parameter and use it in error messages.
/gcc
2019-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* typeck.c (cp_build_indirect_ref_1): Add location_t parameter
	and use it in error messages.
	(build_x_indirect_ref): Adjust call.
	(build_indirect_ref): Likewise.
	(cp_build_fold_indirect_ref): Likewise.
	(cp_build_array_ref): Likewise.
	* call.c (build_new_op_1): Likewise.
	* semantics.c (finish_omp_clauses): Likewise.
	(finish_omp_depobj): Likewise.
	* typeck2.c (build_x_arrow): Likewise.
	* cp-tree.h (cp_build_indirect_ref): Update declaration.

	* call.c (build_new_op_1): Use location argument in warning_at.

	* typeck.c (cp_build_modify_expr): Consistently use the
	location_t argument.

/libcc1
2019-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* libcp1plugin.cc (plugin_pragma_push_user_expression): Update
	cp_build_indirect_ref call.

/gcc/testsuite
2019-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/diagnostic/base-operand-non-pointer-1.C: New.
	* g++.dg/pr53055.C: Check location too.
	* g++.old-deja/g++.bugs/900213_02.C: Likewise.
	* g++.old-deja/g++.bugs/900215_02.C: Likewise.
	* g++.old-deja/g++.other/badarrow.C: Likewise.
	* g++.old-deja/g++.other/deref1.C: Likewise.

	* g++.dg/warn/Wenum-compare.C: Check location too.

	* g++.dg/cpp0x/initlist26.C: Check location too.
	* g++.dg/cpp0x/initlist28.C: Likewise.
	* g++.dg/cpp0x/initlist29.C: Likewise.
	* g++.dg/cpp0x/initlist33.C: Likewise.
	* g++.dg/expr/string-2.C: Likewise.
	* g++.dg/other/ptrmem5.C: Likewise.
	* g++.old-deja/g++.benjamin/14664-1.C: Likewise.
	* g++.old-deja/g++.benjamin/14664-2.C: Likewise.
	* g++.old-deja/g++.brendan/init12.C: Likewise.
	* g++.old-deja/g++.bugs/900324_04.C: Likewise.
	* g++.old-deja/g++.ext/array1.C: Likewise.
	* g++.old-deja/g++.jason/rfg17.C: Likewise.

From-SVN: r278685
2019-11-25 13:49:50 +00:00
Joseph Myers
5b8d936768 Prevent all uses of DFP when unsupported (PR c/91985).
Code that directly uses _Decimal* types on architectures not
supporting DFP is properly diagnosed ("error: decimal floating-point
not supported for this target"), via a call to
targetm.decimal_float_supported_p, if the _Decimal32, _Decimal64 or
_Decimal128 keywords are used to access it.  Use via mode attributes
is also diagnosed ("unable to emulate 'SD'"); so is use of the
FLOAT_CONST_DECIMAL64 pragma.  However, it is possible to access those
types via typeof applied to constants or built-in functions without
such an error.  I expect that there are ways to get an ICE from this;
certainly it uses a completely undefined ABI.

This patch arranges for the types not to exist in the compiler at all
when DFP is not supported.  As is done with unsupported _FloatN /
_FloatNx types, the global tree nodes are left as NULL_TREE, and the
built-in function machinery is made to use error_mark_node for them in
that case in builtin-types.def, so that the built-in functions are
unavailable.  Code handling constants is adjusted to give an error,
and other code that might not work with the global tree nodes being
NULL_TREE is also updated.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.  Also tested
with no regressions for cross to aarch64-linux-gnu, as a configuration
without DFP support.

	PR c/91985
gcc:
	* builtin-types.def (BT_DFLOAT32, BT_DFLOAT64, BT_DFLOAT128)
	(BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR): Define to
	error_mark_node if corresponding global tree node is NULL.
	* tree.c (build_common_tree_nodes): Do not initialize
	dfloat32_type_node, dfloat64_type_node or dfloat128_type_node if
	decimal floating-point not supported.

gcc/c:
	* c-decl.c (finish_declspecs): Use int instead of decimal
	floating-point types if decimal floating-point not supported.

gcc/c-family:
	* c-common.c (c_common_type_for_mode): Handle decimal
	floating-point types being NULL_TREE.
	* c-format.c (get_format_for_type_1): Handle specified types being
	NULL_TREE.
	* c-lex.c (interpret_float): Give an error for decimal
	floating-point constants when decimal floating-point not
	supported.

gcc/lto:
	* lto-lang.c (lto_type_for_mode): Handle decimal floating-point
	types being NULL_TREE.

gcc/testsuite:
	* gcc.dg/c2x-no-dfp-1.c, gcc.dg/gnu2x-builtins-no-dfp-1.c: New
	tests.
	* gcc.dg/fltconst-pedantic-dfp.c: Expect errors when decimal
	floating-point not supported.

From-SVN: r278684
2019-11-25 13:45:42 +00:00
Joseph Myers
1723e1bedb Properly handle C2x attributes on types.
attribs.c has code to ignore all scoped attributes appertaining to
types except when they are part of the definition of that type.

I think the premise of that code is incorrect, and its presence is a
bug; such attributes are clearly valid in both C and C++, which
explicitly specify that attributes in certain syntactic positions
appertain to a particular type, only for that use of that type and not
for other uses of the same type specifiers without that attribute
specified, and while the standard attributes in C2x aren't relevant in
such contexts, some gnu:: attributes certainly are.  Where some
attributes are invalid on some types in such contexts, that's a matter
for the individual attribute handlers to diagnose (or the front end if
the requirements on a standard attribute in the standard are more
strict than those of a handler shared with a GNU attribute).

Thus, this patch removes the bogus code to allow such attributes to be
used.  Doing so (and adding tests for attributes in such positions)
shows up that the logic in the C front end for creating the
c_declarator structures for such attributes put them in the wrong
place relative to the structures for function and array types, and the
logic for postfix attributes on a list of declaration specifiers
failed to handle some cases, so those bugs are also fixed in this
patch.

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

gcc:
	* attribs.c (decl_attributes): Do not ignore C++11 attributes on
	types.

gcc/c:
	* c-tree.h (struct c_declarator): Use a structure for id member.
	* c-decl.c (grokdeclarator): Extract attributes from cdk_id
	declarators at the start, not when handling individual declarators
	later.  Use u.id.id instead of u.id.
	(grokfield): Use u.id.id instead of u.id.
	(build_id_declarator): Set u.id.id and u.id.attrs.
	(finish_declspecs): Handle postfix attributes in case of typedef
	name or typeof used.
	* c-parser.c (c_parser_direct_declarator)
	(c_parser_direct_declarator_inner): Place declarator for
	attributes inside that for function or array, not outside.  Set
	u.id.attrs for identifiers.
	(c_parser_parameter_declaration): Use u.id.id instead of u.id.
	* gimple-parser.c (c_parser_gimple_declaration): Use u.id.id
	instead of u.id.

gcc/testsuite:
	* gcc.dg/gnu2x-attrs-1.c: Do not expect message about attributes
	appertaining to types.
	* gcc.dg/gnu2x-attrs-2.c: New test.
	* g++.dg/cpp0x/gen-attrs-1.C, g++.dg/cpp0x/gen-attrs-22.C,
	g++.dg/cpp0x/gen-attrs-4.C, g++.dg/cpp0x/lambda/lambda-attr1.C:
	Update expected diagnostics.

From-SVN: r278683
2019-11-25 13:42:49 +00:00
Bernd Schmidt
6cebc6cbbb Convert m68k to not use cc0
* config/m68k/m68k.c (output_move_himode, output_move_qimode):
	Replace code for non-CONST_INT constants with gcc_unreachable.
	* config/m68k/m68k.md (cbranchdi): Don't generate individual
	compare and test.
	(CMPMODE): New mode_iterator.
	(cbranchsi4, cbranchqi4, cbranchhi4): Replace expanders with
	cbranch<mode>4.
	(cstoresi4, cstoreqi4, cstorehi4): Replace expanders with
	cstore<mode>4.
	(cmp<mode>_68881): Remove 'F' constraint from first comparison
	operand.
	(bit test insns patterns): Use nonimmediate_operand, not
	register_operand, for source operands that allow memory in
	their constraints.
	(divmodsi4, udivmodsi4, divmodhi4 and related unnamed patterns):
	Use register_operand, not nonimmediate_operand, for the
	destinations.
	(DBCC): New mode_iterator.
	(dbcc peepholes): Use it to reduce duplication.
	(trap): Use const_true_rtx, not const1_rtx.
	* config/m68k/predicates.md (m68k_comparison_operand): Renamed
	from m68k_subword_comparison_operand and changed to handle
	SImode.

	PR target/91851
	* config/m68k/m68k-protos.h (output-dbcc_and_branch): Adjust
	declaration.
	(m68k_init_cc): New declaration.
	(m68k_output_compare_di, m68k_output_compare_si)
	(m68k_output_compare_hi, m68k_output_compare_qi)
	(m68k_output_compare_fp, m68k_output_btst, m68k_output_bftst)
	(m68k_find_flags_value, m68k_output_scc, m68k_output_scc_float)
	(m68k_output_branch_integer, m68k_output_branch_integer_rev.
	m68k_output_branch_float, m68k_output_branch_float_rev):
	Likewise.
	(valid_dbcc_comparison_p_2, flags_in_68881)
	(output_btst): Remove declaration.
	* config/m68k/m68k.c (INCLDUE_STRING): Define.
	(TARGET_ASM_FINAL_POSTSCAN_INSN): Define.
	(valid_dbcc_comparison_p_2, flags_in_68881): Delete functions.
	(flags_compare_op0, flags_compare_op1, flags_operand1,
	flags_operand2, flags_valid): New static variables.
	(m68k_find_flags_value, m68k_init_cc): New functions.
	(handle_flags_for_move, m68k_asm_final_postscan_insn,
	remember_compare_flags): New static functions.
	(output_dbcc_and_branch): New argument CODE.  Use it, and add
	PLUS and MINUS to the possible codes.  All callers changed.
	(m68k_output_btst): Renamed from output_btst.  Remove OPERANDS
	and INSN arguments, add CODE arg.  Return the comparison code
	to use.  All callers changed.  Use CODE instead of
	next_insn_tests_no_inequality, and replace cc_status management
	with changing the return code.
	(m68k_rtx_costs): Instead of testing for COMPARE, test for
	RTX_COMPARE or RTX_COMM_COMPARE.
	(output_move_simode, output_move_qimode): Call
	handle_flags_for_move.
	(notice_update_cc): Delete function.
	(m68k_output_bftst, m68k_output_compare_di, m68k_output_compare_si,
	m68k_output_compare_hi, m68k_output_compare_qi,
	m68k_output_compare_fp, m68k_output_branch_integer,
	m68k_output_branch_integer_rev, m68k_output_scc,
	m68k_output_branch_float, m68k_output_branch_float_rev,
	m68k_output_scc_float): New functions.
	(output_andsi3, output_iorsi3, output_xorsi3): Call CC_STATUS_INIT
	once at the start, and set flags_valid and flags_operand1 if the
	flags are usable.
	* config/m68k/m68k.h (CC_IN_68881, NOTICE_UPDATE_CC,
	CC_OVERFLOW_UNUSABLE, CC_NO_CARRY, OUTPUT_JUMP): Remove
	definitions.
	(CC_STATUS_INIT): Define.
	* config/m68k/m68k.md (flags_valid): New define_attr.
	(tstdi, tstsi_internal_68020_cf, tstsi_internal, tsthi_internal,
	tstqi_internal, tst<mode>_68881, tst<mode>_cf, cmpdi_internal,
	cmpdi, unnamed cmpsi/cmphi/cmpqi patterns, cmpsi_cf,
	cmp<mode>_68881, cmp<mode>_cf, unnamed btst patterns,
	tst_bftst_reg, tst_bftst_reg, unnamed scc patterns, scc,
	sls, sordered_1, sunordered_1, suneq_1, sunge_1, sungt_1,
	sunle_1, sunlt_1, sltgt_1, fsogt_1, fsoge_1, fsolt_1, fsole_1,
	bge0_di, blt0_di, beq, bne, bgt, bgtu, blt, bltu, bge, bgeu,
	ble, bleu, bordered, bunordered, buneq, bunge, bungt, bunle,
	bunlt, bltgt, beq_rev, bne_rev, bgt_rev, bgtu_rev,
	blt_rev, bltu_rev, bge_rev, bgeu_rev, ble_rev, bleu_rev,
	bordered_rev, bunordered_rev, buneq_rev, bunge_rv, bungt_rev,
	bunle_rev, bunlt_rev, bltgt_rev, ctrapdi4, ctrapsi4, ctraphi4,
	ctrapqi4, conditional_trap): Delete patterns.
	(cbranchdi4_insn): New pattern.
	(cbranchdi4): Don't generate cc0 patterns.  When testing LT or GE,
	test high part only.  When testing EQ or NE, generate beq0_di
	and bne0_di patterns directly.
	(cstoredi4): When testing LT or GE, test high part only.
	(both sets of cbranch<mode>4, cstore<mode>4): Don't generate cc0
	patterns.
	(scc0_constraints, cmp1_constraints, cmp2_constraints,
	scc0_cf_constraints, cmp1_cf_constraints, cmp2_cf_constraints,
	cmp2_cf_predicate): New define_mode_attrs.
	(cbranch<mode>4_insn, cbranch<mode>4_insn_rev,
	cbranch<mode>4_insn_cf, cbranch<mode>4_insn_cf_rev,
	cstore<mode>4_insn, cstore<mode>4_insn_cf for integer modes)
	New patterns.
	(cbranch<mode>4_insn_68881, cbranch<mode>4_insn_rev_68881):
	(cbranch<mode>4_insn_cf, cbranch<mode>4_insn_rev_cf,
	cstore<mode>4_insn_68881, cstore<mode>4_insn_cf for FP):
	New patterns.
	(cbranchsi4_btst_mem_insn, cbranchsi4_btst_reg_insn,
	cbranchsi4_btst_mem_insn_1, cbranchsi4_btst_reg_insn_1):
	Likewise.
	(BTST): New define_mode_iterator.
	(btst_predicate, btst_constraint, btst_range): New
	define_mode_attrs.
	(cbranch_bftst<mode>_insn, cstore_bftst<mode>_insn): New
	patterns.
	(movsi_m68k_movsi_m68k2, movsi_cf, unnamed movstrict patterns,
	unnamed movhi and movqi patterns, unnamed movsf, movdf and movxf
	patterns): Set attr "flags_valid".
	(truncsiqi2, trunchiqi2, truncsihi2): Remove manual CC_STATUS
	management.  Set attr "flags_valid".
	(extendsidi2, extendplussidi, unnamed float_extendsfdf pattern,
	extendsfdf2_cf, fix_truncdfsi2, fix_truncdfhi2, fix_truncdfqi2,
	addi_sexthishl32, adddi_dilshr32, adddi_dilshr32_cf,
	addi_dishl32, subdi_sexthishl32, subdi_dishl32, subdi3): Remove
	manual CC_STATUS management.
	(addsi3_internal, addhi3, addqi3, subsi3, subhi3, subqi3,
	unnamed strict_lowpart subhi and subqi patterns): Set attr
	"flags_valid".
	(unnamed strict_lowpart addhi3 and addqi3 patterns): Likewise.
	Remove code to operate on address regs and assert the case
	does not occur.
	(unnamed mulsidi patterns, divmodhi4, udivmodhi4): Remove
	manual CC_STATUS_INIT.
	(andsi3_internal, andhi3, andqi3, iorsi3_internal, iorhi3, iorqi3,
	xorsi3_internal, xorhi3, xorqi3, negsi2_internal,
	negsi2_5200, neghi2, negqi2, one_cmplsi2_internal, one_cmplhi2,
	one_cmplqi2, unnamed strict_lowpart patterns
	for andhi, andqi, iorhi, iorqi, xorhi, xorqi, neghi, negqi,
	one_cmplhi and one_cmplqi): Set attr "flags_valid".
	(iorsi_zext_ashl16, iorsi_zext): Remove manual CC_STATUS_INIT.
	(ashldi_sexthi, ashlsi_16, ashlsi_17_24): Remove manual
	CC_STATUS_INIT.
	(ashlsi3, ashlhi3, ashlqi3, ashrsi3, ashrhi3, ashrqi3, lshrsi3,
	lshrhi3, shrqi3, rotlsi3, rotlhi3, rotlhi3_lowpart, rotlqi3,
	rotlqi3_lowpart, rotrsi3, rotrhi3, rotrhi_lowpart, rotrqi3,
	unnamed strict_low_part patterns for HI and
	QI versions): Set attr "flags_valid".
	(bsetmemqi, bsetmemqi_ext, bsetdreg, bchgdreg, bclrdreg,
	bclrmemqi, extzv_8_16_reg, extzv_bfextu_mem, insv_bfchg_mem,
	insv_bfclr_mem, insv_bfset_mem, extv_bfextu_reg,
	insv_bfclr_reg, insv_bfset_reg, dbne_hi, dbne_si, dbge_hi,
	dbge_si, extendsfxf2, extenddfxf2, ): Remove manual cc_status management.
	(various unnamed peepholes): Adjust compare/branch sequences
	for new cbranch patterns.
	(dbcc peepholes): Likewise, and output the comparison here
	as well.
	* config/m68k/predicates.md (valid_dbcc_comparison_p): Delete.
	(fp_src_operand): Allow constant zero.
	(address_reg_operand): New predicate.

	* rtl.h (inequality_comparisons_p): Remove declaration.
	* recog.h (next_insn_tests_no_inequality): Likewise.
	* rtlanal.c (inequality_comparisons_p): Delete function.
	* recog.c (next_insn_tests_no_inequality): Likewise.

From-SVN: r278681
2019-11-25 12:31:16 +00:00
Tamar Christina
e9daced36d Testsuite: Enable fp-int-convert-timode-1.c unconditionally when int128 supported.
This removes the call to fesetround as FE_TONEAREST
is the default and so the guard can be removed as well.

The test will then run as long as there's int128 support.

gcc/testsuite/ChangeLog:

	* gcc.dg/torture/fp-int-convert-timode-1.c: Always run if int128.

From-SVN: r278680
2019-11-25 12:23:30 +00:00
Richard Biener
c6aef8d800 tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Add assertion.
2019-11-25  Richard Biener  <rguenther@suse.de>

	* tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Add assertion.
	(vect_detect_hybrid_slp): Swap lane and instance iteration,
	properly re-building the visited hash-map for each lane.

From-SVN: r278679
2019-11-25 11:38:37 +00:00
Tobias Burnus
6349e4f04c [amdgcn] Silence warnings + add gcc_unreachable()
* config/gcn/gcn.c (gcn_expand_scalar_to_vector_address,
        gcn_md_reorg): Remove unused variables.
        (gcn_emutls_var_init): Add missing (but unreachable) return
        to silence warning.
        (gcn_hsa_declare_function_name): Add gcc_unreachable to ensure
        target != TARGET_GCN3 or TARGET_GCN3 will fail instead of use
        an uninitialized variable.

From-SVN: r278678
2019-11-25 12:34:53 +01:00
Eric Botcazou
d587d1e4aa re PR ada/92362 (double elaboration of expression in Address aspect)
PR ada/92362
	* gcc-interface/trans.c (gnat_to_gnu) <N_Attribute_Definition_Clause>:
	Use a temporary instead of clobbering the result with a freeze node.

From-SVN: r278675
2019-11-25 10:48:55 +00:00
Mark Eggleston
32bef8ff80 DEC comparisons - allow Hollerith constants in comparisons.
The -fdec option enables the use of Hollerith comparisons in comparisons
with INTEGER, COMPLEX, REAL and CHARACTER expressions.

	Mark Eggleston  <mark.eggleston@codethink.com>
	Jim MacArthur  <jim.macarthur@codethink.co.uk>

	* gfortran.texi: Update Hollerith constants support for character types
	and use in comparisons.
	* invoke.texi: Tidy up list of options. Update description of
	-fdec-char-conversions.
	* resolve.c (is_character_based): New.
	(Convert_hollerith_to_character): New.  (convert_to_numeric): New.
	(resolve_operator): If both sides are character based and -fdec is
	enabled convert Hollerith to character. If an operand is Hollerith, the
	other is numeric and -fdec is enabled convert to numeric.
	(resolve_ordinary_assign): Add check for -fdec-char-conversions for
	assignment of character literals.

	Mark Eggleston <mark.eggleston@codethink.com>
	Jim MacArthur <jim.macarthur@codethink.co.uk>

	* gfortran.dg/dec-comparison-character_1.f90: New test.
	* gfortran.dg/dec-comparison-character_2.f90: New test.
	* gfortran.dg/dec-comparison-character_3.f90: New test.
	* gfortran.dg/dec-comparison-complex_1.f90: New test.
	* gfortran.dg/dec-comparison-complex_2.f90: New test.
	* gfortran.dg/dec-comparison-complex_3.f90: New test.
	* gfortran.dg/dec-comparison-int_1.f90: New test.
	* gfortran.dg/dec-comparison-int_2.f90: New test.
	* gfortran.dg/dec-comparison-int_3.f90: New test.
	* gfortran.dg/dec-comparison-real_1.f90: New test.
	* gfortran.dg/dec-comparison-real_2.f90: New test.
	* gfortran.dg/dec-comparison-real_3.f90: New test.
	* gfortran.dg/dec-comparison.f90: New test.


Co-Authored-By: Jim MacArthur <jim.macarthur@codethink.co.uk>

From-SVN: r278674
2019-11-25 10:36:25 +00:00
Eric Botcazou
ee499b407f re PR ada/92575 (couple of suspicious assignments in expect.c)
PR ada/92575
	* expect.c (__gnat_expect_poll [VMS, HPUX]): Fix typo.

From-SVN: r278671
2019-11-25 10:29:51 +00:00
Martin Jambor
d0b1b67aab ipa: Prevent materialization of clones with removed bodies (PR 92109)
2019-11-25  Martin Jambor  <mjambor@suse.cz>

	PR ipa/92109
	* cgraph.h (cgraph_node::remove_from_clone_tree): Declare.
	* cgraphclones.c (cgraph_node::remove_from_clone_tree): New method.
	(cgraph_materialize_clone): Move removel from clone tree to the
	the new method and use it instead.
	* ipa.c (symbol_table::remove_unreachable_nodes): When removing
	bodies of clones, also remove it from the clone tree.

From-SVN: r278670
2019-11-25 11:13:08 +01:00
Martin Jambor
ed649cda94 Make IPA-SRA follow comdat-local rules (PR 91956)
2019-11-25  Martin Jambor  <mjambor@suse.cz>

	PR ipa/91956
	* ipa-sra.c (process_isra_node_results): Put the new node to the
	same comdat group as the original node.

	testsuite/
	* g++.dg/ipa/pr91956.C: New test.

From-SVN: r278669
2019-11-25 11:09:42 +01:00
Georg-Johann Lay
5b01f1a57c Build double32 / long-double32 multilibs if needed.
gcc/
	Build double32 / long-double32 multilibs if needed.
	PR target/92055
	* config/avr/t-avr:
	(HAVE_DOUBLE_MULTILIB, HAVE_LONG_DOUBLE_MULTILIB): Remove vars.
	(HAVE_DOUBLE32, HAVE_LONG_DOUBLE32, WITH_LONG_DOUBLE)
	(HAVE_DOUBLE64, HAVE_LONG_DOUBLE64, WITH_DOUBLE): Set from
	tm_defines and pass to genmultilib.awk.
	* config/avr/genmultilib.awk: Use these variables to add double32
	and / or long-double32 multilib(s) as needed.
	* config/avr/driver-avr.c (avr_double_lib): Adjust comment.

From-SVN: r278668
2019-11-25 08:59:06 +00:00
Richard Biener
f10d2d85c9 cfgloop.h (get_loop_exit_edges): Add extra parameter denoting loop body, defaulted to NULL.
2019-11-25  Richard Biener  <rguenther@suse.de>

	* cfgloop.h (get_loop_exit_edges): Add extra parameter denoting
	loop body, defaulted to NULL.
	(single_likely_exit): Add exit vector argument
	* tree-ssa-loop-niter.h (loop_only_exit_p): Add loop body argument.
	(number_of_iterations_exit): Likewise.
	(number_of_iterations_exit_assumptions): Likewise.
	* cfgloop.c (get_loop_exit_edges): Use passed in loop body
	if not NULL.
	* cfgloopanal.c (single_likely_exit): Use passed in exit vector.
	* tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
	Compute exit vector around call to single_likely_exit.
	* tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Pass down
	loop body to loop_only_exit_p.
	* tree-ssa-loop-niter.c (loop_only_exit_p): Get loop body from
	caller.
	(number_of_iterations_exit_assumptions): Get loop body from caller
	if not NULL.
	(number_of_iterations_exit): Pass through new loop body arg.
	(infer_loop_bounds_from_undefined): Get loop body from caller.
	(estimate_numbers_of_iterations): Compute loop body once.

From-SVN: r278667
2019-11-25 07:51:38 +00:00
Richard Biener
5a34952edb cfganal.c (pre_and_rev_post_order_compute_fn): Use an auto_bb_flag instead of an sbitmap for visited handling.
2019-11-25  Richard Biener  <rguenther@suse.de>

	* cfganal.c (pre_and_rev_post_order_compute_fn): Use an
	auto_bb_flag instead of an sbitmap for visited handling.

From-SVN: r278666
2019-11-25 07:48:48 +00:00
Kewen Lin
bceb7181c8 [rs6000] Refactor FP vector comparison operators
This is a subsequent patch to refactor the existing float point
vector comparison operator supports.  The patch to fix PR92132
supplemented vector float point comparison by exposing the names
for unordered/ordered/uneq/ltgt and adding ungt/unge/unlt/unle/
ne.  As Segher pointed out, some patterns can be refactored
together.  The main link on this is:
https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00452.html

gcc/ChangeLog

2019-11-25 Kewen Lin  <linkw@gcc.gnu.org>

    * config/rs6000/vector.md (vector_fp_comparison_simple): New code iterator.
    (vector_fp_comparison_complex): Likewise.
    (vector_<code><mode> for VEC_F and vector_fp_comparison_simple): New
    define_and_split.
    (vector_<code><mode> for VEC_F and vector_fp_comparison_complex): Likewise.
    (vector_lt<mode> for VEC_F): Refactor with vector_fp_comparison_simple.
    (vector_le<mode> for VEC_F): Likewise.
    (vector_unge<mode> for VEC_F): Likewise.
    (vector_unle<mode> for VEC_F): Likewise.
    (vector_ne<mode> for VEC_F): Likewise.
    (vector_ungt<mode> for VEC_F): Likewise.
    (vector_unlt<mode> for VEC_F): Likewise.
    (vector_ltgt<mode> for VEC_F): Refactor with vector_fp_comparison_complex.
    (vector_ordered<mode> for VEC_F): Likewise.
    (vector_uneq<mode> for VEC_F): Likewise.
    (vector_unordered<mode> for VEC_F): Likewise.

From-SVN: r278665
2019-11-25 05:15:30 +00:00