1. 29 Nov, 2019 4 commits
    • re PR tree-optimization/92704 (ICE: Segmentation fault (in process_bb)) · d5e82c9f
      2019-11-29  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/92704
      	* tree-if-conv.c (combine_blocks): Deal with virtual PHIs
      	in loops performing only loads.
      
      	* gcc.dg/torture/pr92704.c: New testcase.
      
      From-SVN: r278828
      Richard Biener committed
    • Handle C2x attributes in Objective-C. · 34b43828
      When adding the initial support for C2x attributes, I deferred the
      unbounded lookahead support required to support such attributes in
      Objective-C (except for the changes to string literal handling, which
      were the riskier piece of preparation for such lookahead support).
      This patch adds that remaining ObjC support.
      
      For C, the parser continues to work exactly as it did before.  For
      ObjC, however, when checking for whether '[[' starts attributes, it
      lexes however many tokens are needed to check for a matching ']]', but
      in a raw mode that omits all the context-sensitive processing that
      c_lex_with_flags normally does, so that that processing can be done
      later when the right context-sensitive flags are set.  Those tokens
      are saved in a separate raw_tokens vector in the parser, and normal
      c_lex_one_token calls will get tokens from there and perform the
      remaining processing on them, if any tokens are found there, so all
      parsing not using the new interfaces gets the same tokens as it did
      before.  (For C, this raw lexing never occurs and the vector of raw
      tokens is always NULL.)
      
      Bootstrapped with no regressions for x86_64-pc-linux-gnu.
      
      gcc/c:
      	* c-parser.c (struct c_parser): Add members raw_tokens and
      	raw_tokens_used.
      	(c_lex_one_token): Add argument raw.  Handle lexing raw tokens and
      	using previously-lexed raw tokens.
      	(c_parser_peek_nth_token_raw)
      	(c_parser_check_balanced_raw_token_sequence): New functions.
      	(c_parser_nth_token_starts_std_attributes): Use
      	c_parser_check_balanced_raw_token_sequence for Objective-C.
      
      gcc/testsuite:
      	* objc.dg/attributes/gnu2x-attr-syntax-1.m: New test.
      
      From-SVN: r278827
      Joseph Myers committed
    • Remove unused decimal floating-point pointer types · 70ce1ab9
      	gcc/
      	* builtin-types.def (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR,
      	BT_DFLOAT128_PTR) Remove.
      	* tree-core.h (TI_DFLOAT32_PTR_TYPE, TI_DFLOAT64_PTR_TYPE,
      	TI_DFLOAT128_PTR_TYPE): Remove.
      	* tree.c (build_common_type_nodes): Remove dfloat32_ptr_type_node,
      	dfloat64_ptr_type_node and dfloat128_ptr_type_node initialisation.
      	* tree.h (dfloat32_ptr_type_node, dfloat64_ptr_type_node,
      	dfloat128_ptr_type_node): Remove macros.
      
      	gcc/jit/
      	* jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR):
      	Remove commented-out cases.
      
      Reviewed-by: Joseph Myers <joseph@codesourcery.com>
      
      From-SVN: r278826
      Julian Brown committed
    • Daily bump. · 19f9ca88
      From-SVN: r278825
      GCC Administrator committed
  2. 28 Nov, 2019 26 commits
  3. 27 Nov, 2019 10 commits
    • Reformat movsi_internal. · 4a54de9d
      2019-11-27  Michael Meissner  <meissner@linux.ibm.com>
      
      	* config/rs6000/rs6000.md (movsi_internal): Reformat.
      
      From-SVN: r278787
      Michael Meissner committed
    • Implement P1814R0, CTAD for alias templates. · 1a291106
      This patch implements C++20 class template argument deduction for alias
      templates, which works by a moderately arcane transformation of the
      deduction guides for the underlying class template.  When implementing it,
      it seemed that I could simplify the rules in the draft a bit and get
      essentially the same effect; I'll be emailing the committee to that effect
      soon.
      
      gcc/cp/
      	* pt.c (rewrite_tparm_list): Factor out of build_deduction_guide.
      	(maybe_aggr_guide): Check for copy-init here.
      	(alias_ctad_tweaks, deduction_guides_for): New.
      	(ctor_deduction_guides_for): Factor out of do_class_deduction.
      	(ctad_template_p): New.
      	* parser.c (cp_parser_simple_type_specifier): Use it.
      	* constraint.cc (append_constraint): New.
      gcc/c-family/
      	* c-cppbuiltin.c (c_cpp_builtins): Update __cpp_deduction_guides.
      
      From-SVN: r278786
      Jason Merrill committed
    • Fix constrained alias template transparency. · 1f41df91
      A constrained alias template can't be treated as equivalent to its
      underlying template/type for much the same reason that an alias template
      like void_t can't; we're relying on checking during substitution.
      
      	* cxx-pretty-print.c (pp_cxx_unqualified_id): Handle alias
      	template-id.
      	* pt.c (complex_alias_template_p): True if constraints.
      	(get_underlying_template, tsubst): Check alias constraints.
      	(push_template_decl_real): Set alias constraints here.
      	* parser.c (cp_parser_alias_declaration): Not here.
      	* constraint.cc (get_constraints): Take const_tree.
      
      From-SVN: r278785
      Jason Merrill committed
    • PR c++/92206 - ICE with typedef to dependent alias. · 96cbfa7f
      rsandifo's patch for 92206 demonstrated a problem with the existing checking
      for alias template specializations: they were returning false for a typedef
      to an alias template specialization.  Which is sometimes what the caller
      wants, and sometimes not: Sometimes we're interested in whether the type was
      written as an alias template-id, and sometimes whether it represents one.
      
      The testcase illustrates a case that remained wrong with the earlier patch:
      if the typedef is itself an alias template specialization, we can't strip an
      underlying dependent alias.
      
      	* pt.c (dependent_alias_template_spec_p)
      	(alias_template_specialization_p): Add transparent_typedefs
      	parameter.
      	(iterative_hash_template_arg, any_template_parm_r)
      	(primary_template_specialization_p, tsubst, dependent_type_p_r):
      	Adjust.
      	* decl.c (check_elaborated_type_specifier): Adjust.
      	* error.c (dump_template_bindings, dump_aggr_type): Adjust.
      
      From-SVN: r278784
      Jason Merrill committed
    • Do not define DFP builtin functions, if DFP has been disabled. · a92cc0da
      	PR bootstrap/92661
      	* config/rs6000/rs6000-call.c: (def_builtin): Do not define the
      	builtin if we don't have an actual type.
      	(builtin_function_type): If the builtin function uses a DFP type
      	and decimal float has been disabled, then return NULL_TREE.
      
      From-SVN: r278783
      Peter Bergner committed
    • Fix 'libgomp.fortran/target-print-1.f90', 'libgomp.oacc-fortran/print-1.f90' for… · b1a73b48
      Fix 'libgomp.fortran/target-print-1.f90', 'libgomp.oacc-fortran/print-1.f90' for offload target nvptx
      
      	libgomp/
      	* testsuite/lib/libgomp.exp
      	(check_effective_target_offload_target_nvptx): New proc.
      	* testsuite/libgomp.fortran/target-print-1.f90: Use it with
      	'dg-skip-if'.
      	* testsuite/libgomp.oacc-fortran/print-1.f90: Likewise.
      	* testsuite/libgomp.fortran/target-print-1-nvptx.f90: New file.
      	* testsuite/libgomp.oacc-fortran/print-1-nvptx.f90: Likewise.
      
      From-SVN: r278779
      Thomas Schwinge committed
    • re PR rtl-optimization/92510 (ICE in native_encode_rtx, at simplify-rtx.c:6272) · fa213633
      	PR rtl-optimization/92510
      	* combine.c (gen_lowpart_for_combine): Only transform lowpart subreg
      	of comparison into a comparison with different mode if both imode and
      	omode are scalar integral modes.
      
      	* gcc.dg/pr92510.c: New test.
      
      From-SVN: r278777
      Jakub Jelinek committed
    • re PR c++/92236 ([concepts] Explain non-satisfaction in static_assert) · 861d4af8
      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
      Andrew Sutton committed
    • re PR c++/92439 ([concepts] trunk crashes on constraint satisfaction failure) · 50e0c6e4
      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
      Andrew Sutton committed
    • re PR c++/88395 (ICE: Segmentation fault signal terminated program cc1plus, with… · 72479e32
      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
      Andrew Sutton committed