Commit Graph

189948 Commits

Author SHA1 Message Date
Patrick Palka
09c24fe42f c++: implicit dummy object in requires clause [PR103198]
In the testcase below satisfaction misbehaves for f and g ultimately
because find_template_parameters fails to notice that the constraint
'val.x' depends on the template parms of the class template.  In
contrast, satisfaction works just fine for h.

The problem seems to come down to a difference in how any_template_parm_r
handles 'this' vs a dummy object: it walks the TREE_TYPE of the former
but not the latter, and this causes us to miss the tparm dependencies in
f/g's constraints since in their case the implicit object parm through
which we access 'val' is a dummy object.  (For h, since we know it's a
non-static member function when parsing its trailing constraints, the
implicit object parm is 'this', not a dummy object.)

This patch fixes this inconsistency by making any_template_parm_r walk
into the TREE_TYPE of a dummy object, like it already does for 'this'.

	PR c++/103198

gcc/cp/ChangeLog:

	* pt.c (any_template_parm_r): Walk the TREE_TYPE of a dummy
	object.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/concepts-this1.C: New test.
2021-11-18 19:32:22 -05:00
GCC Administrator
483092d3d9 Daily bump. 2021-11-19 00:16:34 +00:00
Iain Buclaw
d6ec661e39 d: Use HOST_WIDE_INT for type size temporaries.
These variables are later used as the value for the format specifier
`%wd`, which the expected type may not match dinteger_t, causing
unnecessary -Wformat warnings.

gcc/d/ChangeLog:

	* decl.cc (d_finish_decl): Use HOST_WIDE_INT for type size
	temporaries.
2021-11-19 00:32:28 +01:00
Marek Polacek
93810fd673 c++: Implement C++23 P0849R8 - auto(x) [PR103049]
This patch implements P0849R8 which allows auto in a functional cast,
the result of which is a prvalue.

[expr.type.conv]/1 says that the type is determined by placeholder type
deduction.  We only accept 'auto', not 'decltype(auto)' -- that the
type shall be auto comes from [dcl.type.auto.deduct].  Therefore the
rules are like for [temp.deduct.call], deducing template arguments from
a function call, so the result type will never be a reference, and we
decay arrays/functions.

	PR c++/103049

gcc/cp/ChangeLog:

	* semantics.c (finish_compound_literal): Accept C++23 auto{x}.
	* typeck2.c (build_functional_cast_1): Accept C++23 auto(x).

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/auto25.C: Adjust dg-error.
	* g++.dg/cpp0x/auto9.C: Likewise.
	* g++.dg/cpp2a/concepts-pr84979-2.C: Likewise.
	* g++.dg/cpp2a/concepts-pr84979-3.C: Likewise.
	* g++.dg/cpp23/auto-fncast1.C: New test.
	* g++.dg/cpp23/auto-fncast2.C: New test.
	* g++.dg/cpp23/auto-fncast3.C: New test.
	* g++.dg/cpp23/auto-fncast4.C: New test.
	* g++.dg/cpp23/auto-fncast5.C: New test.
	* g++.dg/cpp23/auto-fncast6.C: New test.
2021-11-18 18:00:08 -05:00
David Edelsohn
6f4ac4f81f Fix rs6000 predicates.md use of decl_replaceable_p
gcc/ChangeLog:

	* config/rs6000/predicates.md (current_file_function_operand):
	Add flag_semantic_interposition to call of decl_replaceable_p.
2021-11-18 13:46:32 -05:00
Harald Anlauf
3535be6c6f Fortran: NULL() is not interoperable
gcc/fortran/ChangeLog:

	PR fortran/101329
	* check.c (is_c_interoperable): Reject NULL() as it is not
	interoperable.

gcc/testsuite/ChangeLog:

	PR fortran/101329
	* gfortran.dg/pr101329.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
2021-11-18 19:35:43 +01:00
Martin Liska
22c242342e IPA: fix reproducibility in IPA MOD REF
gcc/ChangeLog:

	* ipa-modref.c (analyze_function): Do not execute the code
	only if dump_file != NULL.
2021-11-18 19:34:13 +01:00
Martin Liska
616ca1024a IPA: use cgraph_node instance
gcc/ChangeLog:

	* ipa-modref.c (analyze_function): Use fnode instead of repeated
	cgraph_node::get (current_function_decl).
2021-11-18 19:34:11 +01:00
Patrick Palka
53c964ad99 c++: error recovery during C++20 template-id ADL failure
When diagnosing ADL failure we try to perform a second unqualified
lookup for backwards compatibility with legacy code (via -fpermissive),
and for better diagnostics.

But for C++20 template-id ADL, the backwards compatibility code
sometimes causes confusing subsequent diagnostics such as in the
testcase below where we end up diagnosing deduction failure after
emitting the helpful "no declarations were found by ADL".  This happens
because the code just discards the arguments of the template-id callee
when replacing it with the later-declared template, which leads to
overload resolution failure:

  <stdin>: In instantiation of ‘void f() [with T = int]’:
  <stdin>:12:22:   required from here
  <stdin>:5:9: error: ‘g’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
  <stdin>:10:6: note: ‘template<class T> void g(int)’ declared here, later in the translation unit
  <stdin>:5:9: error: no matching function for call to ‘g(int)’
  <stdin>:10:6: note: candidate: ‘template<class T> void g(int)’
  <stdin>:10:6: note:   template argument deduction/substitution failed:
  <stdin>:5:9: note:   couldn’t deduce template parameter ‘T’

So for C++20 template-id ADL, this patch disables the backwards
compatibility code while keeping the helpful "no declarations were
found by ADL" diagnostic.

gcc/cp/ChangeLog:

	* pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Disable the
	-fpermissive fallback for C++20 template-id ADL, but keep the
	diagnostic.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/fn-template25.C: New test.
2021-11-18 13:10:28 -05:00
Jan Hubicka
75ac95f664 Turn -fsemantic-interposition to optimization flag
Turn flag_semantic_interposition to optimization option so it can be enabled
with per-function granuality.  This is done by adding the flag among visibility
flags into the symbol table.

gcc/ChangeLog:

2021-11-18  Jan Hubicka  <hubicka@ucw.cz>

	* cgraph.c (cgraph_node::get_availability): Update call of
	decl_replaceable_p.
	(cgraph_node::verify_node): Verify that semantic_interposition flag
	is set correclty.
	* cgraph.h: (symtab_node): Add semantic_interposition flag.
	* cgraphclones.c (set_new_clone_decl_and_node_flags): Clear
	semantic_interposition flag.
	* cgraphunit.c (cgraph_node::finalize_function): Set
	semantic_interposition flag.
	(cgraph_node::add_new_function): Likewise.
	(varpool_node::finalize_decl): Likewise.
	(cgraph_node::create_wrapper): Likewise.
	* common.opt (fsemantic-interposition): Turn to optimization node.
	* lto-cgraph.c (lto_output_node): Stream semantic_interposition.
	(lto_output_varpool_node): Likewise.
	(input_overwrite_node): Likewise.
	(input_varpool_node): Likewise.
	* symtab.c (symtab_node::dump_base): Dump new flag.
	* varasm.c (decl_replaceable_p): Add semantic_interposition_p
	parameter.
	* varasm.h (decl_replaceable_p): Update declaration.
	* varpool.c (varpool_node::ctor_useable_for_folding_p):
	Use semantic_interposition flag.
	(varpool_node::get_availability): Likewise.
	(varpool_node::create_alias): Copy semantic_interposition flag.

gcc/cp/ChangeLog:

2021-11-18  Jan Hubicka  <hubicka@ucw.cz>

	* decl.c (finish_function): Update use of decl_replaceable_p.

gcc/lto/ChangeLog:

2021-11-18  Jan Hubicka  <hubicka@ucw.cz>

	* lto-partition.c (promote_symbol): Clear semantic_interposition flag.

gcc/testsuite/ChangeLog:

2021-11-18  Jan Hubicka  <hubicka@ucw.cz>

	* gcc.dg/lto/semantic-interposition-1_0.c: New test.
	* gcc.dg/lto/semantic-interposition-1_1.c: New test.
2021-11-18 18:42:35 +01:00
Jan Hubicka
c331a75d49 Fix modref wrt __builtin_assume_aligned
__builtin_assume_aligned has bit contraictionary fnspec description "1cX "
which means that parameter 1 is returned but also unused.  PTA code takes
precedence to parameter being returned, while modref takes the info that
parameter is unused.  This patch tweaks modref to follow PTA semantics (as
suggested by Richard in the PR log)

gcc/ChangeLog:

2021-11-18  Jan Hubicka  <hubicka@ucw.cz>

	PR ipa/103266
	* ipa-modref.c (modref_eaf_analysis::merge_call_lhs_flags): Unused
	parameter may still be returned.
	(modref_eaf_analysis::analyze_ssa_name): Call merge_call_lhs_flags
	even for unused function args.

gcc/testsuite/ChangeLog:

2021-11-18  Jan Hubicka  <hubicka@ucw.cz>

	PR ipa/103266
	* g++.dg/torture/pr103266.C: New test.
2021-11-18 18:41:43 +01:00
Tamar Christina
4f0a2f5a3d middle-end: check that both sides of complex expression is a mul.
Both sides of the VEC_PERM_EXPR need to be a MULT but the check
was accidentally checking if both sides are a mul.

The FMS case would be handled by the validate_multiplication but
this makes the requirement more explicit and we exit earlier.

gcc/ChangeLog:

	PR tree-optimization/103311
	* tree-vect-slp-patterns.c (complex_mul_pattern::matches,
	complex_fms_pattern::matches): Check for multiplications.

gcc/testsuite/ChangeLog:

	PR tree-optimization/103311
	* gcc.target/aarch64/pr103311.c: New test.
2021-11-18 17:12:21 +00:00
H.J. Lu
2196a681d7 x86: Add -mindirect-branch-cs-prefix
Add -mindirect-branch-cs-prefix to add CS prefix to call and jmp to
indirect thunk with branch target in r8-r15 registers so that the call
and jmp instruction length is 6 bytes to allow them to be replaced with
"lfence; call *%r8-r15" or "lfence; jmp *%r8-r15" at run-time.

gcc/

	PR target/102952
	* config/i386/i386.c (ix86_output_jmp_thunk_or_indirect): Emit
	CS prefix for -mindirect-branch-cs-prefix.
	(ix86_output_indirect_branch_via_reg): Likewise.
	* config/i386/i386.opt: Add -mindirect-branch-cs-prefix.
	* doc/invoke.texi: Document -mindirect-branch-cs-prefix.

gcc/testsuite/

	PR target/102952
	* gcc.target/i386/indirect-thunk-cs-prefix-1.c: New test.
	* gcc.target/i386/indirect-thunk-cs-prefix-2.c: Likewise.
2021-11-18 08:25:11 -08:00
Jonathan Wakely
ca243ada71 libstdc++: Fix std::char_traits<C>::move for constexpr
The constexpr branch in __gnu_cxx::char_traits::move compares the string
arguments to see if they overlap, but relational comparisons between
unrelated pointers are not core constant expressions.

I want to replace the comparisons with a loop using pointer equality to
determine whether the end of the source string is in the destination
string. However, that doesn't work with GCC, due to PR c++/89074 so
allocate a temporary buffer instead and copy out into that first, so
that overlapping source and destination don't matter. The allocation
isn't supported by the current Intel icc so use the loop as a fallback.

libstdc++-v3/ChangeLog:

	* include/bits/char_traits.h (__gnu_cxx::char_traits::move):
	Do not compare unrelated pointers during constant evaluation.
	* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
	Improve tests for char_traits::move.
2021-11-18 16:14:15 +00:00
Jeff Law
16fab6d691 Fix MIPS test after recent match.pd changes
gcc/testsuite
	* gcc.target/mips/octeon-bbit-1.c (f3): Add noipa attribute.
2021-11-18 10:47:21 -05:00
David Edelsohn
1b2b930152 Fix typo.
libgomp/ChangeLog:

	* alloc.c (gomp_aligned_alloc): Fix typo.
2021-11-18 10:26:55 -05:00
Patrick Palka
90de06a7b3 c++: template-id ADL and partial instantiation [PR99911]
Here when partially instantiating the call get<U>(T{}) with T=N::A
(for which earlier unqualified name lookup for 'get' found nothing)
the arguments after substitution are no longer dependent but the callee
still is, so perform_koenig_lookup postpones ADL.  But then we go on to
diagnose the unresolved template name anyway, as if ADL was already
performed and failed.

This patch fixes this by avoiding the error path in question when the
template arguments of an unresolved template-id are still dependent,
mirroring the dependence check in perform_koenig_lookup.

	PR c++/99911

gcc/cp/ChangeLog:

	* pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Don't diagnose
	name lookup failure if the arguments to an unresolved template
	name are still dependent.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/fn-template24.C: New test.
2021-11-18 10:05:13 -05:00
Patrick Palka
6fa8e0896c c++: unqual lookup performed twice w/ template-id ADL [PR102670]
Here we're incorrectly performing unqualified lookup of 'adl' again at
substitution time for the call adl<I>(t) (for which name lookup at parse
time found nothing) which causes us to reject the testcase because the
second unqualified lookup finds the later-declared variable template
'adl', leading to confusion.  Fixed thusly.

The testcase concepts-recursive-sat1.C needed to be adjusted to use ADL
proper instead of relying on this incorrect second unqualified lookup.

	PR c++/102670

gcc/cp/ChangeLog:

	* pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When looking
	for an identifier callee in the koenig_p case, also look through
	TEMPLATE_ID_EXPR.  Use tsubst_copy to substitute through the
	template arguments of the template-id.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/concepts-recursive-sat1.C: Adjust to use ADL
	proper.
	* g++.dg/cpp2a/fn-template23.C: New test.
2021-11-18 10:04:27 -05:00
David Edelsohn
e3dbd2e140 aix: detect power10 processor.
For -mcpu=native, GCC needs to detect the processor.  This
patch adds the processor value for Power10.

	Suggested by Kevin Alder.

	* config/rs6000/driver-rs6000.c (detect_processor_aix): Add
	power10.
2021-11-18 09:31:12 -05:00
Jonathan Wakely
9646a3229b libstdc++: Replace AC_CACHE_VAL with AC_CACHE_CHECK
This replaces most uses of AC_CACHE_VAL with AC_CACHE_CHECK, which means
we don't need separate AC_MSG_CHECKING and AC_MSG_RESULT macros.

There are a few trivial bugs fixed as a side effect, where an
AC_MSG_RESULT was printed out even if the actual checks hadn't been
done. That didn't affect the results, only the content of config.log.

libstdc++-v3/ChangeLog:

	* acinclude.m4: Replace AC_CACHE_VAL with AC_CACHE_CHECK.
	* configure: Regenerate.
2021-11-18 13:56:33 +00:00
Tamar Christina
1a0bce98dc middle-end: Fix FMA detection when inspecting gimple which have no LHS.
convert_mult_to_fma assumes that all gimple_assigns have a LHS set.  This
assumption is however not true when an IFN is kept around just for the
side-effects.  In those situations you have just the IFN and lhs will be null.

Since there's no LHS, there also can't be any ADD and such it can't be an FMA
so it's correct to just return early if no LHS.

gcc/ChangeLog:

	PR tree-optimization/103253
	* tree-ssa-math-opts.c (convert_mult_to_fma): Check for LHS.

gcc/testsuite/ChangeLog:

	PR tree-optimization/103253
	* gcc.dg/vect/pr103253.c: New test.
2021-11-18 11:23:45 +00:00
Matthias Kretz
efb7c51024 c-family: Add __builtin_assoc_barrier
New builtin to enable explicit use of PAREN_EXPR in C & C++ code.

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>

gcc/testsuite/ChangeLog:

	* c-c++-common/builtin-assoc-barrier-1.c: New test.

gcc/cp/ChangeLog:

	* constexpr.c (cxx_eval_constant_expression): Handle PAREN_EXPR
	via cxx_eval_constant_expression.
	* cp-objcp-common.c (names_builtin_p): Handle
	RID_BUILTIN_ASSOC_BARRIER.
	* cp-tree.h: Adjust TREE_LANG_FLAG documentation to include
	PAREN_EXPR in REF_PARENTHESIZED_P.
	(REF_PARENTHESIZED_P): Add PAREN_EXPR.
	* parser.c (cp_parser_postfix_expression): Handle
	RID_BUILTIN_ASSOC_BARRIER.
	* pt.c (tsubst_copy_and_build): If the PAREN_EXPR is not a
	parenthesized initializer, build a new PAREN_EXPR.
	* semantics.c (force_paren_expr): Simplify conditionals. Set
	REF_PARENTHESIZED_P on PAREN_EXPR.
	(maybe_undo_parenthesized_ref): Test PAREN_EXPR for
	REF_PARENTHESIZED_P.

gcc/c-family/ChangeLog:

	* c-common.c (c_common_reswords): Add __builtin_assoc_barrier.
	* c-common.h (enum rid): Add RID_BUILTIN_ASSOC_BARRIER.

gcc/c/ChangeLog:

	* c-decl.c (names_builtin_p): Handle RID_BUILTIN_ASSOC_BARRIER.
	* c-parser.c (c_parser_postfix_expression): Likewise.

gcc/ChangeLog:

	* doc/extend.texi: Document __builtin_assoc_barrier.
2021-11-18 11:24:11 +01:00
Jakub Jelinek
edd2249b17 libsanitizer: Fix bootstrap on FreeBSD [PR102675]
Here is an alternative to the patch changing a file imported from
compiler-rt upstream, so that we don't need to cary a local patch for that
particular problem.

2021-11-18  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/102675
	* sanitizer_common/Makefile.am: Use -DUSE_SYSTEM_MD5 in AM_CXXFLAGS
	of sanitizer_platform_limits_freebsd.cpp.
	* sanitizer_common/Makefile.in: Regenerated.
2021-11-18 10:08:03 +01:00
Martin Liska
206b22d021 Remove MAY_HAVE_DEBUG_MARKER_STMTS and MAY_HAVE_DEBUG_BIND_STMTS.
The macros correspond 1:1 to an option flags and make it harder
to find all usages of the flags.

gcc/c-family/ChangeLog:

	* c-gimplify.c (genericize_c_loop): Use option directly.

gcc/c/ChangeLog:

	* c-parser.c (add_debug_begin_stmt): Use option directly.

gcc/ChangeLog:

	* cfgexpand.c (pass_expand::execute): Use option directly.
	* function.c (allocate_struct_function): Likewise.
	* gimple-low.c (lower_function_body): Likewise.
	(lower_stmt): Likewise.
	* gimple-ssa-backprop.c (backprop::prepare_change): Likewise.
	* ipa-param-manipulation.c (ipa_param_adjustments::modify_call): Likewise.
	* ipa-split.c (split_function): Likewise.
	* lto-streamer-in.c (input_function): Likewise.
	* sese.c (sese_insert_phis_for_liveouts): Likewise.
	* ssa-iterators.h (num_imm_uses): Likewise.
	* tree-cfg.c (make_blocks): Likewise.
	(gimple_merge_blocks): Likewise.
	* tree-inline.c (tree_function_versioning): Likewise.
	* tree-loop-distribution.c (generate_loops_for_partition): Likewise.
	* tree-sra.c (analyze_access_subtree): Likewise.
	* tree-ssa-dce.c (remove_dead_stmt): Likewise.
	* tree-ssa-loop-ivopts.c (remove_unused_ivs): Likewise.
	* tree-ssa-phiopt.c (spaceship_replacement): Likewise.
	* tree-ssa-reassoc.c (reassoc_remove_stmt): Likewise.
	* tree-ssa-tail-merge.c (tail_merge_optimize): Likewise.
	* tree-ssa-threadedge.c (propagate_threaded_block_debug_into): Likewise.
	* tree-ssa.c (gimple_replace_ssa_lhs): Likewise.
	(target_for_debug_bind): Likewise.
	(insert_debug_temp_for_var_def): Likewise.
	(insert_debug_temps_for_defs): Likewise.
	(reset_debug_uses): Likewise.
	* tree-ssanames.c (release_ssa_name_fn): Likewise.
	* tree-vect-loop-manip.c (adjust_vec_debug_stmts): Likewise.
	(adjust_debug_stmts): Likewise.
	(adjust_phi_and_debug_stmts): Likewise.
	(vect_do_peeling): Likewise.
	* tree-vect-loop.c (vect_transform_loop_stmt): Likewise.
	(vect_transform_loop): Likewise.
	* tree.h (MAY_HAVE_DEBUG_MARKER_STMTS): Remove
	(MAY_HAVE_DEBUG_BIND_STMTS): Remove.
	(MAY_HAVE_DEBUG_STMTS): Use options directly.

gcc/cp/ChangeLog:

	* parser.c (add_debug_begin_stmt): Use option directly.
2021-11-18 10:06:41 +01:00
Richard Biener
e28afbb90f testsuite/103278 - adjust gcc.dg/tree-ssa/if-to-switch-3.c
Analysis shows that after the CD-DCE change we produce better
code which makes if-to-switch run into case-values-threshold on
some architectures, thus the switch is deemed to simple to be
worth generating.  The following statically provides
--param case-values-threshold to make the testcase less
target dependent.

2021-11-18  Richard Biener  <rguenther@suse.de>

	PR testsuite/103278
	* gcc.dg/tree-ssa/if-to-switch-3.c: Supply
	--param case-values-threshold=4.
2021-11-18 10:02:17 +01:00
Richard Biener
8f9f5101d5 tree-optimization/103277 - do abnormal cleanup after call DSE
We can now DSE calls in more cases which requires us to eventually
purge dead abnormal edges.  This implements this.

2021-11-18  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/103277
	* tree-ssa-dse.c (need_ab_cleanup): New.
	(dse_optimize_redundant_stores): Adjust.
	(delete_dead_or_redundant_assignment): Get extra
	need_ab_cleanup argument and set when abnormal cleanup is
	needed.
	(dse_optimize_call): Adjust.
	(dse_optimize_stmt): Likewise.
	(pass_dse::execute): Allocate and deallocate need_ab_cleanup.
	Perform abnormal cleanup.
	* tree-ssa-dse.h (delete_dead_or_redundant_assignment): Adjust.

	* gcc.dg/pr103277.c: New testcase.
2021-11-18 10:02:17 +01:00
Hongyu Wang
15f5e70cbb i386: Fix wrong codegen for -mrelax-cmpxchg-loop
For -mrelax-cmpxchg-loop introduced by PR 103069/r12-5265, it would
produce infinite loop. The correct code should be

.L84:
        movl    (%rdi), %ecx
        movl    %eax, %edx
        orl     %esi, %edx
        cmpl    %eax, %ecx
        jne     .L82
        lock cmpxchgl   %edx, (%rdi)
        jne     .L84
	movl    %r8d, %eax  <<< retval is missing in previous impl
	ret
.L82:
        rep nop
        jmp     .L84

Adjust corresponding expander to fix such issue, and fix runtime test
so the problem would be exposed.

gcc/ChangeLog:

	* config/i386/i386-expand.c (ix86_expand_atomic_fetch_op_loop):
	Adjust generated cfg to avoid infinite loop.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr103069-2.c: Adjust.
2021-11-18 16:29:19 +08:00
Jakub Jelinek
17da2c7425 libgomp: Ensure that either gomp_team is properly aligned [PR102838]
struct gomp_team has struct gomp_work_share array inside of it.
If that latter structure has 64-byte aligned member in the middle,
the whole struct gomp_team needs to be 64-byte aligned, but we weren't
allocating it using gomp_aligned_alloc.

This patch fixes that, except that on gcn team_malloc is special, so
I've instead decided at least for now to avoid using aligned member
and use the padding instead on gcn.

2021-11-18  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/102838
	* libgomp.h (GOMP_USE_ALIGNED_WORK_SHARES): Define if
	GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC is defined and __AMDGCN__ is not.
	(struct gomp_work_share): Use GOMP_USE_ALIGNED_WORK_SHARES instead of
	GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC.
	* work.c (alloc_work_share, gomp_work_share_start): Likewise.
	* team.c (gomp_new_team): If GOMP_USE_ALIGNED_WORK_SHARES, use
	gomp_aligned_alloc instead of team_malloc.
2021-11-18 09:10:40 +01:00
Jakub Jelinek
7a2aa63fad libgomp: Fix up aligned_alloc arguments [PR102838]
C says that aligned_alloc size must be an integral multiple of alignment.
While glibc doesn't care about it, apparently Solaris does.
So, this patch decreases the priority of aligned_alloc among the other
variants because it needs more work and can waste more memory and rounds
up the size to multiple of alignment.

2021-11-18  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/102838
	* alloc.c (gomp_aligned_alloc): Prefer _aligned_alloc over
	memalign over posix_memalign over aligned_alloc over fallback
	with malloc instead of aligned_alloc over _aligned_alloc over
	posix_memalign over memalign over fallback with malloc.  For
	aligned_alloc, round up size up to multiple of al.
2021-11-18 09:07:31 +01:00
konglin1
a72b7a455c i386: add alias for f*mul_*ch intrinsics
gcc/ChangeLog:

	* config/i386/avx512fp16intrin.h (_mm512_mul_pch): Add alias for _mm512_fmul_pch.
	(_mm512_mask_mul_pch): Likewise.
	(_mm512_maskz_mul_pch): Likewise.
	(_mm512_mul_round_pch): Likewise.
	(_mm512_mask_mul_round_pch): Likewise.
	(_mm512_maskz_mul_round_pch): Likewise.
	(_mm512_cmul_pch): Likewise.
	(_mm512_mask_cmul_pch): Likewise.
	(_mm512_maskz_cmul_pch): Likewise.
	(_mm512_cmul_round_pch): Likewise.
	(_mm512_mask_cmul_round_pch): Likewise.
	(_mm512_maskz_cmul_round_pch): Likewise.
	(_mm_mul_sch): Likewise.
	(_mm_mask_mul_sch): Likewise.
	(_mm_maskz_mul_sch): Likewise.
	(_mm_mul_round_sch): Likewise.
	(_mm_mask_mul_round_sch): Likewise.
	(_mm_maskz_mul_round_sch): Likewise.
	(_mm_cmul_sch): Likewise.
	(_mm_mask_cmul_sch): Likewise.
	(_mm_maskz_cmul_sch): Likewise.
	(_mm_cmul_round_sch): Likewise.
	(_mm_mask_cmul_round_sch): Likewise.
	(_mm_maskz_cmul_round_sch): Likewise.
	* config/i386/avx512fp16vlintrin.h (_mm_mul_pch): Likewise.
	(_mm_mask_mul_pch): Likewise.
	(_mm_maskz_mul_pch): Likewise.
	(_mm256_mul_pch): Likewise.
	(_mm256_mask_mul_pch): Likewise.
	(_mm256_maskz_mul_pch): Likewise.
	(_mm_cmul_pch): Likewise.
	(_mm_mask_cmul_pch): Likewise.
	(_mm_maskz_cmul_pch): Likewise.
	(_mm256_cmul_pch): Likewise.
	(_mm256_mask_cmul_pch): Likewise.
	(_mm256_maskz_cmul_pch): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx512fp16-vfcmulcph-1a.c: Add new test for alias.
	* gcc.target/i386/avx512fp16-vfcmulcsh-1a.c: Likewise.
	* gcc.target/i386/avx512fp16-vfmulcph-1a.c: Likewise.
	* gcc.target/i386/avx512fp16-vfmulcsh-1a.c: Likewise.
	* gcc.target/i386/avx512fp16vl-vfcmulcph-1a.c: Likewise.
	* gcc.target/i386/avx512fp16vl-vfmulcph-1a.c: Likewise.
2021-11-18 10:58:38 +08:00
GCC Administrator
280d2838c1 Daily bump. 2021-11-18 00:16:34 +00:00
Andrew Pinski
3222135700 Fix PR tree-optimization/103228 and 103228: folding of (type) X op CST where type is a nop convert
Currently we fold (type) X op CST into (type) (X op ((type-x) CST)) when the conversion widens
but not when the conversion is a nop. For the same reason why we move the widening conversion
(the possibility of removing an extra conversion), we should do the same if the conversion is a
nop.

Committed as approved with the comment change.

	PR tree-optimization/103228
	PR tree-optimization/55177

gcc/ChangeLog:

	* match.pd ((type) X bitop CST): Also do this
	transformation for nop conversions.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/pr103228-1.c: New test.
	* gcc.dg/tree-ssa/pr55177-1.c: New test.
2021-11-17 23:39:48 +00:00
Jonathan Wakely
0e4a8656e8 libstdc++: Fix author name in ChangeLog
The constexpr std::string commit was my own work, but the commit still
had the author name from an earlier cherry-pick that eventually got
entirely reverted. This fixes the name in the ChangeLog file.
2021-11-17 22:41:49 +00:00
David Malcolm
bef32d4a28 libcpp: capture and underline ranges in -Wbidi-chars= [PR103026]
This patch converts the bidi::vec to use a struct so that we can
capture location_t values for the bidirectional control characters.

Before:

  Wbidi-chars-1.c: In function ‘main’:
  Wbidi-chars-1.c:6:43: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
      6 |     /*<U+202E> } <U+2066>if (isAdmin)<U+2069> <U+2066> begin admins only */
        |                                                                           ^
  Wbidi-chars-1.c:9:28: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
      9 |     /* end admins only <U+202E> { <U+2066>*/
        |                                            ^

After:

  Wbidi-chars-1.c: In function ‘main’:
  Wbidi-chars-1.c:6:43: warning: unpaired UTF-8 bidirectional control characters detected [-Wbidi-chars=]
      6 |     /*<U+202E> } <U+2066>if (isAdmin)<U+2069> <U+2066> begin admins only */
        |       ~~~~~~~~                                ~~~~~~~~                    ^
        |       |                                       |                           |
        |       |                                       |                           end of bidirectional context
        |       U+202E (RIGHT-TO-LEFT OVERRIDE)         U+2066 (LEFT-TO-RIGHT ISOLATE)
  Wbidi-chars-1.c:9:28: warning: unpaired UTF-8 bidirectional control characters detected [-Wbidi-chars=]
      9 |     /* end admins only <U+202E> { <U+2066>*/
        |                        ~~~~~~~~   ~~~~~~~~ ^
        |                        |          |        |
        |                        |          |        end of bidirectional context
        |                        |          U+2066 (LEFT-TO-RIGHT ISOLATE)
        |                        U+202E (RIGHT-TO-LEFT OVERRIDE)

Signed-off-by: David Malcolm <dmalcolm@redhat.com>

gcc/testsuite/ChangeLog:
	PR preprocessor/103026
	* c-c++-common/Wbidi-chars-ranges.c: New test.

libcpp/ChangeLog:
	PR preprocessor/103026
	* lex.c (struct bidi::context): New.
	(bidi::vec): Convert to a vec of context rather than unsigned
	char.
	(bidi::ctx_at): Rename to...
	(bidi::pop_kind_at): ...this and reimplement for above change.
	(bidi::current_ctx): Update for change to vec.
	(bidi::current_ctx_ucn_p): Likewise.
	(bidi::current_ctx_loc): New.
	(bidi::on_char): Update for usage of context struct.  Add "loc"
	param and pass it when pushing contexts.
	(get_location_for_byte_range_in_cur_line): New.
	(get_bidi_utf8): Rename to...
	(get_bidi_utf8_1): ...this, reintroducing...
	(get_bidi_utf8): ...as a wrapper, setting *OUT when the result is
	not NONE.
	(get_bidi_ucn): Rename to...
	(get_bidi_ucn_1): ...this, reintroducing...
	(get_bidi_ucn): ...as a wrapper, setting *OUT when the result is
	not NONE.
	(class unpaired_bidi_rich_location): New.
	(maybe_warn_bidi_on_close): Use unpaired_bidi_rich_location when
	reporting on unpaired bidi chars.  Split into singular vs plural
	spellings.
	(maybe_warn_bidi_on_char): Pass in a location_t rather than a
	const uchar * and use it when emitting warnings, and when calling
	bidi::on_char.
	(_cpp_skip_block_comment): Capture location when kind is not NONE
	and pass it to maybe_warn_bidi_on_char.
	(skip_line_comment): Likewise.
	(forms_identifier_p): Likewise.
	(lex_raw_string): Likewise.
	(lex_string): Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2021-11-17 17:34:12 -05:00
David Malcolm
1a7f2c0774 libcpp: escape non-ASCII source bytes in -Wbidi-chars= [PR103026]
This flags rich_locations associated with -Wbidi-chars= so that
non-ASCII bytes will be escaped when printing the source lines
(using the diagnostics support I added in
r12-4825-gbd5e882cf6e0def3dd1bc106075d59a303fe0d1e).

In particular, this ensures that the printed source lines will
be pure ASCII, and thus the visual ordering of the characters
will be the same as the logical ordering.

Before:

  Wbidi-chars-1.c: In function ‘main’:
  Wbidi-chars-1.c:6:43: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
      6 |     /*‮ } ⁦if (isAdmin)⁩ ⁦ begin admins only */
        |                                           ^
  Wbidi-chars-1.c:9:28: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
      9 |     /* end admins only ‮ { ⁦*/
        |                            ^

  Wbidi-chars-11.c:6:15: warning: UTF-8 vs UCN mismatch when closing a context by "U+202C (POP DIRECTIONAL FORMATTING)" [-Wbidi-chars=]
      6 | int LRE_‪_PDF_\u202c;
        |               ^
  Wbidi-chars-11.c:8:19: warning: UTF-8 vs UCN mismatch when closing a context by "U+202C (POP DIRECTIONAL FORMATTING)" [-Wbidi-chars=]
      8 | int LRE_\u202a_PDF_‬_;
        |                   ^
  Wbidi-chars-11.c:10:28: warning: UTF-8 vs UCN mismatch when closing a context by "U+202C (POP DIRECTIONAL FORMATTING)" [-Wbidi-chars=]
     10 | const char *s1 = "LRE_‪_PDF_\u202c";
        |                            ^
  Wbidi-chars-11.c:12:33: warning: UTF-8 vs UCN mismatch when closing a context by "U+202C (POP DIRECTIONAL FORMATTING)" [-Wbidi-chars=]
     12 | const char *s2 = "LRE_\u202a_PDF_‬";
        |                                 ^

After:

  Wbidi-chars-1.c: In function ‘main’:
  Wbidi-chars-1.c:6:43: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
      6 |     /*<U+202E> } <U+2066>if (isAdmin)<U+2069> <U+2066> begin admins only */
        |                                                                           ^
  Wbidi-chars-1.c:9:28: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
      9 |     /* end admins only <U+202E> { <U+2066>*/
        |                                            ^

  Wbidi-chars-11.c:6:15: warning: UTF-8 vs UCN mismatch when closing a context by "U+202C (POP DIRECTIONAL FORMATTING)" [-Wbidi-chars=]
      6 | int LRE_<U+202A>_PDF_\u202c;
        |                       ^
  Wbidi-chars-11.c:8:19: warning: UTF-8 vs UCN mismatch when closing a context by "U+202C (POP DIRECTIONAL FORMATTING)" [-Wbidi-chars=]
      8 | int LRE_\u202a_PDF_<U+202C>_;
        |                   ^
  Wbidi-chars-11.c:10:28: warning: UTF-8 vs UCN mismatch when closing a context by "U+202C (POP DIRECTIONAL FORMATTING)" [-Wbidi-chars=]
     10 | const char *s1 = "LRE_<U+202A>_PDF_\u202c";
        |                                    ^
  Wbidi-chars-11.c:12:33: warning: UTF-8 vs UCN mismatch when closing a context by "U+202C (POP DIRECTIONAL FORMATTING)" [-Wbidi-chars=]
     12 | const char *s2 = "LRE_\u202a_PDF_<U+202C>";
        |                                 ^

libcpp/ChangeLog:
	PR preprocessor/103026
	* lex.c (maybe_warn_bidi_on_close): Use a rich_location
	and call set_escape_on_output (true) on it.
	(maybe_warn_bidi_on_char): Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2021-11-17 17:32:30 -05:00
Martin Sebor
ea9e0d6c27 Avoid pathological function redeclarations when checking access sizes [PR102759].
Resolves:
PR tree-optimization/102759 - ICE: Segmentation fault in maybe_check_access_sizes since r12-2976-gb48d4e6818674898

gcc/ChangeLog:

	PR tree-optimization/102759
	* gimple-array-bounds.cc (build_printable_array_type): Move...
	* gimple-ssa-warn-access.cc (build_printable_array_type): Avoid
	pathological function redeclarations that remove a previously
	declared prototype.
	Improve formatting of function arguments in informational notes.
	* pointer-query.cc (build_printable_array_type): ...to here.
	* pointer-query.h (build_printable_array_type): Declared.

gcc/testsuite/ChangeLog:

	PR tree-optimization/102759
	* gcc.dg/Warray-parameter-10.c: New test.
	* gcc.dg/Wstringop-overflow-82.c: New test.
2021-11-17 15:09:23 -07:00
H.J. Lu
53a643f856 x86: Add -mharden-sls=[none|all|return|indirect-branch]
Add -mharden-sls= to mitigate against straight line speculation (SLS)
for function return and indirect branch by adding an INT3 instruction
after function return and indirect branch.

gcc/

	PR target/102952
	* config/i386/i386-opts.h (harden_sls): New enum.
	* config/i386/i386.c (output_indirect_thunk): Mitigate against
	SLS for function return.
	(ix86_output_function_return): Likewise.
	(ix86_output_jmp_thunk_or_indirect): Mitigate against indirect
	branch.
	(ix86_output_indirect_jmp): Likewise.
	(ix86_output_call_insn): Likewise.
	* config/i386/i386.opt: Add -mharden-sls=.
	* doc/invoke.texi: Document -mharden-sls=.

gcc/testsuite/

	PR target/102952
	* gcc.target/i386/harden-sls-1.c: New test.
	* gcc.target/i386/harden-sls-2.c: Likewise.
	* gcc.target/i386/harden-sls-3.c: Likewise.
	* gcc.target/i386/harden-sls-4.c: Likewise.
	* gcc.target/i386/harden-sls-5.c: Likewise.
2021-11-17 13:35:31 -08:00
H.J. Lu
8e410de43c x86: Remove "%!" before ret
Before MPX was removed, "%!" was mapped to

        case '!':
          if (ix86_bnd_prefixed_insn_p (current_output_insn))
            fputs ("bnd ", file);
          return;

After CET was added and MPX was removed, "%!" was mapped to

       case '!':
          if (ix86_notrack_prefixed_insn_p (current_output_insn))
            fputs ("notrack ", file);
          return;

ix86_notrack_prefixed_insn_p always returns false on ret since the
notrack prefix is only for indirect branches.  Remove the unused "%!"
before ret.

	PR target/103307
	* config/i386/i386.c (ix86_code_end): Remove "%!" before ret.
	(ix86_output_function_return): Likewise.
	* config/i386/i386.md (simple_return_pop_internal): Likewise.
2021-11-17 13:29:01 -08:00
Jan Hubicka
425369bf30 Fix modref summary streaming
Fixes bug in streaming in modref access tree that now cause a failure
of gamess benchmark.  The bug is quite old (present in GCC11 release) but it
needs quite interesting series of events to manifest. In particular
 1) At lto time ISRA turns some parameters passed by reference to scalar
 2) At lto time modref computes summaries for old parameters and then updates
    them but does so quite stupidly believing that the load from parameters
    are now unkonwn loads (rather than optimized out).
    This renders summary not very useful since it thinks every memory aliasing
    int is now accssed (as opposed as parameter dereference)
 3) At stream in we notice too early that summary is useless, set every_access
    flag and drop the list.  However while reading rest of the summary we
    overwrite the flag back to 0 which makes us to lose part of summary.
 4) right selection of partitions needs to be done to avoid late modref from
    recalculating and thus fixing the summary.

This patch fixes the stream in bug, however we also should fix updating of
summaries.

gcc/ChangeLog:

2021-11-17  Jan Hubicka  <hubicka@ucw.cz>

	PR ipa/103246
	* ipa-modref.c (read_modref_records): Fix streaminig in of every_access
	flag.
2021-11-17 22:04:26 +01:00
Uros Bizjak
69a5b3ca5c i386: Redefine indirect_thunks_used as HARD_REG_SET.
Change indirect_thunks_used to HARD_REG_SET to avoid recalculations
of correct register numbers and allow usage of SET/TEST_HARD_REG_BIT
accessors.

2021-11-17  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	* config/i386/i386.c (indirect_thunks_used): Redefine as HARD_REG_SET.
	(ix86_code_end): Use TEST_HARD_REG_BIT on indirect_thunks_used.
	(ix86_output_indirect_branch_via_reg): Use SET_HARD_REG_BIT
	on indirect_thunks_used.
	(ix86_output_indirect_function_return): Ditto.
2021-11-17 20:48:31 +01:00
Jan Hubicka
74509b963e Add very basic IPA part of modref-kill analysis
gcc/ChangeLog:

2021-11-17  Jan Hubicka  <hubicka@ucw.cz>

	* ipa-modref-tree.c: Include cgraph.h and tree-streamer.h.
	(modref_access_node::stream_out): New member function.
	(modref_access_node::stream_in): New member function.
	* ipa-modref-tree.h (modref_access_node::stream_out,
	modref_access_node::stream_in): Declare.
	* ipa-modref.c (modref_summary_lto::useful_p): Free useless kills.
	(modref_summary_lto::dump): Dump kills.
	(analyze_store): Record kills for LTO
	(analyze_stmt): Likewise.
	(modref_summaries_lto::duplicate): Duplicate kills.
	(write_modref_records): Use new stream_out member function.
	(read_modref_records): Likewise.
	(modref_write): Stream out kills.
	(read_section): Stream in kills
	(remap_kills): New function.
	(update_signature): Use it.
2021-11-17 20:40:44 +01:00
Uros Bizjak
ef342b2d99 i386: Introduce LEGACY_SSE_REGNO_P predicate
Introduce LEGACY_SSE_REGNO_P predicate to simplify a couple of places.

No functional changes.

2021-11-17  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	* config/i386/i386.h (LEGACY_SSE_REGNO_P): New predicate.
	(SSE_REGNO_P): Use LEGACY_SSE_REGNO_P predicate.
	* config/i386/i386.c (zero_all_vector_registers):
	Use LEGACY_SSE_REGNO_P predicate.
	(ix86_register_priority): Use REX_INT_REGNO_P, REX_SSE_REGNO_P
	and EXT_REG_SSE_REGNO_P predicates.
	(ix86_hard_regno_call_part_clobbered): Use REX_SSE_REGNO_P
	and LEGACY_SSE_REGNO_P predicates.
2021-11-17 20:33:09 +01:00
Martin Sebor
2c2148d8c1 Handle folded nonconstant array bounds [PR101702]
PR c/101702 - ICE: in handle_argspec_attribute, at c-family/c-attribs.c:3623

gcc/c/ChangeLog:

	PR c/101702
	* c-decl.c (get_parm_array_spec): Strip casts earlier and fold array
	bounds before deciding if they're constant.

gcc/testsuite/ChangeLog:

	PR c/101702
	* gcc.dg/Warray-parameter-11.c: New test.
2021-11-17 11:52:29 -07:00
Jason Merrill
d3a9082d7a doc: document -fimplicit-constexpr
I forgot this in the implementation patch.

gcc/ChangeLog:

	* doc/invoke.texi (C++ Dialect Options): Document
	-fimplicit-constexpr.
2021-11-17 12:45:29 -05:00
Jonathan Wakely
5ea8803e65 libstdc++: Use std::construct_at in net::ip::address
Using placement-new isn't valid in constant expressions, so this
replaces it with std::construct_at (via the std::_Construct function
that is usable before C++20).

libstdc++-v3/ChangeLog:

	* include/experimental/internet (address): Use std::_Construct
	to initialize union members.
2021-11-17 17:28:52 +00:00
Jonathan Wakely
5a9572e486 libstdc++: Simplify std::string constructors
Several std::basic_string constructors dispatch to one of the
two-argument overloads of _M_construct, which then dispatches again to
_M_construct_aux to detect whether the arguments are iterators or not.
That then dispatches to one of _M_construct(size_type, char_type) or
_M_construct(Iter, Iter, iterator_traits<Iter>::iterator_category{}).

For most of those constructors this is a waste of time, because we know
the arguments are already iterators. For basic_string(const CharT*) and
basic_string(initializer_list<C>) we know that we call _M_construct with
two pointers, and for basic_string(const basic_string&) we call it with
two const_iterators.  Those constructors can call the three-argument
overload of _M_construct with the iterator category tag right away,
without the intermediate dispatching.

The case where this doesn't apply is basic_string(InputIter, InputIter),
but for C++11 and later this is constrained so we know it's an iterator
here as well. We can restrict the dispatching in this constructor to
only be done for C++98 and to call _M_construct_aux directly, which
allows us to remove the two-argument _M_construct(InputIter, InputIter)
overload entirely.

N.B. When calling the three-arg _M_construct with pointers or string
iterators, we pass forward_iterator_tag not random_access_iterator_tag.
This is because it makes no difference which overload gets called, and
simplifies overload resolution to not have to do a base-to-derived
check. If we ever add a new overload of M_construct for random access
iterators we would have to revisit this, but that seems unlikely.

This patch also moves the __is_null_pointer checks from the three-arg
_M_construct into the constructors where a null pointer argument is
actually possible. This avoids redundant checks where we know we have a
non-null pointer, or don't have a pointer at all.

Finally, this patch replaces some try-blocks with an RAII type, so that
memory is deallocated during unwinding. This avoids the overhead of
catching and rethrowing an exception.

libstdc++-v3/ChangeLog:

	* include/bits/basic_string.h (_M_construct_aux): Only define
	for C++98. Remove constexpr.
	(_M_construct_aux_2): Likewise.
	(_M_construct(InputIter, InputIter)): Remove.
	(basic_string(const basic_string&)): Call _M_construct with
	iterator category argument.
	(basic_string(const basic_string&, size_type, const Alloc&)):
	Likewise.
	(basic_string(const basic_string&, size_type, size_type)):
	Likewise.
	(basic_string(const charT*, size_type, const Alloc&)): Likewise.
	Check for null pointer.
	(basic_string(const charT*, const Alloc&)): Likewise.
	(basic_string(initializer_list<charT>, const Alloc&)): Call
	_M_construct with iterator category argument.
	(basic_string(const basic_string&, const Alloc&)): Likewise.
	(basic_string(basic_string&&, const Alloc&)): Likewise.
	(basic_string(_InputIter, _InputIter, const Alloc&)): Likewise
	for C++11 and later, call _M_construct_aux for C++98.
	* include/bits/basic_string.tcc
	(_M_construct(I, I, input_iterator_tag)): Replace try-block with
	RAII type.
	(_M_construct(I, I, forward_iterator_tag)): Likewise. Remove
	__is_null_pointer check.
2021-11-17 17:28:44 +00:00
Jonathan Wakely
6afa1083c6 libstdc++: Set active member of union in std::string [PR103295]
Clang diagnoses that the new constexpr std::string constructors are not
usable in constant expressions, because they start to write to members
of the union without setting an active member.

This adds a new helper function which returns the address of the local
buffer after making it the active member.

This doesn't fix all problems with Clang, because it still refuses to
write to memory returned by the allocator.

libstdc++-v3/ChangeLog:

	PR libstdc++/103295
	* include/bits/basic_string.h (_M_use_local_data()): New
	member function to make local buffer the active member.
	(assign(const basic_string&)): Use it.
	* include/bits/basic_string.tcc (_M_construct, reserve()):
	Likewise.
2021-11-17 17:21:25 +00:00
Jonathan Wakely
054bf99841 libstdc++: Fix std::type_info::before for ARM [PR103240]
The r179236 fix for std::type_info::operator== should also have been
applied to std::type_info::before. Otherwise two distinct types can
compare equivalent due to using a string comparison, when they should do
a pointer comparison.

libstdc++-v3/ChangeLog:

	PR libstdc++/103240
	* libsupc++/tinfo2.cc (type_info::before): Use unadjusted name
	to check for the '*' prefix.
	* testsuite/util/testsuite_shared.cc: Add type_info object for
	use in new test.
	* testsuite/18_support/type_info/103240.cc: New test.
2021-11-17 17:21:24 +00:00
Jeff Law
c705464823 Fix two mips target tests compromised by recent IPA work
gcc/testsuite
	* gcc.target/mips/frame-header-1.c (bar): Add noipa attribute.
	* gcc.target/mips/frame-header-2.c (bar): Likewise.
2021-11-17 11:55:50 -05:00
Jakub Jelinek
049f0efeaa libcpp: Fix up handling of block comments in -fdirectives-only mode [PR103130]
Normal preprocessing, -fdirectives-only preprocessing before the Nathan's
rewrite, and all other compilers I've tried on godbolt treat even \*/
as end of a block comment, but the new -fdirectives-only handling doesn't.

2021-11-17  Jakub Jelinek  <jakub@redhat.com>

	PR preprocessor/103130
	* lex.c (cpp_directive_only_process): Treat even \*/ as end of block
	comment.

	* c-c++-common/cpp/dir-only-9.c: New test.
2021-11-17 17:31:40 +01:00