Commit Graph

190734 Commits

Author SHA1 Message Date
Jason Merrill
ad64a82197 c++: don't preevaluate new-initializer
The preevaluation code was causing trouble with my fix for PR94041, and now
I see that it's actually wrong since P0145 was adopted for C++17, mandating
order of evaluation for many expressions that were previously unspecified.
I don't see a need to preserve the preevaluation code for older standard
modes.

gcc/cp/ChangeLog:

	* init.c (build_new_1): Remove preevaluation code.

gcc/testsuite/ChangeLog:

	* g++.old-deja/g++.martin/new1.C: Don't expect preeval.
	* g++.dg/tree-ssa/stabilize1.C: Removed.
2022-01-06 19:22:47 -05:00
GCC Administrator
11ce8d04f2 Daily bump. 2022-01-07 00:16:24 +00:00
David Malcolm
d564a83d14 analyzer: make use of may_be_aliased in alias detection [PR103546]
Whilst debugging PR analyzer/103546 (false +ve in flex-generated lexers)
I noticed that the analyzer was considering that writes through symbolic
pointers could be treated as clobbering static globals such as:

   static YY_BUFFER_STATE * yy_buffer_stack = NULL;

even for such variables that never have their address taken.

This patch fixes this issue at least, so that the analyzer can preserve
knowledge of such globals on code paths with writes through symbolic
pointers.

It does not fix the false +ve in the lexer code.

gcc/analyzer/ChangeLog:
	PR analyzer/103546
	* store.cc (store::eval_alias_1): Refactor handling of decl
	regions, adding a test for may_be_aliased, rejecting those for
	which it returns false.

gcc/testsuite/ChangeLog:
	PR analyzer/103546
	* gcc.dg/analyzer/aliasing-3.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2022-01-06 17:42:05 -05:00
Sandra Loosemore
8e2771069e Fortran: Fix ICE in argument_rank_mismatch [PR103287]
This patch removes an incorrect assertion.  A user-friendly error for this
case is already given elsewhere.

2022-01-05  Steve Kargl  <kargl@gcc.gnu.org>
	    Sandra Loosemore  <sandra@codesourcery.com>

	PR fortran/103287

	gcc/fortran/
	* interface.c (argument_rank_mismatch): Replace incorrect assertion
	with return.

	gcc/testsuite/
	* gfortran.dg/c-interop/pr103287-1.f90: new.
	* gfortran.dg/c-interop/pr103287-2.f90: new.
2022-01-06 12:45:56 -08:00
H.J. Lu
c2e5c4feed x86: Generate INT3 for __builtin_eh_return
Generate INT3 after indirect jmp in exception return for -fcf-protection
with -mharden-sls=indirect-jmp.

gcc/

	PR target/103925
	* config/i386/i386.c (ix86_output_indirect_function_return):
	Generate INT3 after indirect jmp for -mharden-sls=indirect-jmp.

gcc/testsuite/

	PR target/103925
	* gcc.target/i386/harden-sls-6.c: New test.
2022-01-06 11:35:11 -08:00
H.J. Lu
ed8060950c x86: Rename -harden-sls=indirect-branch to -harden-sls=indirect-jmp
Indirect branch also includes indirect call instructions.  Rename
-harden-sls=indirect-branch to -harden-sls=indirect-jmp to match its
intended behavior.

	PR target/102952
	* config/i386/i386-opts.h (harden_sls): Replace
	harden_sls_indirect_branch with harden_sls_indirect_jmp.
	* config/i386/i386.c (ix86_output_jmp_thunk_or_indirect):
	Likewise.
	(ix86_output_indirect_jmp): Likewise.
	(ix86_output_call_insn): Likewise.
	* config/i386/i386.opt: Replace indirect-branch with
	indirect-jmp.  Replace harden_sls_indirect_branch with
	harden_sls_indirect_jmp.
	* doc/invoke.texi (-harden-sls=): Replace indirect-branch with
	indirect-jmp.
2022-01-06 11:35:11 -08:00
Ian Lance Taylor
be129ca481 compiler: permit converting unnamed types when ignoring struct tags
Test case is https://golang.org/cl/375796.

Fixes golang/go#50439

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/375797
2022-01-06 11:24:11 -08:00
Uros Bizjak
0d03db068c i386: Improve HImode interunit moves
Currently, the compiler moves HImode values between GPR and XMM registers with:

	%vpinsrw\t{$0, %k1, %d0|%d0, %k1, 0}
	%vpextrw\t{$0, %1, %k0|%k0, %1, 0}

but it could use slightly faster and shorter:

	%vmovd\t{%k1, %0|%0, %k1}
	%vmovd\t{%1, %k0|%k0, %1}

2022-01-06  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	* config/i386/i386.c (ix86_output_ssemov) <MODE_DI>:
	Add %q modifier for operands in general registers.
	<MODE_SI>: Add %q modifier for operands in general registers.
	* config/i386/i386.md (*movhi_internal): Change type attribute of
	xmm-gpr interunit alternatives 9,10 to ssemov and mode attribute
	to SImode for non-avx512fp16 targets.
	(*movhf_internal): Ditto for xmm-gpr interunit alternatives 6,8.
	* config/i386/mmx.md (*movv2qi_internal):
	Ditto for xmm-gpr interunit alternatives 8,9.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr102811-2.c (dg-final):
	Update scan-assembler-times directives.
	* gcc.target/i386/sse2-float16-2.c (dg-final):
	Update scan-assembler directives.
2022-01-06 20:01:34 +01:00
Bob Duff
2a60c08e98 [Ada] Warn on subtype declaration of null range
gcc/ada/

	* sem_res.adb (Resolve_Range): Warn on null range, unless we are
	inside a generic unit or an instance thereof.
	* sem_ch3.adb (Analyze_Subtype_Indication): Minor: avoid double
	negative.
2022-01-06 17:11:42 +00:00
Piotr Trojanek
1871f2cb3c [Ada] Remove unnecessary declare block
gcc/ada/

	* errout.adb (Adjust_Name_Case): Remove unnecessary declare
	block.
2022-01-06 17:11:41 +00:00
Yannick Moy
42dd6f60d8 [Ada] Proof of System.Generic_Array_Operations at silver level
gcc/ada/

	* libgnat/a-ngcoar.adb: Add pragma to ignore assertions in
	instance.
	* libgnat/a-ngrear.adb: Likewise.
	* libgnat/s-gearop.adb: Prove implementation is free of runtime
	errors.
	* libgnat/s-gearop.ads: Add contracts to protect against runtime
	errors in the generic part.
2022-01-06 17:11:41 +00:00
Piotr Trojanek
d2bc32602c [Ada] Simplify traversal for removing warnings from dead code
gcc/ada/

	* errout.adb (Remove_Warning_Messages): Use traversal procedure
	instead of traversal function, since we discard status of each
	step anyway.
2022-01-06 17:11:41 +00:00
Piotr Trojanek
362c58c423 [Ada] Remove a locally handled exception
gcc/ada/

	* exp_ch4.adb (Expand_Concatenate): There is no reason for using
	declaring, raising and catching an exception; a simple return
	statement is enough.
2022-01-06 17:11:40 +00:00
Piotr Trojanek
a177749242 [Ada] Move messages on division by zero to the right operand
gcc/ada/

	* sem_eval.adb (Eval_Arithmetic_Op): Add Loc parameter to all
	calls to Apply_Compile_Time_Constraint_Error related to division
	by zero.
2022-01-06 17:11:40 +00:00
Piotr Trojanek
a9f0ee1dfc [Ada] Remove unnecessary guards for non-empty lists
gcc/ada/

	* errout.adb (Remove_Warning_Messages): Remove unnecessary guard.
	* exp_util.adb (Kill_Dead_Code): Likewise.
	* par_sco.adb (Traverse_Declarations_Or_Statements): Likewise.
	* sem_ch3.adb (Build_Derived_Record_Type): Likewise.
	* sem_ch4.adb (Traverse_Interfaces): Likewise.
	* sem_eval.adb (Traverse_Interfaces): Likewise.
	* sem_util.adb (Collect_Interfaces): Likewise.
	(Has_Non_Null_Statements, Side_Effect_Free_Statements):
	Likewise; turn into WHILE loops, for consistency.
2022-01-06 17:11:39 +00:00
Etienne Servais
4ca7f4e26d [Ada] Fix typo on compatibility
gcc/ada/

	* sem_type.adb (Full_View_Covers): Fix typo.
2022-01-06 17:11:39 +00:00
Eric Botcazou
b542b2d97f [Ada] Fix regression in freezing code for instantiations
gcc/ada/

	* sem_ch12.adb (Insert_Freeze_Node_For_Instance): When going to
	the outer level, do not jump over following instantiations in
	the list.
2022-01-06 17:11:39 +00:00
Piotr Trojanek
00a66280cd [Ada] Remove unreferenced Warn_On_Instance
gcc/ada/

	* err_vars.ads (Warn_On_Instance): Remove; it was a relic from
	the previous handling of warning in instances that was removed
	decades ago.
2022-01-06 17:11:38 +00:00
Piotr Trojanek
005146582c [Ada] Fix style in comments about warning messages
gcc/ada/

	* errout.adb (Error_Msg_Internal): Reorder words.
	* erroutc.ads (Is_Warning_Msg): Add closing paren.
	* sem_util.adb (Compile_Time_Constraint_Error): Fix casing.
2022-01-06 17:11:38 +00:00
Piotr Trojanek
d763e11c21 [Ada] Simplify type conversions in source pointer arithmetic
gcc/ada/

	* sem_res.adb (Resolve_String_Literal): Simplify pointer
	arithmetic.
2022-01-06 17:11:37 +00:00
Piotr Trojanek
39521d958f [Ada] Refactor repeated implicit conversion from Char_Code to Uint
gcc/ada/

	* sem_res.adb (Resolve_String_Literal): Avoid unnecessary
	conversions inside "<" and ">" bodies.
2022-01-06 17:11:37 +00:00
Piotr Trojanek
cdfdd0de39 [Ada] Fix style in calls to Compile_Time_Constraint_Error
gcc/ada/

	* checks.adb (Null_Exclusion_Static_Checks,
	Selected_Range_Checks): Fix style.
2022-01-06 17:11:37 +00:00
Eric Botcazou
ffbc891aaa [Ada] Fix spurious error on instantiation with Text_IO name
gcc/ada/

	* sem_ch8.adb (Analyze_Package_Renaming): Do not check for Text_IO
	special units when the name of the renaming is a generic instance,
	which is the case for package instantiations in the GNAT model.
2022-01-06 17:11:36 +00:00
Steve Baird
5bad97d744 [Ada] Avoid building malformed component constraints
gcc/ada/

	* sem_util.adb (Build_Discriminant_Reference): In the unexpected
	case where we previously would fail an assertion, we instead
	revert to the old behavior.
2022-01-06 17:11:36 +00:00
Steve Baird
c60f23e13e [Ada] Avoid building malformed component constraints
gcc/ada/

	* sem_util.adb (Build_Actual_Subtype_Of_Component): Define a new
	local function, Build_Discriminant_Reference, and call it in
	each of the three cases where Make_Selected_Component was
	previously being called to construct a discriminant reference (2
	in Build_Actual_Array_Constraint and 1 in
	Build_Actual_Record_Constraint). Instead of unconditionally
	using the passed-in object name as the prefix for the new
	selected component node, this new function checks to see if
	perhaps a prefix of that name should be used instead.
2022-01-06 17:11:36 +00:00
Etienne Servais
41a7b9484a [Ada] Fix typo in comments found running aspell
gcc/ada/

	* atree.adb: Fix typo.
	* einfo.ads: Likewise.
	* exp_aggr.adb: Likewise.
	* exp_ch6.adb: Likewise.
	* exp_ch7.adb: Likewise.
	* exp_ch9.adb: Likewise.
	* exp_prag.adb: Likewise.
	* exp_unst.adb: Likewise.
	* exp_unst.ads: Likewise.
	* exp_util.adb: Likewise.
	* par-endh.adb: Likewise.
	* par.adb: Likewise.
	* restrict.adb: Likewise.
	* sem.ads: Likewise.
	* sem_ch4.adb: Likewise.
	* sem_ch5.adb: Likewise.
	* sem_ch6.adb: Likewise.
	* sem_ch8.adb: Likewise.
	* sem_ch12.adb: Likewise.
	* sem_ch13.adb: Likewise.
	* sem_dim.adb: Likewise.
	* sem_elab.adb: Likewise.
	* sem_prag.adb: Likewise.
	* sem_res.adb: Likewise.
	* sem_util.adb: Likewise.
	* sem_util.ads: Likewise.
	* sinfo.ads: Likewise.
	* sprint.adb: Likewise.
	* urealp.adb: Likewise.
2022-01-06 17:11:35 +00:00
Justin Squirek
1f26ff11b6 [Ada] Spurious error when using current instance of type
gcc/ada/

	* exp_ch3.adb (Build_Assignment): Replace current instance of
	type with Init_Proc formal.
	* sem_attr.adb (OK_Self_Reference): Handle recognition of
	Current_Instance to detect certain expansion.
	* sem_ch4.adb (Analyze_One_Call): Set actual's type when the
	actual in question is a current instance and its corresponding
	formal is an incomplete type.
	* sem_util.adb (Is_Current_Instance): Add check for incomplete
	views and add comment.
2022-01-06 17:11:34 +00:00
Bob Duff
0590ed7248 [Ada] New restriction No_Tagged_Type_Registration
gcc/ada/

	* libgnat/s-rident.ads (No_Tagged_Type_Registration): New
	restriction identifier.
	* restrict.ads (Implementation_Restriction): Add restriction.
	* exp_ch7.adb (Process_Declarations): Suppress
	tagged-type-related finalization actions if the restriction is
	active.  Call RTE_Available last.
	* exp_disp.adb (Make_DT): Likewise.
	* exp_util.adb (Requires_Cleanup_Actions): Return False for a
	tagged type declaration if No_Tagged_Type_Registration is
	active.
	* sem_attr.adb (Check_Stream_Attribute): Check restriction
	No_Tagged_Type_Registration.
	* libgnat/a-except.ads (Null_Occurrence): Minor: Initialize, to
	avoid stopping at a warning in gdb.
	* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
	Document new restriction.
	* gnat_rm.texi: Regenerate.
2022-01-06 17:11:34 +00:00
Piotr Trojanek
337417795a [Ada] Remove duplicates of empty strings
gcc/ada/

	* par-ch4.adb (P_Simple_Expression): Reuse Null_String_Id.
	* prep.adb (Parse_Def_File): Likewise; remove Empty_String.
2022-01-06 17:11:33 +00:00
Eric Botcazou
7f08c07599 [Ada] Rename Any_Access into Universal_Access
gcc/ada/

	* stand.ads (Any_Access): Delete.
	(Universal_Access): New entity.
	* einfo.ads: Remove obsolete reference to Any_Access.
	* gen_il-gen-gen_entities.adb: Likewise.
	* cstand.adb (Create_Standard): Do not create Any_Access and create
	Universal_Access as a full type instead.
	* errout.adb (Set_Msg_Insertion_Type_Reference): Do not deal with
	Any_Access and deal with Universal_Access instead.
	* sem_ch3.adb (Analyze_Object_Declaration): Replace Any_Access with
	Universal_Access.
	* sem_ch4.adb (Analyze_Null): Likewise.
	(Find_Non_Universal_Interpretations): Likewise.
	(Find_Equality_Types.Try_One_Interp): Likewise and avoid shadowing
	by renaming a local variable of the same name.
	* sem_res.adb (Make_Call_Into_Operato): Likewise.
	(Resolve_Equality_Op): Likewise.
	* sem_type.adb (Covers): Likewise.
	(Specific_Type): Likewise.
2022-01-06 17:11:33 +00:00
Piotr Trojanek
f64a1bfadd [Ada] Suppress spurious CodePeer check on generic actual subprogram
gcc/ada/

	* treepr.adb (Destroy): Prevent spurious check from CodePeer.
2022-01-06 17:11:32 +00:00
Yannick Moy
4e5e43e8ca [Ada] Justify false positive message from CodePeer analysis of GNAT
gcc/ada/

	* libgnat/s-exponu.adb (Exponu): Add annotation.
2022-01-06 17:11:32 +00:00
Justin Squirek
4458909a80 [Ada] Removal of technical debt
gcc/ada/

	* exp_ch6.adb (Add_Simple_Call_By_Copy_Code): Add comments
	regarding special handling of components which depend on
	discriminants.
	* exp_dist.adb (Build_From_Any_Function): Add Real_Rep actual
	for calls to Has_Stream_Attribute_Definition.
	(Build_To_Any_Function): Likewise.
	(Build_TypeCode_Function): Likewise.
	* freeze.adb (Freeze_Entity): Add missing comment for Test_E.
	* libgnat/s-utf_32.adb: Remove disabled warning comments and
	temporarily inserted pragma warnings.  Remove very old (2006 and
	2012) comments about bootstrapping older versions.
	* par.adb (P_Identifier): Add new parameter Force_Msg.
	* par-ch2.adb (P_Identifier): Restructure and clean up function.
	* par-ch3.adb (P_Defining_Identifier): Remove code duplication
	for parsing identifiers.
	* sem_attr.adb (Stream_Attribute_Available): Add missing
	comments and add Real_Rep actual for calls to
	Has_Stream_Attribute_Definition.
	* sem_cat.adb (Has_Read_Write_Attribute): Add Real_Rep actual
	for calls to Has_Stream_Attribute_Definition.
	(Has_Stream_Attribute_Definition): Remove local Real_Rep and fix
	recursive calls. Add default value for Real_Rep.
	* sem_cat.ads (Has_Stream_Attribute_Definition): Add new out
	parameter "Real_Rep".
	* sem_type.adb (Add_Entry): Add condition to avoid passing
	non-function calls to Function_Interp_Has_Abstract_Op.
	(Function_Interp_Has_Abstract_Op): Add missing comments and
	remove check for Is_Overloadable.
	* sem_util.adb (Derivation_Too_Early_To_Inherit): Remove
	duplicated code.
2022-01-06 17:11:32 +00:00
Javier Miranda
bfbb8de660 [Ada] Crash in class-wide pre/postconditions
gcc/ada/

	* contracts.adb (Restore_Original_Selected_Component): New
	subprogram that traverses a preanalyzed expression searching for
	dispatching calls to functions whose original node was a
	selected component, and replacing them with their original node.
	This functionality is required because the preanalyis of
	dispatching calls using the Object.Operation notation transforms
	such calls, and we need the original condition to properly
	inherit and extend the condition expression on tagged type
	derivations.  This functionality was previously provided by the
	routine Install_Original_Selected_Component (as part of
	inheriting conditions); now it is performed as part of the
	preanalysis of the condition, thus avoiding repeatedly
	installing and restoring such nodes.
	(Install_Original_Selected_Component): Removed.
	(Restore_Dispatching_Calls): Removed.
2022-01-06 17:11:31 +00:00
Piotr Trojanek
2a3652640b [Ada] Simplify repeated calls in printing of GNAT AST
gcc/ada/

	* treepr.adb (Visit_Node): Simplify repeated call to
	Next_Entity.
2022-01-06 17:11:31 +00:00
Piotr Trojanek
d6f0d0d4c1 [Ada] Simplify GNAT AST printing with simple GNAT hash table
gcc/ada/

	* treepr.ads (Treepr, Print_Tree_List, Print_Tree_Elist): Fix
	style in comments.
	* treepr.adb (Serial_Numbers): Hash table instance.
	(Hash): Hashing routine.
	(Print_Field): Fix style.
	(Print_Init): Adapt to simple hash table.
	(Print_Term): Likewise.
	(Serial_Numbers): Likewise.
	(Set_Serial_Number): Likewise.
2022-01-06 17:11:31 +00:00
Yannick Moy
07793a58d0 [Ada] Proof of runtime unit for non-binary modular exponentiation
gcc/ada/

	* libgnat/s-expmod.adb: Mark in SPARK. Add ghost code for proof.
	* libgnat/s-expmod.ads: Mark in SPARK. Add ghost specifications.
2022-01-06 17:11:30 +00:00
Yannick Moy
ed722edd2f [Ada] Proof of runtime units for binary modular exponentiation
gcc/ada/

	* libgnat/s-explllu.ads: Mark in SPARK.
	* libgnat/s-expllu.ads: Mark in SPARK.
	* libgnat/s-exponu.adb: Add loop invariants and needed
	assertions.
	* libgnat/s-exponu.ads: Add functional contract.
	* libgnat/s-expuns.ads: Mark in SPARK.
2022-01-06 17:11:30 +00:00
Kito Cheng
e7da31ba20 RISC-V: Minimal support of vector extensions
gcc/ChangeLog:

	* common/config/riscv/riscv-common.c (riscv_implied_info): Add
	vector extensions.
	(riscv_ext_version_table): Add version info for vector extensions.
	(riscv_ext_flag_table): Add option mask for vector extensions.
	* config/riscv/riscv-opts.h (MASK_VECTOR_EEW_32): New.
	(MASK_VECTOR_EEW_64): New.
	(MASK_VECTOR_EEW_FP_32): New.
	(MASK_VECTOR_EEW_FP_64): New.
	(MASK_ZVL32B): New.
	(MASK_ZVL64B): New.
	(MASK_ZVL128B): New.
	(MASK_ZVL256B): New.
	(MASK_ZVL512B): New.
	(MASK_ZVL1024B): New.
	(MASK_ZVL2048B): New.
	(MASK_ZVL4096B): New.
	(MASK_ZVL8192B): New.
	(MASK_ZVL16384B): New.
	(MASK_ZVL32768B): New.
	(MASK_ZVL65536B): New.
	(TARGET_ZVL32B): New.
	(TARGET_ZVL64B): New.
	(TARGET_ZVL128B): New.
	(TARGET_ZVL256B): New.
	(TARGET_ZVL512B): New.
	(TARGET_ZVL1024B): New.
	(TARGET_ZVL2048B): New.
	(TARGET_ZVL4096B): New.
	(TARGET_ZVL8192B): New.
	(TARGET_ZVL16384B): New.
	(TARGET_ZVL32768B): New.
	(TARGET_ZVL65536B): New.
	* config/riscv/riscv.opt (Mask(VECTOR)): New.
	(riscv_vector_eew_flags): New.
	(riscv_zvl_flags): New.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/predef-14.c: New.
	* gcc.target/riscv/predef-15.c: Ditto.
	* gcc.target/riscv/predef-16.c: Ditto.
2022-01-07 00:56:17 +08:00
Kito Cheng
c8bdb34520 RISC-V: Allow extension name contain digit
RISC-V spec only allow alphabetical name for extension before, however
vector extension add several extension named with digits, so we try to
extend the naming rule.

Ref:
https://github.com/riscv/riscv-isa-manual/pull/718

gcc/ChangeLog:

	* common/config/riscv/riscv-common.c
	(riscv_subset_list::parse_multiletter_ext): Allow ext. name has
	digit.
2022-01-07 00:31:16 +08:00
Patrick Palka
2793af17db c++: Add testcase for recently fixed PR [PR69681]
Fixed ever since r12-6188.

	PR c++/69681

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/constexpr-compare2.C: New test.
2022-01-06 10:42:50 -05:00
Pavel I. Kryukov
52ebc2be09 libstdc++: Add self-merge check to std::forward_list::merge [PR103853]
This implements the proposed resolution of LWG 3088, so that x.merge(x)
is a no-op, consistent with std::list::merge.

Signed-off-by: Pavel I. Kryukov <pavel.kryukov@phystech.edu>

Co-authored-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	PR libstdc++/103853
	* include/bits/forward_list.tcc (forward_list::merge): Check for
	self-merge.
	* testsuite/23_containers/forward_list/operations/merge.cc: New test.
2022-01-06 14:56:48 +00:00
Jonathan Wakely
ec12ddd1e7 libstdc++: Adjust friend declarations to work with Clang
I think this code is valid but it fails with Clang, possibly due to
https://llvm.org/PR38882

Qualifying the names makes it work for all compilers.

libstdc++-v3/ChangeLog:

	* include/bits/regex.h (basic_regex, match_results): Qualify
	name in friend declaration, to work around Clang bug.
2022-01-06 14:56:48 +00:00
Jonathan Wakely
e19e2989c3 libstdc++: Increase timeout for pthread7-rope.cc test
This test spawns thousands of threads and so times out if the tests are
run with a low timeout value and the machine is busy.

libstdc++-v3/ChangeLog:

	* testsuite/ext/rope/pthread7-rope.cc: Add dg-timeout-factor.
2022-01-06 14:56:33 +00:00
Jonathan Wakely
c83ecfbe74 libstdc++: Do not use std::isdigit in <charconv> [PR103911]
This avoids a potential race condition if std::setlocale is used
concurrently with std::from_chars.

libstdc++-v3/ChangeLog:

	PR libstdc++/103911
	* include/std/charconv (__from_chars_alpha_to_num): Return
	char instead of unsigned char. Change invalid return value to
	127 instead of using numeric trait.
	(__from_chars_alnum): Fix comment. Do not use std::isdigit.
	Change type of variable to char.
2022-01-06 14:56:12 +00:00
Jakub Jelinek
db33b1059b expr: Workaround profiledbootstrap uninit false positive [PR103899]
The threader changes resulted in a false positive warning during
profiledbootstrap:
In file included from ../../gcc/expr.c:26:
../../gcc/tree.h: In function ‘rtx_def* expand_expr_real_1(tree, rtx, machine_mode, expand_modifier, rtx_def**, bool)’:
../../gcc/tree.h:244:56: error: ‘context’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  244 | #define TREE_CODE(NODE) ((enum tree_code) (NODE)->base.code)
      |                                                        ^~~~
../../gcc/expr.c:10343:8: note: ‘context’ was declared here
10343 |   tree context;
      |        ^~~~~~~
While it will be nice to improve the uninit pass to handle it if possible
(I do not want to close the PR until that is done), doing profiledbootstrap
is a common thing to do, so a workaround is handy, especially as in this
case when the workaround seems to be the right thing to do, as it moves
a variable declaration to the only place where it is set and used and avoids
the weird and for uninit asking
  tree context;
...
  if (exp)
    context = ...;
  gcc_assert (!exp
              || use (context)
              || use_some_more (context));

2022-01-06  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/103899
	* expr.c (expand_expr_real_1): Add a workaround for bogus uninit
	warning by moving context variable to the only spot where it is used
	and moving gcc_assert into if body.
2022-01-06 15:32:57 +01:00
Olivier Hainque
75b8a72617 Add VxWworks fixincludes hack, don't expect yvals.h from gcc
yvals.h on VxWorks expects the toolchain to provide its own
version of the header, which we don't do. Arrange to fallback
on the common system definitions instead.

2021-12-16  Olivier Hainque  <hainque@adacore.com>

fixincludes/
	* inclhack.def (vxworks_next_yvals): New hack.
	* tests/base/yvals.h: New expected test result.
	* fixincl.x: Regenerate.
2022-01-06 12:04:13 +00:00
Jakub Jelinek
80ad67e2af ifcvt: Check for asm goto at the end of then_bb/else_bb in ifcvt [PR103908]
On the following testcase, RTL ifcvt sees then_bb
(note 7 6 8 3 [bb 3] NOTE_INSN_BASIC_BLOCK)
(insn 8 7 9 3 (set (mem/c:SI (symbol_ref:DI ("b") [flags 0x2]  <var_decl 0x7fdccf5b0cf0 b>) [1 b+0 S4 A32])
        (const_int 1 [0x1])) "pr103908.c":6:7 81 {*movsi_internal}
     (nil))
(jump_insn 9 8 13 3 (parallel [
            (asm_operands/v ("# insn 1") ("") 0 []
                 []
                 [
                    (label_ref:DI 21)
                ] pr103908.c:7)
            (clobber (reg:CC 17 flags))
        ]) "pr103908.c":7:5 -1
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil))
 -> 21)
and similarly else_bb (just with a different asm_operands template).
It checks that those basic blocks have a single successor and
uses last_active_insn which intentionally skips over JUMP_INSNs, sees
both basic blocks contain the same set and merges them (or if the
sets are different, attempts some other noce optimization).
But we can't assume that the jump, even when it has only a single successor,
has no side-effects.

The following patch fixes it by punting if test_bb ends with a JUMP_INSN
that isn't onlyjump_p.

2022-01-06  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/103908
	* ifcvt.c (bb_valid_for_noce_process_p): Punt on bbs ending with
	asm goto.

	* gcc.target/i386/pr103908.c: New test.
2022-01-06 09:29:34 +01:00
Marek Polacek
1935db2968 Avoid more -Wformat-diag warnings [PR103758]
Let's use "%<x>, %<y>, or %<z>" rather than "[x|y|z]" as in the rest of
our codebase.

	PR c++/103758

gcc/c-family/ChangeLog:

	* c-pragma.c (handle_pragma_scalar_storage_order): Use %< %> in
	diagnostic messages.
	(handle_pragma_diagnostic): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.dg/sso-6.c: Update dg-warning.
2022-01-05 19:42:45 -05:00
GCC Administrator
0fbefa25b3 Daily bump. 2022-01-06 00:16:32 +00:00