gcc.git
4 years agore PR c++/92236 ([concepts] Explain non-satisfaction in static_assert)
Andrew Sutton [Wed, 27 Nov 2019 15:23:02 +0000 (15:23 +0000)]
re PR c++/92236 ([concepts] Explain non-satisfaction in static_assert)

2019-11-27  Andrew Sutton  <asutton@lock3software.com>

PR c++/92236
Defer evaluation of concept checks so that static assertions can
emit more detailed diagnostics.

gcc/cp/
* constexpr.c (cxx_eval_call_expression): Handle concept checks.
(cxx_eval_constant_expression): Diagnose misuse of function concepts
as template-id expressions. Follow the usual return path for results.
(cxx_eval_outermost_constant_expr): Avoid calling
cp_get_callee_fndecl_nofold for function concepts.
* constraint.cc (build_function_check): Fully type the concept check
so that we don't ICE in conversions.
* cp-gimplify.c (cp_genericize_r) [CALL_EXPR]: Handle concept checks.
[TEMPLATE_ID_EXPR] Likewise.
* cvt.c (convert_to_void): Always evaluate concept checks so we don't
accidentally ignore them. Substitution during satisfaction can make
a program ill-formed (example in g++.dg/cpp2a/concepts6.C).
* pt.c (tsubst_copy_and_build): [CALL_EXPR]: Don't evaluate concepts.
[TEMPLATE_ID_EXPR]: Likewise.
* semantics.c (finish_call_expr): Don't evaluate concepts.
(finish_id_expression_1): Likewise.
(finish_static_assert): Preserve the original condition so we can
diagnose concept errors when a check returns false.

gcc/testsuite/
* g++.dg/cpp2a/concepts-iconv1.C: Update diagnostics.
* g++.dg/cpp2a/concepts-requires5.C: Likewise.
* g++.dg/cpp2a/concepts6.C: New test.

From-SVN: r278775

4 years agore PR c++/92439 ([concepts] trunk crashes on constraint satisfaction failure)
Andrew Sutton [Wed, 27 Nov 2019 15:16:37 +0000 (15:16 +0000)]
re PR c++/92439 ([concepts] trunk crashes on constraint satisfaction failure)

2019-11-27  Andrew Sutton  <asutton@lock3software.com>

PR c++/92439
Improve quality of diagnostics for subexpressions that need parens.

gcc/cp/
* parser.c (cp_parser_requires_clause_opt): Add a flag to indicate
when parsing a requires-clause before lambda parameters, and...
(cp_parser_lambda_declarator_opt): ... use that here ...
(cp_parser_type_parameter): ... and here ...
(cp_parser_late_return_type_opt): ... and here ...
(cp_parser_explicit_template_declaration): ... and here.
(cp_parser_diagnose_ungrouped_constraint_plain): Adjust the message
because this can apply to subexpressions that are not immediately
after a requires-clause.
(cp_parser_diagnose_ungrouped_constraint_rich): Likewise.
(primary_constraint_error): New.
(cp_parser_constraint_requires_parens): New.
(cp_parser_unary_constraint_requires_parens): New.
(cp_parser_constraint_primary_expression): Check for unary expressions
before parsing the primary expression. Also check for binary and
postfix operators after a successful parse of the primary expression.
Force a re-parse if the result would form a lower-precedence string.
(cp_parser_constraint_logical_and_expression): Propagate lambda flag;
move checks for ill-formed constraints into the constraint primary
expression.
(cp_parser_constraint_logical_or_expression): Likewise.
(cp_parser_requires_clause_expression): Propagate lambda flag.

gcc/testsuite/
* g++.dg/cpp2a/concepts-requires20.C: New.

From-SVN: r278774

4 years agore PR c++/88395 (ICE: Segmentation fault signal terminated program cc1plus, with...
Andrew Sutton [Wed, 27 Nov 2019 15:09:22 +0000 (15:09 +0000)]
re PR c++/88395 (ICE: Segmentation fault signal terminated program cc1plus, with -std=c++2a -fconcepts)

2019-11-27  Andrew Sutton  <asutton@lock3software.com>

PR c++/88395
Prevent recursive satisfaction by adding requests to the instantiation
stack.

gcc/cp/
* constraint.cc (satisfy_declaration_constraints): Push tinst levels
around satisfaction.

gcc/testsuite/
* g++.dg/cpp2a/concepts-pr88395.C: New.
* g++.dg/cpp2a/concepts-recursive-sat1.C: New.
* g++.dg/cpp2a/concepts-recursive-sat2.C: New.
* g++.dg/cpp2a/concepts-recursive-sat3.C: New.

From-SVN: r278773

4 years agore PR rtl-optimization/90007 (ICE in extract_constrain_insn_cached, at recog.c:2223)
Vladimir Makarov [Wed, 27 Nov 2019 14:24:47 +0000 (14:24 +0000)]
re PR rtl-optimization/90007 (ICE in extract_constrain_insn_cached, at recog.c:2223)

2019-11-27  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/90007
* recog.c (constrain_operands): Permit hard registers too for
memory when LRA is used.

2019-11-27  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/90007
* gcc.target/i386/pr90007.c: New test.

From-SVN: r278770

4 years agoDiagnose certain constraint errors as hard errors, but otherwise treat them the same...
Andrew Sutton [Wed, 27 Nov 2019 14:02:49 +0000 (14:02 +0000)]
Diagnose certain constraint errors as hard errors, but otherwise treat them the same as normal SFINAE-type errors.

2019-11-27  Andrew Sutton  <asutton@lock3software.com>

Diagnose certain constraint errors as hard errors, but otherwise treat
them the same as normal SFINAE-type errors. Also, generally clean up
the satisfaction functions.

gcc/cp/
* constexpr.c (cxx_eval_constant_expression): Use
evaluate_concept_check.
* constraint.cc (normalize_concept_definition): Accept a diagnostic
flag and only cache when not diagnosing errors.
(decl_satisfied_cache): Map to trees instead of bools.
(satisfy_atom): Guarantee a location for the errors, propagate complain
flags to force_rvalue, and emit errors for non-boolean constraints.
(get_normalized_constraints_and_args): New overloads. Factored out of
satisfy_constraint_expression and satisfy_declaration_constraints.
(satisfy_constraint_expression): Propagate diagnostic info to
normalization.
(satisfy_declaration_constraints): New. Factored out of
constraints_satisfied_p.
(constraint_satisfaction_value): New. Calls
satisfy_constraint_expression or satisfy_declaration_constraints.
(constraints_satisfied_p): Call constraint_satisfaction_value.
(evaluate_concept_check): Don't take tsubst_falgs_t. Replay
satisfaction if an error is encountered.
(current_failed_constraint): Moved from pt.c.
(diagnose_constraints): Call constraint_satisfaction_value.
* cp-tree.h: Update declarations.
* pt.c (current_failed_constraint): Moved to constraint.cc.
* semantics.c (finish_id_expression_1): Remove a duplicate case.

gcc/testsuite/
* g++.dg/concepts/pr84330.C: Update diagnostics.
* g++.dg/cpp2a/concepts-requires2.C: Likewise.

From-SVN: r278768

4 years agom68k.c (m68k_output_compare_fp): Restore differences between Coldfire and regular...
Bernd Schmidt [Wed, 27 Nov 2019 13:07:44 +0000 (13:07 +0000)]
m68k.c (m68k_output_compare_fp): Restore differences between Coldfire and regular m68k.

* config/m68k/m68k.c (m68k_output_compare_fp): Restore differences
between Coldfire and regular m68k.
* config/m68k/m68k.md (cmp1_cf_constraints): Disallow constants.

From-SVN: r278767

4 years agotarget.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.
Richard Biener [Wed, 27 Nov 2019 12:22:02 +0000 (12:22 +0000)]
target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.

2019-11-27  Richard Biener  <rguenther@suse.de>

* target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.
* targhooks.c (default_builtin_vectorized_conversion): Likewise.
* targhooks.h (default_builtin_vectorized_conversion): Likewise.
* optabs-tree.c (supportable_convert_operation): Do not call
targetm.vectorize.builtin_conversion.  Remove unused decl parameter.
* optabs-tree.h (supportable_convert_operation): Adjust.
* doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.
* doc/tm.texi: Regenerate.
* tree-ssa-forwprop.c (simplify_vector_constructor): Adjust.
* tree-vect-generic.c (expand_vector_conversion): Likewise.
* tree-vect-stmts.c (vect_gen_widened_results_half): Remove
unused decl parameter and adjust.
(vect_create_vectorized_promotion_stmts): Likewise.
(vectorizable_conversion): Adjust.

From-SVN: r278765

4 years agore PR tree-optimization/92690 (vector CTOR optimization performs invalid conversion)
Richard Biener [Wed, 27 Nov 2019 12:16:54 +0000 (12:16 +0000)]
re PR tree-optimization/92690 (vector CTOR optimization performs invalid conversion)

2019-11-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92690
* tree-ssa-forwprop.c (simplify_vector_constructor): Avoid
converting elements not originally converted.

* gcc.dg/torture/pr92690.c: New testcase.
* gcc.dg/tree-ssa/forwprop-35.c: Adjust.

From-SVN: r278764

4 years agore PR fortran/91944 (ICE in gfc_conv_array_initializer, at fortran/trans-array.c...
Jakub Jelinek [Wed, 27 Nov 2019 10:00:50 +0000 (11:00 +0100)]
re PR fortran/91944 (ICE in gfc_conv_array_initializer, at fortran/trans-array.c:6156)

PR fortran/91944
* simplify.c (gfc_simplify_spread): Check gfc_init_expr_flag instead
of gfc_current_ns->sym_root->n.sym->attr.flavor == FL_PARAMETER.

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

From-SVN: r278762

4 years agoPR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0
Tobias Burnus [Wed, 27 Nov 2019 09:16:24 +0000 (10:16 +0100)]
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

4 years ago[PATCH] Fix PR91790 by considering different first_stmt_info for realign
Kewen Lin [Wed, 27 Nov 2019 09:08:20 +0000 (09:08 +0000)]
[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

4 years agore PR c++/92524 (ICE in short program with constexpr and std::array)
Jakub Jelinek [Wed, 27 Nov 2019 09:04:40 +0000 (10:04 +0100)]
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

4 years agore PR tree-optimization/92645 (Hand written vector code is 450 times slower when...
Richard Biener [Wed, 27 Nov 2019 08:56:23 +0000 (08:56 +0000)]
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

4 years agore PR lto/92674 (ICE in gimple_phi_arg, at gimple.h:4406 since r240291)
Richard Biener [Wed, 27 Nov 2019 08:52:17 +0000 (08:52 +0000)]
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

5 years agoAllow autoinc in jumps, but only when using reload.
Bernd Schmidt [Wed, 27 Nov 2019 03:31:24 +0000 (03:31 +0000)]
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

5 years agoRemember the location of a variable template-id.
Jason Merrill [Wed, 27 Nov 2019 03:14:33 +0000 (22:14 -0500)]
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

5 years agore PR debug/92664 (Wrong .debug_line section information when compiling stdin input...
Jakub Jelinek [Wed, 27 Nov 2019 00:23:39 +0000 (01:23 +0100)]
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

5 years agoDaily bump.
GCC Administrator [Wed, 27 Nov 2019 00:16:19 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r278751

5 years agotypeck.c (cp_build_unary_op): Consistently use the accurate location in seven additio...
Paolo Carlini [Wed, 27 Nov 2019 00:00:35 +0000 (00:00 +0000)]
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

5 years agoPR tree-optimization/92683 - strncmp incorrect result with equal substrings and non...
Martin Sebor [Tue, 26 Nov 2019 23:56:22 +0000 (23:56 +0000)]
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

5 years agoUpdate vect_char_add target selector to use its own cache
Joel Hutton [Tue, 26 Nov 2019 22:11:39 +0000 (22:11 +0000)]
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

5 years agore PR c++/92648 (Handling of unknown attributes)
Jakub Jelinek [Tue, 26 Nov 2019 21:58:22 +0000 (22:58 +0100)]
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

5 years agore PR c++/61414 (enum class bitfield size-checking needs a separate warning flag...
Jakub Jelinek [Tue, 26 Nov 2019 21:57:27 +0000 (22:57 +0100)]
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

5 years agoInsert missed log entry.
Jerry DeLisle [Tue, 26 Nov 2019 21:29:30 +0000 (21:29 +0000)]
Insert missed log entry.

From-SVN: r278735

5 years agoRemove entry committed to wrong log.
Jerry DeLisle [Tue, 26 Nov 2019 21:28:14 +0000 (21:28 +0000)]
Remove entry committed to wrong log.

From-SVN: r278734

5 years agoUnbreak objc build – with --enable-maintainer-mode
Tobias Burnus [Tue, 26 Nov 2019 20:16:30 +0000 (20:16 +0000)]
Unbreak objc build – with --enable-maintainer-mode

        * Makefile.in (aclocal_deps): Fix path to cet.m4.

From-SVN: r278732

5 years agolibstdc++: Use C++98 syntax to instantiate input_iterator_tag
François Dumont [Tue, 26 Nov 2019 19:23:11 +0000 (19:23 +0000)]
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

5 years agore PR target/92669 (ICE in pre_and_rev_post_order_compute_fn at gcc/cfganal.c:1034...
Richard Biener [Tue, 26 Nov 2019 12:03:58 +0000 (12:03 +0000)]
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

5 years agore PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer)
Jakub Jelinek [Tue, 26 Nov 2019 09:08:31 +0000 (10:08 +0100)]
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

5 years agoS/390: Add undef for MUSL_DYNAMIC_LINKERxx
Robin Dapp [Tue, 26 Nov 2019 09:00:26 +0000 (09:00 +0000)]
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

5 years agore PR tree-optimization/92644 (ICE in wide_int_to_tree_1, at tree.c:1530)
Jakub Jelinek [Tue, 26 Nov 2019 08:43:27 +0000 (09:43 +0100)]
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

5 years agore PR tree-optimization/92645 (Hand written vector code is 450 times slower when...
Richard Biener [Tue, 26 Nov 2019 08:32:38 +0000 (08:32 +0000)]
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

5 years agolibstdc++: Add C++20 P1032 constexpr to _GLIBCXX_DEBUG array
François Dumont [Tue, 26 Nov 2019 06:12:34 +0000 (06:12 +0000)]
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

5 years agolibstdc++: Add _GLIBCXX_DEBUG safe iterator C++20 iterator concept
François Dumont [Tue, 26 Nov 2019 06:07:23 +0000 (06:07 +0000)]
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

5 years agoDaily bump.
GCC Administrator [Tue, 26 Nov 2019 00:16:15 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r278716

5 years ago* gfortran.dg/dec-comparison.f90: Change dg-do from run to compile.
Jakub Jelinek [Mon, 25 Nov 2019 23:24:40 +0000 (00:24 +0100)]
* gfortran.dg/dec-comparison.f90: Change dg-do from run to compile.

From-SVN: r278713

5 years agoFix typo in C++2a paper number - P1920R1 -> P1902R1
Jakub Jelinek [Mon, 25 Nov 2019 21:48:24 +0000 (22:48 +0100)]
Fix typo in C++2a paper number - P1920R1 -> P1902R1

From-SVN: r278707

5 years agore PR fortran/92629 (internal compiler error: in convert_mpz_to_unsigned, at fortran...
Harald Anlauf [Mon, 25 Nov 2019 19:50:38 +0000 (19:50 +0000)]
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

5 years agolibstdc++: Add move_sentinel, common_iterator and counted_iterator
Jonathan Wakely [Mon, 25 Nov 2019 19:02:03 +0000 (19:02 +0000)]
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

5 years agoPR libstdc++/91786 fix compilation error with Clang
Jonathan Wakely [Mon, 25 Nov 2019 19:01:58 +0000 (19:01 +0000)]
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

5 years agoconfig/gcn/mkoffload.c – remove unused static vars
Tobias Burnus [Mon, 25 Nov 2019 14:25:17 +0000 (14:25 +0000)]
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

5 years agoUpdate dump message in IPA ICF.
Martin Liska [Mon, 25 Nov 2019 14:02:55 +0000 (15:02 +0100)]
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

5 years agoComment too strict checking assert.
Martin Liska [Mon, 25 Nov 2019 13:57:00 +0000 (14:57 +0100)]
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

5 years agotypeck.c (cp_build_indirect_ref_1): Add location_t parameter and use it in error...
Paolo Carlini [Mon, 25 Nov 2019 13:49:50 +0000 (13:49 +0000)]
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

5 years agoPrevent all uses of DFP when unsupported (PR c/91985).
Joseph Myers [Mon, 25 Nov 2019 13:45:42 +0000 (13:45 +0000)]
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

5 years agoProperly handle C2x attributes on types.
Joseph Myers [Mon, 25 Nov 2019 13:42:49 +0000 (13:42 +0000)]
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

5 years agoConvert m68k to not use cc0
Bernd Schmidt [Mon, 25 Nov 2019 12:31:16 +0000 (12:31 +0000)]
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

5 years agoTestsuite: Enable fp-int-convert-timode-1.c unconditionally when int128 supported.
Tamar Christina [Mon, 25 Nov 2019 12:23:30 +0000 (12:23 +0000)]
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

5 years agotree-vect-slp.c (vect_detect_hybrid_slp_stmts): Add assertion.
Richard Biener [Mon, 25 Nov 2019 11:38:37 +0000 (11:38 +0000)]
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

5 years ago[amdgcn] Silence warnings + add gcc_unreachable()
Tobias Burnus [Mon, 25 Nov 2019 11:34:53 +0000 (11:34 +0000)]
[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

5 years agore PR ada/92362 (double elaboration of expression in Address aspect)
Eric Botcazou [Mon, 25 Nov 2019 10:48:55 +0000 (10:48 +0000)]
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

5 years agoDEC comparisons - allow Hollerith constants in comparisons.
Mark Eggleston [Mon, 25 Nov 2019 10:36:25 +0000 (10:36 +0000)]
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

5 years agore PR ada/92575 (couple of suspicious assignments in expect.c)
Eric Botcazou [Mon, 25 Nov 2019 10:29:51 +0000 (10:29 +0000)]
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

5 years agoipa: Prevent materialization of clones with removed bodies (PR 92109)
Martin Jambor [Mon, 25 Nov 2019 10:13:08 +0000 (11:13 +0100)]
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

5 years agoMake IPA-SRA follow comdat-local rules (PR 91956)
Martin Jambor [Mon, 25 Nov 2019 10:09:42 +0000 (11:09 +0100)]
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

5 years agoBuild double32 / long-double32 multilibs if needed.
Georg-Johann Lay [Mon, 25 Nov 2019 08:59:06 +0000 (08:59 +0000)]
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

5 years agocfgloop.h (get_loop_exit_edges): Add extra parameter denoting loop body, defaulted...
Richard Biener [Mon, 25 Nov 2019 07:51:38 +0000 (07:51 +0000)]
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

5 years agocfganal.c (pre_and_rev_post_order_compute_fn): Use an auto_bb_flag instead of an...
Richard Biener [Mon, 25 Nov 2019 07:48:48 +0000 (07:48 +0000)]
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

5 years ago[rs6000] Refactor FP vector comparison operators
Kewen Lin [Mon, 25 Nov 2019 05:15:30 +0000 (05:15 +0000)]
[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

5 years agore PR libfortran/92100 (Formatted stream IO irreproducible read with binary data...
Jerry DeLisle [Mon, 25 Nov 2019 02:24:55 +0000 (02:24 +0000)]
re PR libfortran/92100 (Formatted stream IO irreproducible read with binary data in file)

2019-11-24  Jerry DeLisle  <jvdelisle@gcc.ngu.org>

PR fortran/92100
gfortran.dg/streamio_18.f90: New test.

From-SVN: r278664

5 years agoDaily bump.
GCC Administrator [Mon, 25 Nov 2019 00:16:20 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r278663

5 years agore PR libfortran/92100 (Formatted stream IO irreproducible read with binary data...
Jerry DeLisle [Sun, 24 Nov 2019 22:14:59 +0000 (22:14 +0000)]
re PR libfortran/92100 (Formatted stream IO irreproducible read with binary data in file)

2019-11-24  Jerry DeLisle  <jvdelisle@gcc.ngu.org>

PR fortran/92100
io/transfer.c (data_transfer_init_worker): Use fbuf_reset
instead of fbuf_flush before the seek. Note that fbuf_reset
calls fbuf_flush and adjusts fbuf pointers.

From-SVN: r278660

5 years agoFix EOF handling for arrays.
Thomas Koenig [Sun, 24 Nov 2019 19:16:23 +0000 (19:16 +0000)]
Fix EOF handling for arrays.

2019-11-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>

PR fortran/92569
* io/transfer.c (transfer_array_inner):  If position is
at AFTER_ENDFILE in current unit, return from data loop.

2019-11-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>

PR fortran/92569
* gfortran.dg/eof_6.f90: New test.

Co-Authored-By: Harald Anlauf <anlauf@gmx.de>
From-SVN: r278659

5 years agolibstdc++: Improve _GLIBCXX_DEBUG __valid_range check
François Dumont [Sun, 24 Nov 2019 17:09:44 +0000 (17:09 +0000)]
libstdc++: Improve _GLIBCXX_DEBUG __valid_range check

Adds iterator singular check within the valid range check.

* include/debug/functions.h: Remove <bits/move.h> include.
(__check_singular_aux, __check_singular): Move...
* include/debug/helper_functions.h:
(__check_singular_aux, __check_singular): ...here.
(__valid_range_aux): Adapt to use latter.
Add <bits/move.h> include.
* testsuite/25_algorithms/copy/debug/2_neg.cc: New.

From-SVN: r278658

5 years agoAllow combiner to create autoinc in jump insns.
Bernd Schmidt [Sun, 24 Nov 2019 13:20:55 +0000 (13:20 +0000)]
Allow combiner to create autoinc in jump insns.

* combine.c (can_combine_p): Allow autoinc in jumps.

From-SVN: r278656

5 years agoDo not ignore costs of jump insns in combine.
Bernd Schmidt [Sun, 24 Nov 2019 13:11:55 +0000 (13:11 +0000)]
Do not ignore costs of jump insns in combine.

* combine.c (combine_instructions): Record costs for jumps.

From-SVN: r278655

5 years agoFix ix86 rtx costs for the pr30315 testcase (PR target/30315)
Bernd Schmidt [Sun, 24 Nov 2019 13:08:27 +0000 (13:08 +0000)]
Fix ix86 rtx costs for the pr30315 testcase (PR target/30315)

* config/i386/i386.c (ix86_rtx_costs): Handle care of a PLUS in a
COMPARE, representing an overflow detection.

From-SVN: r278654

5 years agoDaily bump.
GCC Administrator [Sun, 24 Nov 2019 00:16:15 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r278653

5 years agoFixed ChangeLog entry.
Thomas Koenig [Sat, 23 Nov 2019 15:23:10 +0000 (15:23 +0000)]
Fixed ChangeLog entry.

From-SVN: r278648

5 years agoAdd test case for PR 92442.
Thomas Koenig [Sat, 23 Nov 2019 15:19:19 +0000 (15:19 +0000)]
Add test case for PR 92442.

2019-11-23  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/92442
* gfortran.dg/bounds_check_21.f90: New test.

From-SVN: r278647

5 years agoConvert inliner to new param infrastructure
Jan Hubicka [Sat, 23 Nov 2019 13:13:23 +0000 (13:13 +0000)]
Convert inliner to new param infrastructure

/bin/sh: :q: command not found
This patch adds opt_for_fn for all cross module params used by inliner
so they can be modified at function granuality.  With inlining almost always
there are three functions to consider (callee and caller of the inlined edge
and the outer function caller is inlined to).

I always use the outer function params since that is how local parameters
behave.  I hope it is kind of what is also expected in most case: it is better
to inline agressively into -O3 compiled code rather than inline agressively -O3
functions into their callers.

New params infrastructure is nice.  One drawback is that is very hard to
search for individual param uses since they all occupy global namespace.
With C++ world we had chance to do something like params.param_flag_name
or params::param_flag_name instead...

Bootstrapped/regtested x86_64-linux, comitted.

* cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT): Remove.
* doc/invoke.texi (max-inline-insns-single-O2,
inline-heuristics-hint-percent-O2, inline-min-speedup-O2,
early-inlining-insns-O2): Remove documentation.
* ipa-fnsummary.c (analyze_function_body,
compute_fn_summary): Use opt_for_fn when accessing parameters.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
inline_insns_auto, can_inline_edge_by_limits_p,
want_early_inline_function_p, big_speedup_p,
want_inline_small_function_p, want_inline_self_recursive_call_p,
recursive_inlining, compute_max_insns, inline_small_functions):
Likewise.
* opts.c (default_options): Add -O3 defaults for
OPT__param_early_inlining_insns_,
OPT__param_inline_heuristics_hint_percent_,
OPT__param_inline_min_speedup_, OPT__param_max_inline_insns_single_.
* params.opt (-param=early-inlining-insns-O2=,
-param=inline-heuristics-hint-percent-O2=,
-param=inline-min-speedup-O2=, -param=max-inline-insns-single-O2=
-param=early-inlining-insns=, -param=inline-heuristics-hint-percent=,
-param=inline-min-speedup=, -param=inline-unit-growth=,
-param=large-function-growth=, -param=large-stack-frame=,
-param=large-stack-frame-growth=, -param=large-unit-insns=,
-param=max-inline-insns-recursive=,
-param=max-inline-insns-recursive-auto=,
-param=max-inline-insns-single=,
-param=max-inline-insns-size=, -param=max-inline-insns-small=,
-param=max-inline-recursive-depth=,
-param=max-inline-recursive-depth-auto=,
-param=min-inline-recursive-probability=,
-param=partial-inlining-entry-probability=,
-param=uninlined-function-insns=, -param=uninlined-function-time=,
-param=uninlined-thunk-insns=, -param=uninlined-thunk-time=): Add
Optimization.

* g++.dg/tree-ssa/pr53844.C: Drop -O2 from param name.
* g++.dg/tree-ssa/pr61034.C: Likewise.
* g++.dg/tree-ssa/pr8781.C: Likewise.
* g++.dg/warn/Wstringop-truncation-1.C: Likewise.
* gcc.dg/ipa/pr63416.c: Likewise.
* gcc.dg/tree-ssa/ssa-thread-12.c: Likewise.
* gcc.dg/vect/pr66142.c: Likewise.
* gcc.dg/winline-3.c: Likewise.
* gcc.target/powerpc/pr72804.c: Likewise.

From-SVN: r278645

5 years agoConvert inliner to function specific param infrastructure
Jan Hubicka [Sat, 23 Nov 2019 13:11:25 +0000 (14:11 +0100)]
Convert inliner to function specific param infrastructure

This patch adds opt_for_fn for all cross module params used by inliner
so they can be modified at function granuality.  With inlining almost always
there are three functions to consider (callee and caller of the inlined edge
and the outer function caller is inlined to).

I always use the outer function params since that is how local parameters
behave.  I hope it is kind of what is also expected in most case: it is better
to inline agressively into -O3 compiled code rather than inline agressively -O3
functions into their callers.

New params infrastructure is nice.  One drawback is that is very hard to
search for individual param uses since they all occupy global namespace.
With C++ world we had chance to do something like params.param_flag_name
or params::param_flag_name instead...

Bootstrapped/regtested x86_64-linux, comitted.

* cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT): Remove.
* doc/invoke.texi (max-inline-insns-single-O2,
inline-heuristics-hint-percent-O2, inline-min-speedup-O2,
early-inlining-insns-O2): Remove documentation.
* ipa-fnsummary.c (analyze_function_body,
compute_fn_summary): Use opt_for_fn when accessing parameters.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
inline_insns_auto, can_inline_edge_by_limits_p,
want_early_inline_function_p, big_speedup_p,
want_inline_small_function_p, want_inline_self_recursive_call_p,
recursive_inlining, compute_max_insns, inline_small_functions):
Likewise.
* opts.c (default_options): Add -O3 defaults for
OPT__param_early_inlining_insns_,
OPT__param_inline_heuristics_hint_percent_,
OPT__param_inline_min_speedup_, OPT__param_max_inline_insns_single_.
* params.opt (-param=early-inlining-insns-O2=,
-param=inline-heuristics-hint-percent-O2=,
-param=inline-min-speedup-O2=, -param=max-inline-insns-single-O2=
-param=early-inlining-insns=, -param=inline-heuristics-hint-percent=,
-param=inline-min-speedup=, -param=inline-unit-growth=,
-param=large-function-growth=, -param=large-stack-frame=,
-param=large-stack-frame-growth=, -param=large-unit-insns=,
-param=max-inline-insns-recursive=,
-param=max-inline-insns-recursive-auto=,
-param=max-inline-insns-single=,
-param=max-inline-insns-size=, -param=max-inline-insns-small=,
-param=max-inline-recursive-depth=,
-param=max-inline-recursive-depth-auto=,
-param=min-inline-recursive-probability=,
-param=partial-inlining-entry-probability=,
-param=uninlined-function-insns=, -param=uninlined-function-time=,
-param=uninlined-thunk-insns=, -param=uninlined-thunk-time=): Add
Optimization.

* g++.dg/tree-ssa/pr53844.C: Drop -O2 from param name.
* g++.dg/tree-ssa/pr61034.C: Likewise.
* g++.dg/tree-ssa/pr8781.C: Likewise.
* g++.dg/warn/Wstringop-truncation-1.C: Likewise.
* gcc.dg/ipa/pr63416.c: Likewise.
* gcc.dg/tree-ssa/ssa-thread-12.c: Likewise.
* gcc.dg/vect/pr66142.c: Likewise.
* gcc.dg/winline-3.c: Likewise.
* gcc.target/powerpc/pr72804.c: Likewise.

From-SVN: r278644

5 years agoipa-fnsummary.c: Fix comment typos.
Jakub Jelinek [Sat, 23 Nov 2019 11:44:51 +0000 (12:44 +0100)]
ipa-fnsummary.c: Fix comment typos.

* ipa-fnsummary.c: Fix comment typos.
* ipa-ref.h: Likewise.
* ipa-predicate.h: Likewise.
* ipa-split.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* ipa-predicate.c: Likewise.
* ipa-devirt.c: Likewise.
* ipa-icf.h: Likewise.
* profile-count.c: Likewise.
* ipa-icf.c: Likewise.
(sem_function::equals_wpa): Fix typos in dump messages.
* ipa-icf-gimple.h: Fix comment typos.
* ipa-inline-transform.c: Likewise.
* ipa-polymorphic-call.c: Likewise.
* ipa-fnsummary.h: Likewise.
* ipa-inline.c: Likewise.
(dump_inline_stats): Fix typo in debug dump message.
* profile-count.h: Fix comment typos.

From-SVN: r278643

5 years agore PR inline-asm/92615 (ICE in extract_insn)
Jakub Jelinek [Sat, 23 Nov 2019 10:07:21 +0000 (11:07 +0100)]
re PR inline-asm/92615 (ICE in extract_insn)

PR target/92615
* config/i386/i386.c (ix86_md_asm_adjust): If dest_mode is
GET_MODE (dest), is not QImode, using ZERO_EXTEND and dest is not
register_operand, force x into register before storing it into dest.
Formatting fix.

* gcc.target/i386/pr92615.c: New test.

From-SVN: r278642

5 years agore PR middle-end/83859 (Please add new attribute which will establish relation betwee...
Jakub Jelinek [Sat, 23 Nov 2019 10:06:26 +0000 (11:06 +0100)]
re PR middle-end/83859 (Please add new attribute which will establish relation between parameters for buffer and its size)

PR middle-end/83859
* doc/extend.texi (attribute access): Fix a typo.

* c-attribs.c (append_access_attrs): Avoid buffer overflow.  Avoid
memory leak.  Use XNEWVEC macro.  Use auto_diagnostic_group to
group warning with inform together.
(handle_access_attribute): Formatting fix.

From-SVN: r278641

5 years agore PR rtl-optimization/92610 (ICE in calc_dfs_tree, at dominance.c:458 since r270940)
Jakub Jelinek [Sat, 23 Nov 2019 10:05:31 +0000 (11:05 +0100)]
re PR rtl-optimization/92610 (ICE in calc_dfs_tree, at dominance.c:458 since r270940)

PR rtl-optimization/92610
* cse.c (rest_of_handle_cse2): Call cleanup_cfg (0) also if
cse_cfg_altered is set, even when tem is 0.
(rest_of_handle_cse_after_global_opts): Likewise.

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

From-SVN: r278640

5 years agore PR c++/92365 (ice unexpected expression ‘int16_t()’ of kind cast_expr)
Bernd Edlinger [Sat, 23 Nov 2019 06:33:59 +0000 (06:33 +0000)]
re PR c++/92365 (ice unexpected expression ‘int16_t()’ of kind cast_expr)

PR c++/92365

2019-11-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/92365
        * name-lookup.c (check_local_shadow): Use can_convert_arg
        instead of can_convert.

testsuite:
2019-11-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/92365
        * g++.dg/pr92365.C: New test.

From-SVN: r278639

5 years agoDaily bump.
GCC Administrator [Sat, 23 Nov 2019 00:16:21 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r278638

5 years agoPR c++/88337 - P1327R1: Allow polymorphic typeid in constexpr.
Marek Polacek [Fri, 22 Nov 2019 23:48:25 +0000 (23:48 +0000)]
PR c++/88337 - P1327R1: Allow polymorphic typeid in constexpr.

Part of P1327R1 is to allow typeid with an operand of polymorphic type in
constexpr.  I found that we pretty much support it already, the only tweak
was to allow TYPEID_EXPR (only created in a template) in constexpr in C++20.

* constexpr.c (potential_constant_expression_1): Allow a typeid
expression whose operand is of polymorphic type in constexpr in
C++20.
* rtti.c (build_typeid): Remove obsolete FIXME comment.

* g++.dg/cpp2a/constexpr-typeid1.C: New test.
* g++.dg/cpp2a/constexpr-typeid2.C: New test.
* g++.dg/cpp2a/constexpr-typeid3.C: New test.
* g++.dg/cpp2a/constexpr-typeid4.C: New test.

From-SVN: r278635

5 years agore PR c/90677 (gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node'...
Jakub Jelinek [Fri, 22 Nov 2019 21:45:27 +0000 (22:45 +0100)]
re PR c/90677 (gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node' is not defined as a type)

PR c/90677
* c-common.h (identifier_global_tag): Declare.
* c-format.c (get_pointer_to_named_type): Renamed to ...
(get_named_type): ... this.  Use identifier_global_tag instead of
identifier_global_value, handle the return value being a TYPE_P.
(init_dynamic_diag_info): Adjust get_pointer_to_named_type callers
to call get_named_type instead.  Formatting fixes.
c/
* c-decl.c (identifier_global_tag): Define.
cp/
* cp-objcp-common.c (identifier_global_tag): Define.
testsuite/
* c-c++-common/pr90677.c: New test.

From-SVN: r278634

5 years agore PR c++/92458 (Constraints do not work with precompiled headers)
Jakub Jelinek [Fri, 22 Nov 2019 21:38:44 +0000 (22:38 +0100)]
re PR c++/92458 (Constraints do not work with precompiled headers)

PR c++/92458
* tree-hash-traits.h (tree_decl_hash, tree_ssa_name_hash,
tree_hash): Move to ...
* tree.h (tree_decl_hash, tree_ssa_name_hash, tree_hash): ... here.
(struct decl_tree_cache_traits, struct type_tree_cache_traits): New
types.
(decl_tree_cache_map, tree_tree_cache_map): New typedefs.

* init.c (nsdmi_inst): Change type to
decl_tree_cache_map * from tree_cache_map *.
* constraint.cc (decl_constraints): Likewise.
* decl.c (get_tuple_decomp_init): Likewise.
* pt.c (defarg_inst, explicit_specifier_map): Likewise.
(tsubst_default_argument, store_explicit_specifier): Use
decl_tree_cache_map::create_ggc rather than
tree_cache_map::create_ggc.
* cp-objcp-common.c (debug_type_map): Change type to
type_tree_cache_map * from tree_cache_map *.

* g++.dg/pch/pr92458.C: New test.
* g++.dg/pch/pr92458.Hs: New test.

From-SVN: r278633

5 years ago[Darwin, X86, testsuite] Update tests for common section use.
Iain Sandoe [Fri, 22 Nov 2019 20:58:54 +0000 (20:58 +0000)]
[Darwin, X86, testsuite] Update tests for common section use.

The tests amended here now have different code-gen with default
options because, previously, the access were indirected per Darwin
ABI for common accesses.  The revised code-gen does not match the
expected scan-asms because Darwin defaults to fPIC.  For these tests,
it seems that the best solution is to use '-mdynamic-no-pic' in the
m32 case which makes the output similar to the ElF platform default.

gcc/testsuite/ChangeLog:

2019-11-22  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.target/i386/pr27971.c: Use mdynamic-no-pic for m32 on
Darwin.
* gcc.target/i386/sse2-load-multi.c: Likewise.
* gcc.target/i386/sse2-store-multi.c: Likewise.

From-SVN: r278631

5 years ago[testsuite] Commit missed Changelog entry.
Iain Sandoe [Fri, 22 Nov 2019 20:45:34 +0000 (20:45 +0000)]
[testsuite] Commit missed Changelog entry.

From-SVN: r278630

5 years agoImplement P1902R1, Missing feature-test macros 2017-2019.
Jakub Jelinek [Fri, 22 Nov 2019 19:55:38 +0000 (20:55 +0100)]
Implement P1902R1, Missing feature-test macros 2017-2019.

* c-cppbuiltin.c (c_cpp_builtins): Bump __cpp_init_captures
and __cpp_generic_lambdas for -std=c++2a.  Define
__cpp_designated_initializers, __cpp_constexpr_in_decltype and
__cpp_consteval for -std=c++2a.  Remove a FIXME comment about
__cpp_concepts for -std=c++2a.

* g++.dg/cpp1z/feat-cxx1z.C: Only compile with -std=c++17.
* g++.dg/cpp2a/feat-cxx2a.C: Adjust for P1902R1 changes.
* g++.dg/cpp2a/desig15.C: New test.
* g++.dg/cpp2a/lambda-pack-init3.C: New test.
* g++.dg/cpp2a/lambda-generic6.C: New test.
* g++.dg/cpp2a/consteval15.C: New test.

From-SVN: r278628

5 years agore PR tree-optimization/92618 (error: type mismatch in binary expression in reassoc...
Jakub Jelinek [Fri, 22 Nov 2019 18:17:04 +0000 (19:17 +0100)]
re PR tree-optimization/92618 (error: type mismatch in binary expression in reassoc since r273490)

PR tree-optimization/92618
* tree-ssa-reassoc.c (v_info): Change from auto_vec to a struct
containing the auto_vec and a tree.
(undistribute_bitref_for_vector): Handle the case when element type
of vec is not the same as type of the BIT_FIELD_REF.  Formatting
fixes.

* gcc.c-torture/compile/pr92618.c: New test.
* gcc.c-torture/execute/pr92618.c: New test.

From-SVN: r278626

5 years agoPR middle-end/83859 - attributes to associate pointer arguments and sizes
Martin Sebor [Fri, 22 Nov 2019 17:14:17 +0000 (17:14 +0000)]
PR middle-end/83859 - attributes to associate pointer arguments and sizes

gcc/ChangeLog:

PR middle-end/83859
* attribs.h (struct attr_access): New.
* attribs.c (decl_attributes): Add an informational note.
* builtins.c (check_access): Make extern.  Consistently set no-warning
after issuing a warning.  Handle calls through function pointers.  Set
no-warning.
* builtins.h (check_access): Declare.
* calls.c (rdwr_access_hash): New type.
(rdwr_map): Same.
(init_attr_rdwr_indices): New function.
(maybe_warn_rdwr_sizes): Same.
(initialize_argument_information): Call init_attr_rdwr_indices.
Call maybe_warn_rdwr_sizes.
(get_size_range): Avoid null argument.
* doc/extend.texi (attribute access): Document new attribute.

gcc/c-family/ChangeLog:

PR middle-end/83859
* c-attribs.c (handle_access_attribute): New function.
(c_common_attribute_table): Add new attribute.
(get_argument_type): New function.
(append_access_attrs): New function.
(get_nonnull_operand): Rename...
(get_attribute_operand): ...to this.
* c-common.c (get_nonnull_operand): Rename...
(get_attribute_operand): ...to this.

gcc/testsuite/ChangeLog:

PR middle-end/83859
* c-c++-common/attr-nonstring-8.c: Adjust text of expected warning.
* gcc.dg/Wstringop-overflow-23.c: New test.
* gcc.dg/Wstringop-overflow-24.c: New test.
* gcc.dg/attr-access-read-only.c: New test.
* gcc.dg/attr-access-read-write.c: New test.
* gcc.dg/attr-access-read-write-2.c: New test.
* gcc.dg/attr-access-write-only.c: New test.

From-SVN: r278624

5 years agoPR middle-end/88226 - missing warning on fprintf, fputs, and puts with an unterminate...
Martin Sebor [Fri, 22 Nov 2019 16:47:22 +0000 (16:47 +0000)]
PR middle-end/88226 - missing warning on fprintf, fputs, and puts with an unterminated array

gcc/ChangeLog:

PR middle-end/88226
* builtins.c (check_nul_terminated_array): New function.
(fold_builtin_0): Remove declaration.
(fold_builtin_1): Same.
(fold_builtin_2): Same.
(fold_builtin_3): Same.
(fold_builtin_strpbrk): Add argument.
(fold_builtin_strspn): Same.
(fold_builtin_strcspn): Same.
(expand_builtin_strcat): Call it.  Remove unused argument.
(expand_builtin_stpncpy): Same.
(expand_builtin_strncat): Same.
(expand_builtin_strncpy): Same.  Adjust indentation.
(expand_builtin_strcmp): Same.
(expand_builtin_strncmp): Same.
(expand_builtin_fork_or_exec): Same.
(expand_builtin): Handle more built-ins.
(fold_builtin_2): Add argument.
(fold_builtin_n): Make static.  Add argument.
(fold_call_expr): Pass new argument to fold_builtin_n and fold_builtin_2.
(fold_builtin_call_array): Pass new argument to fold_builtin_n.
(fold_builtin_strpbrk): Add argument.  Call check_nul_terminated_array.
(fold_call_stmt): Pass new argument to fold_builtin_n.
* builtins.h: Correct a comment.
* gimple-fold.c (gimple_fold_builtin_strchr): Call
check_nul_terminated_array.
* tree-ssa-strlen.c (handle_builtin_strlen): Call
check_nul_terminated_array.
(handle_builtin_strchr): Same.
(handle_builtin_string_cmp): Same.

gcc/testsuite/ChangeLog:

PR middle-end/88226
* gcc.dg/Wstringop-overflow-22.c: New test.
* gcc.dg/tree-ssa/builtin-fprintf-warn-1.c: Remove xfails.

From-SVN: r278623

5 years agoLimit LDS usage.
Andrew Stubbs [Fri, 22 Nov 2019 16:43:46 +0000 (16:43 +0000)]
Limit LDS usage.

2019-11-22  Andrew Stubbs  <ams@codesourcery.com>

gcc/
* config/gcn/gcn.c (OMP_LDS_SIZE): Define.
(ACC_LDS_SIZE): Define.
(OTHER_LDS_SIZE): Define.
(LDS_SIZE): Redefine using above.
(gcn_expand_prologue): Initialize m0 with LDS_SIZE-1.

From-SVN: r278622

5 years agoPR tree-optimization/92501 - strncmp with constant unterminated arrays not folded
Martin Sebor [Fri, 22 Nov 2019 16:39:37 +0000 (16:39 +0000)]
PR tree-optimization/92501 - strncmp with constant unterminated arrays not folded

gcc/testsuite/ChangeLog:

PR tree-optimization/92501
* gcc.dg/strcmpopt_7.c: New test.

gcc/ChangeLog:

PR tree-optimization/92501
* gimple-fold.c ((gimple_fold_builtin_string_compare): Let strncmp
handle unterminated arrays.  Rename local variables for clarity.

From-SVN: r278621

5 years agoUse GFX9 granulated sgprs count correctly.
Andrew Stubbs [Fri, 22 Nov 2019 14:42:49 +0000 (14:42 +0000)]
Use GFX9 granulated sgprs count correctly.

2019-11-22  Andrew Stubbs  <ams@codesourcery.com>

gcc/
* config/gcn/gcn.c (gcn_hsa_declare_function_name): Calculate
granulated_sgprs according to architecture.

From-SVN: r278617

5 years agoRelease memory-block-pool memory back to malloc.
Jan Hubicka [Fri, 22 Nov 2019 14:37:37 +0000 (15:37 +0100)]
Release memory-block-pool memory back to malloc.

* ggc-page.c (ggc_collect): Call memory_block_pool::trim.
* memory-block.cc (memory_block_pool::clear_free_list): Rename to ...
(memory_block_pool::reduce_free_list): ... this one.
(memory_block_pool::trim): New static function.
* memory-block.h (memory_block_pool::freelist_size): New constant
(memory_block_pool::clear_free_list): Rename to ...
(memory_block_pool::reduce_free_list): ... this one.
(memory_block_pool::trim): Declare.

* lto.c (lto_wpa_write_files): Call memory_block_pool::trim.

From-SVN: r278616

5 years agoDisable epilogue loop vectorisation for vect-widen-mult-u8-*.c
Richard Sandiford [Fri, 22 Nov 2019 12:03:08 +0000 (12:03 +0000)]
Disable epilogue loop vectorisation for vect-widen-mult-u8-*.c

vect-widen-mult-u8.c and vect-widen-mult-u8-u32.c were failing
on arm-linux-gnueabihf with epilogue vectorisation because we
print the expected messages twice rather than once.  We could
fix that either by removing the counts or by disabling epilogue
loop vectorisation.  The other vect-widen-mult-* tests do the
latter, so I did the same here.

2019-11-22  Richard Sandiford  <richard.sandiford@arm.com>

gcc/testsuite/
* gcc.dg/vect/vect-widen-mult-u8.c: Disable epilogue loop
vectorization.
* gcc.dg/vect/vect-widen-mult-u8-u32.c: Likewise.

From-SVN: r278613

5 years agoFix markup in gcc.dg/vect/vect-cond-reduc-3.c
Richard Sandiford [Fri, 22 Nov 2019 10:56:13 +0000 (10:56 +0000)]
Fix markup in gcc.dg/vect/vect-cond-reduc-3.c

gcc.dg/vect/vect-cond-reduc-3.c had been failing on
arm-linux-gnueabihf since the test was added, because the test needs
support for VEC_COND_EXPR <float cmp float, int, int> whereas the target
only supports VEC_COND_EXPRs in which all modes are the same.  (I have
a fix for that, but it's not really stage 3 material.)

2019-11-22  Richard Sandiford  <richard.sandiford@arm.com>

gcc/testsuite/
* gcc.dg/vect/vect-cond-reduc-3.c: Require vect_cond_mixed
rather than vect_condition.

From-SVN: r278612

5 years agoMove EXTRACT_LAST_REDUCTION costing to vectorizable_condition
Richard Sandiford [Fri, 22 Nov 2019 09:58:08 +0000 (09:58 +0000)]
Move EXTRACT_LAST_REDUCTION costing to vectorizable_condition

gcc.target/aarch64/sve/clastb_[57].c started failing after the increase
in the cost of vec_to_scalar (r278452).  The problem is that we were
double-counting the cost of the CLASTB: once in vect_model_reduction_cost
as a vec_to_scalar and once in vectorizable_condition as a plain
vector_stmt.

Based on the TODO above vect_model_reduction_cost, I think the
preferred long-term direction is for vectorizable_* to cost these
things itself, so that's what the patch does (for this one case only).

2019-11-22  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-stmts.c (vect_model_simple_cost): Take an optional
vect_cost_for_stmt.
(vectorizable_condition): Calculate the cost of EXTRACT_LAST_REDUCTION
here rather than...
* tree-vect-loop.c (vect_model_reduction_cost): ...here.

From-SVN: r278611

5 years ago[ARC] Fix failing pr77309 for ARC700
Claudiu Zissulescu [Fri, 22 Nov 2019 08:00:33 +0000 (09:00 +0100)]
[ARC] Fix failing pr77309 for ARC700

The patterns neg_scc_insn and not_scc_insn are not correct, leading to
failing pr77309 test for ARC700. Add two new bic compare with zero
patterns to improve output code.

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

* config/arc/arc.md (bic_f): Use cc_set_register predicate.
(bic_cmp0_noout): New pattern.
(bic_cmp0): Likewise.
(neg_scc_insn): Remove pattern.
(not_scc_insn): Likewise.

From-SVN: r278610

5 years ago[ARC] Fix ARC target specific tests.
Claudiu Zissulescu [Fri, 22 Nov 2019 07:59:54 +0000 (08:59 +0100)]
[ARC] Fix ARC target specific tests.

Fix ARC specific tests by improving the matching pattern and adding
the missing functionality in arc.exp

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

* gcc.target/arc/add_n-combine.c: Match add1/2/3 instruction in
output assembly.
* gcc.target/arc/arc.exp (check_effective_target_codedensity):
Add.
* gcc.target/arc/cmem-7.c: Fix matching patterns.
* gcc.target/arc/cmem-bit-1.c: Likewise.
* gcc.target/arc/cmem-bit-2.c: Likewise.
* gcc.target/arc/cmem-bit-3.c: Likewise.
* gcc.target/arc/cmem-bit-4.c: Likewise.
* gcc.target/arc/interrupt-2.c: Match rtie insn for A7.
* gcc.target/arc/store-merge-1.c: This test is only meaningful for
architectures with double load/store operations.

From-SVN: r278609

5 years agostrlenopt-66.c: Avoid buffer overflow.
Martin Sebor [Fri, 22 Nov 2019 00:51:16 +0000 (00:51 +0000)]
strlenopt-66.c: Avoid buffer overflow.

gcc/testsuite/ChangeLog:
* gcc.dg/strlenopt-66.c: Avoid buffer overflow.  Add more test cases.

From-SVN: r278608

5 years agoDaily bump.
GCC Administrator [Fri, 22 Nov 2019 00:16:42 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r278607

5 years agodoc: Remove claim about ISO C
Harald van Dijk [Thu, 21 Nov 2019 23:27:39 +0000 (00:27 +0100)]
doc: Remove claim about ISO C

The patch to make -fcommon the default introduces a bogus claim into
the GCC documentation.

-fcommon was claimed to be incompatible with ISO C for preventing
duplicate definitions from being diagnosed.  It does, but as that
elicits undefined behaviour (the requirement that there shall be no
more than one external definition is not a constraint), ISO C does not
require any diagnostic for it.  In the absence of any other rule this
would violate, both -fcommon and -fno-common are fully compatible with
all versions of ISO C.

2019-11-21  Harald van Dijk  <harald@gigawatt.nl>

* doc/invoke.texi (-fcommon): Remove claim about ISO C.

From-SVN: r278604

5 years agoMake more bad uses of fallthrough attribute into pedwarns.
Joseph Myers [Thu, 21 Nov 2019 20:29:40 +0000 (20:29 +0000)]
Make more bad uses of fallthrough attribute into pedwarns.

Various bad uses of the [[fallthrough]] attribute are constraint
violations in C2x, so need pedwarns rather than warnings.

This patch duly turns the relevant warnings into pedwarns.  The
relevant code is not specific to C, and does not know which form the
attribute was given in ([[fallthrough]] or [[gnu::fallthrough]] or
__attribute__((fallthrough))), but as I understand it these usages are
also erroneous for C++ and it seems reasonable to give a pedwarn here
even when a form other than [[fallthrough]] is being used.

The precise meaning of the standard wording about "The next statement
that would be executed" seems a but unclear in some corner cases; the
tests added keep to cases where it is clear whether or not the next
statement executed is of the required form.

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

gcc:
* gimplify.c (expand_FALLTHROUGH_r, expand_FALLTHROUGH): Use
pedwarn instead of warning_at for fallthrough not preceding a case
or default label.

gcc/c-family:
* c-attribs.c (handle_fallthrough_attribute): Use pedwarn instead
of warning.

gcc/testsuite:
* gcc.dg/c2x-attr-fallthrough-6.c: New test.  Split out from
c2x-attr-fallthrough-3.c.
* gcc.dg/c2x-attr-fallthrough-1.c: Add more tests.
* gcc.dg/c2x-attr-fallthrough-2.c: Update expected diagnostics.
* gcc.dg/c2x-attr-fallthrough-3.c: Split inside-switch part of
test out to c2x-attr-fallthrough-6.c.

From-SVN: r278599