aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2022-11-04testsuite: Add testcase from C++23 P2314R4 - Character sets and encodingsJakub Jelinek1-0/+10
I've read the paper and I believe we just implement it with no changes needed (at least since PR67224 and similar libcpp changes in GCC 10), but I could be wrong. The following patch at least adds a testcase from the start of the paper. 2022-11-04 Jakub Jelinek <jakub@redhat.com> * g++.dg/cpp23/charset1.C: New testcase from C++23 P2314R4.
2022-11-04libcpp: Update to Unicode 15Jakub Jelinek1-0/+24
The following pseudo-patch regenerates the libcpp tables with Unicode 15.0.0 which added 4489 new characters. As mentioned previously, this isn't just a matter of running the two libcpp/make*.cc programs on the new Unicode files, but one needs to manually update a table inside of makeuname2c.cc according to a table in Unicode text (which is partially reflected in the text files, but e.g. in Unicode 14.0.0 not 100% accurately, in 15.0.0 actually accurately). I've also added some randomly chosen subset of those 4489 new characters to a testcase. 2022-11-04 Jakub Jelinek <jakub@redhat.com> gcc/testsuite/ * c-c++-common/cpp/named-universal-char-escape-1.c: Add tests for some characters newly added in Unicode 15.0.0. libcpp/ * makeuname2c.cc (struct generated): Update from Unicode 15.0.0 table 4-8. * ucnid.h: Regenerated for Unicode 15.0.0. * uname2c.h: Likewise.
2022-11-04AArch64: Fix testcaseWilco Dijkstra1-3/+3
gcc/testsuite/ * gcc.target/aarch64/mgeneral-regs_3.c: Fix testcase.
2022-11-04input: add get_source_text_betweenJeff Chapman II2-0/+93
The c++-contracts branch uses this to retrieve the source form of the contract predicate, to be returned by contract_violation::comment(). Co-authored-by: Jason Merrill <jason@redhat.com> gcc/ChangeLog: * input.cc (get_source_text_between): New fn. * input.h (get_source_text_between): Declare.
2022-11-04Set nonzero bits for multiplication and divisions by a power of 2.Aldy Hernandez3-0/+96
We're missing a lot of TLC in keeping track of nonzero bits across range-ops. It isn't an oversight, but just limited amount of hours to implement stuff. This patch keeps better track of the nonzero mask (really maybe_nonzero bits as discussed) across multiplication and division when the RHS is a power of 2. It fixes PR107342 and also touches on PR55157. In the latter, the nonzero mask is being set quite late (CCP2) but could be set by evrp time if we enhanced range-ops. I have added tests from both PRs. Tested PR tree-optimization/107342 gcc/ChangeLog: * range-op.cc (operator_mult::fold_range): New. (operator_div::fold_range): New. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/vrp122.c: New test. * gcc.dg/tree-ssa/vrp123.c: New test.
2022-11-04Fix recent thinko in operand_equal_pEric Botcazou5-14/+61
There is a thinko in a recent improvement made to operand_equal_p where the code just looks at operand 2 of COMPONENT_REF, if it is present, to compare addresses. That's wrong because operand 2 contains the number of DECL_OFFSET_ALIGN-bit-sized words so, when DECL_OFFSET_ALIGN > 8, not all the bytes are included and some of them are in DECL_FIELD_BIT_OFFSET, see get_inner_reference for the model computation. In other words, you would need to compare operand 2 and DECL_OFFSET_ALIGN and DECL_FIELD_BIT_OFFSET in this situation, but I'm not sure this is worth the hassle in practice so the fix just removes this alternate handling. gcc/ * fold-const.cc (operand_compare::operand_equal_p) <COMPONENT_REF>: Do not take into account operand 2. (operand_compare::hash_operand) <COMPONENT_REF>: Likewise. gcc/testsuite/ * gnat.dg/opt99.adb: New test. * gnat.dg/opt99_pkg1.ads, gnat.dg/opt99_pkg1.adb: New helper. * gnat.dg/opt99_pkg2.ads: Likewise.
2022-11-04Do not use subword paradoxical subregs in emit_group_storeEric Botcazou1-13/+13
The goal of the trick is to make life easier for the combiner, but subword paradoxical subregs make it harder for the register allocator instead. gcc/ * expr.cc (emit_group_store): Do not use subword paradoxical subregs
2022-11-04ada: Fix for validity checks combined with aliasing checksJustin Squirek1-5/+11
Attribute Overlaps_Storage, which can appear implicitly in expansion of aliasing checks, is now excluded from operand validity checks. Likewise for attribute Has_Same_Storage. gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference): Skip operand validity checks for attributes Has_Same_Storage and Overlaps_Storage.
2022-11-04ada: Fix couple of issues with arrays indexed by enumeration typeEric Botcazou2-15/+5
The first one is that Remove_Warning_Messages reinstates the Original_Node of an N_Raise_Constraint_Error node in the tree for no clear reasons, and the Original_Node may contain constructs whose expansion has been stopped when the Constraint_Error was asserted, eventually causing gigi to stop. The second one is that a path in Build_Array_Aggr_Code.Gen_Loop does not copy the loop bounds, unlike other paths, thus triggering a sharing issue. gcc/ada/ * errout.adb (Remove_Warning_Messages.Check_For_Warning): Do not reinstate the Original_Node in the tree. * exp_aggr.adb (Build_Array_Aggr_Code.Gen_Loop): Copy the bounds on all paths.
2022-11-04ada: Fix typo in comment referring to pragma RestrictionsPiotr Trojanek1-3/+2
Comment cleanup only. gcc/ada/ * libgnat/g-excact.ads (Register_Global_Action): Refill comment. (Name_To_Id): Change pragma Restriction from singular to plural.
2022-11-04ada: Cleanup code for warnings about unreferenced formal parametersPiotr Trojanek1-9/+0
Cleanup related to new checks for unset references. gcc/ada/ * sem_warn.adb (Check_References): Remove redundant guard, as it is implied by a preceding call to Referenced_Check_Spec.
2022-11-04ada: Cleanup code for unreferenced variablesPiotr Trojanek1-19/+10
Further cleanups related to warnings about unreferenced objects. gcc/ada/ * sem_warn.adb (Check_References): Remove useless query for "spec" of a variable; refactor nested if-statements into a single condition.
2022-11-04ada: Cleanup code for warnings about unset referencesPiotr Trojanek2-12/+19
Cleanup related to new checks for unset references. gcc/ada/ * sem_util.adb (In_Pragma_Expression): Add standard guard against searching too far. (In_Quantified_Expression): Likewise. * sem_warn.adb (May_Need_Initialized_Actual): Remove redundant parens. (Check_References): Remove guard that duplicates a condition from the enclosing if-statement; only assign E1T variable when necessary. (Within_Postcondition): Fix layout. (No_Warn_On_In_Out): Balance parens in comment.
2022-11-04ada: Static intrinsic functions are a core language extension.Steve Baird4-3/+9
GNAT-defined Ada extensions are divided into two categories: those that are enabled by either -gnatX or -gnatX0 and those which require -gnatX0. Move static intrinsic functions from the second category into the first. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Add the standard '... "On" enables this extension.' sentence to the description of static intrinsic functions. * sem_ch13.adb (Analyze_Aspect_Spec): In the call to Error_Msg_GNAT_Extension for a Static aspect specification for an intrinsic function, specify Is_Core_Extension => True. * sem_eval.adb (Eval_Intrinsic_Call): Test Core_Extensions_Allowed instead of testing All_Extensions_Allowed. * gnat_rm.texi: Regenerate.
2022-11-04ada: Remove redundant calls in handling of aspect specificationsPiotr Trojanek3-4/+0
Routine Set_Aspect_Specifications sets the Has_Aspect flag, so there is no need to set this flag again afterwards. Code cleanup; semantics is unaffected. gcc/ada/ * aspects.adb (Relocate_Aspect): Remove call to Set_Has_Aspects. * sem_ch12.adb (Analyze_Formal_Package_Declaration): Likewise. * sem_util.adb (Copy_Ghost_Aspect, Copy_SPARK_Mode_Aspect): Likewise.
2022-11-04ada: Flag unsupported dispatching constructor callsJavier Miranda3-9/+55
gcc/ada/ * exp_intr.adb (Expand_Dispatching_Constructor_Call): Report an error on unsupported dispatching constructor calls and report a warning on calls that may fail at run time. gcc/testsuite/ * gnat.dg/abstract1.ads: Cleanup whitespaces. * gnat.dg/abstract1.adb: Likewise and add -gnatws to silence new warning.
2022-11-04ada: Avoid repeated iteration over private protected componentsPiotr Trojanek1-14/+11
The First_Entity/Next_Entity chain includes private entities, so there it no need to iterate starting both from First_Entity and First_Private_Entity. Code cleanup related to improved detection of references to uninitialized objects; behavior is unaffected. gcc/ada/ * sem_util.adb (Check_Components): Iterate using First/Next_Component_Or_Discriminant. (Has_Preelaborable_Initialization): Avoid repeated iteration with calls to Check_Components with First_Entity and First_Private_Entity. (Is_Independent_Object_Entity): Tune indentation.
2022-11-04ada: Cleanup clearing flags on package variablesPiotr Trojanek1-12/+9
When killing flags on assignable entities we iterated from First_Entity and then again from First_Private_Entity. This second iteration was unnecessary, because the entity chain that starts with First_Entity contains all entities, including the private ones. This is just a performance improvement; the behavior is unchanged. gcc/ada/ * sem_ch7.adb (Clear_Constants): Only iterate from First_Entity through Next_Entity; only examine variables because packages have no assignable formal parameters.
2022-11-04ada: Fix various typos in GNAT User's GuidePiotr Trojanek4-16/+18
Fix uncontroversial typos. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix typos. * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Fix typos and refill as necessary; remove trailing whitespace. * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typos. * gnat_ugn.texi: Regenerate.
2022-11-04ada: Fix loop unnesting issue.Marc Poulhiès3-8/+16
During loop unnesting, when the loop statements are wrapped in a code block, the newly created block's scope must be set to the loop scope (instead of the previous 'Current_Scope' that would point to an upper scope). gcc/ada/ * sem_util.ads (Add_Block_Identifier): Add new extra Scope argument. * sem_util.adb (Add_Block_Identifier): Likewise and use this scope variable instead of Current_Scope. * exp_util.adb (Wrap_Statements_In_Block): Add new scope argument to Add_Block_Identifier call.
2022-11-04ada: Fix repeated killing of private entity valuesPiotr Trojanek1-29/+9
When killing known values of assignable entities we iterated from First_Entity and then again from First_Private_Entity. This second iteration was unnecessary, because the entity chain that starts with First_Entity contains all entities, including the private ones. This is just a performance improvement; the behavior is unchanged. gcc/ada/ * sem_util.adb (Kill_Current_Values): Only iterate from First_Entity through Next_Entity.
2022-11-04ada: Simplify detection of controlling formalsPiotr Trojanek1-3/+3
When detecting controlling formals we are only interested in formal parameters and not in other entities. gcc/ada/ * sem_ch6.adb (Controlling_Formal): Iterate with First/Next_Formal and not with First/Next_Entity.
2022-11-04ada: Skip dynamic interface conversion under configurable runtimeJavier Miranda1-1/+1
gcc/ada/ * exp_disp.adb (Expand_Interface_Conversion): Fix typo in comment.
2022-11-04ada: Skip dynamic interface conversion under configurable runtimeJavier Miranda2-14/+33
gcc/ada/ * exp_disp.adb (Expand_Interface_Conversion): Under configurable runtime, when the target type is an interface that is an ancestor of the operand type, skip generating code to displace the pointer to reference the target dispatch table. * sem_disp.adb (Propagate_Tag): Handle class-wide types when checking for the addition of an implicit interface conversion.
2022-11-04ada: Fix typoRonan Desplanques2-2/+2
Fix typo in documentation. gcc/ada/ * doc/gnat_rm/standard_library_routines.rst: Fix typo. * gnat_rm.texi: Regenerate.
2022-11-04ada: Remove sa_messagesGhjuvan Lacambre2-806/+0
Spark and CodePeer do not depend on this unit anymore. gcc/ada/ * sa_messages.ads, sa_messages.adb: Remove files.
2022-11-04ada: Refactor: replace uses of `not Present(X)` with `No (X)`Ghjuvan Lacambre27-77/+74
`No (X)` is essentially `not Present (X)`, there's no reason for not using this shorter form. gcc/ada/ * checks.adb, exp_atag.adb, exp_attr.adb, exp_ch4.adb, exp_ch6.adb, exp_ch7.adb, exp_dbug.adb, exp_disp.adb, exp_unst.adb, exp_util.adb, freeze.adb, layout.adb, pprint.adb, rtsfind.adb, sem_aggr.adb, sem_attr.adb, sem_case.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb, sem_ch8.adb, sem_dim.adb, sem_prag.adb, sem_util.adb, sem_warn.adb: Replace uses of `not Present (X)` with `No (X)`.
2022-11-04ada: Fix various typos in node and entity description commentsPiotr Trojanek2-12/+14
Fix typos in units that describe GNAT abstract syntax tree. gcc/ada/ * einfo.ads: Fix typos in comments; refill as necessary. * sinfo.ads: Likewise.
2022-11-04ada: Fix various typos in GNAT RMPiotr Trojanek6-22/+22
List of unknown words in files can be produced with: $ cat *.rst | ispell -l | tr '[:upper:]' '[:lower:]' | sort | uniq | less and can be easily filtered with eyes. gcc/ada/ * doc/gnat_rm/implementation_defined_aspects.rst: Fix typos. * doc/gnat_rm/implementation_defined_attributes.rst: Likewise * doc/gnat_rm/implementation_defined_characteristics.rst: Likewise * doc/gnat_rm/implementation_defined_pragmas.rst: Likewise * doc/gnat_rm/standard_library_routines.rst: Likewise. * gnat_rm.texi: Regenerate.
2022-11-04ada: Improve efficiency of scope stack restorationPiotr Trojanek1-2/+2
We save/restore visibility by setting the Is_Immediately_Visible flag and appending entities to / removing them from the tail of an element list. However, the Is_Immediately_Visible flag can be restored in any order, while the element list is singly-linked and removal from the tail is inefficient. This change removes a performance hot spot, which accounted for up to 10% of compilation time of complex applications (e.g. QGen), at least as measured on GNAT built with profiling support. gcc/ada/ * sem_ch8.adb (Restore_Scope_Stack): Remove elements from the head and not the tail of an element list.
2022-11-04ada: Small editorial changes to documentation commentsRonan Desplanques1-4/+4
gcc/ada/ * sinfo.ads: Small editorial changes.
2022-11-04ada: Allow enabling a restricted set of language extensions.Steve Baird22-95/+212
The -gnatX switch (and the related Extensions_Allowed pragma) is currently a two-valued all-or-nothing option. Add support for enabling a curated subset of language extensions without enabling others via the -gnatX switch and for enabling all language extensions via the new -gnatX0 switch. Similarly, the existing "ON" argument for the Extensions_Allowed pragma now only enables the curated subset; the new argument "ALL" enables all language extensions. The subset of language extensions currently includes prefixed-view notation with an untagged prefix, fixed-low-bound array subtypes, and casing on composite values. gcc/ada/ * opt.ads: Replace Ada_Version_Type enumeration literal Ada_With_Extensions with two literals, Ada_With_Core_Extensions and Ada_With_All_Extensions. Update uses of the deleted literal. Replace Extensions_Allowed function with two functions: All_Extensions_Allowed and Core_Extensions_Allowed. * errout.ads, errout.adb: Add Boolean parameter to Error_Msg_GNAT_Extension to indicate whether the construct in question belongs to the curated subset. * exp_ch5.adb, par-ch4.adb, sem_case.adb, sem_ch3.adb: * sem_ch4.adb, sem_ch5.adb, sem_ch8.adb: Replace calls to Extensions_Allowed with calls to Core_Extensions_Allowed for constructs that are in the curated subset. * sem_attr.adb, sem_ch13.adb, sem_eval.adb, sem_util.adb: Replace calls to Extensions_Allowed with calls to All_Extensions_Allowed for constructs that are not in the curated subset. * par-ch3.adb: Override default for new parameter in calls to Error_Msg_GNAT_Extension for constructs in the curated subset. * par-prag.adb: Add Boolean parameter to Check_Arg_Is_On_Or_Off to also allow ALL. Set Opt.Ada_Version appropriately for ALL or ON arguments. * sem_prag.adb: Allowed ALL argument for an Extensions_Allowed pragma. Set Opt.Ada_Version appropriately for ALL or ON arguments. * switch-c.adb: The -gnatX switch now enables only the curated subset of language extensions (formerly it enabled all of them); the new -gnatX0 switch enables all of them. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Document new "-gnatX0" switch and update documentation for "-gnatX" switch. * doc/gnat_rm/implementation_defined_pragmas.rst: Document new ALL argument for pragma Extensions_Allowed and update documentation for the ON argument. Delete mention of Ada 2022 Reduce attribute as an extension. * gnat_rm.texi, gnat_ugn.texi: Regenerate.
2022-11-04ada: Generate missing object decls for adainit/adafinal registration callsSteve Baird1-5/+14
A previous change on this ticket introduced calls to CUDA_Register_Function for adainit and adafinal, but failed to introduce declarations for the C string variables that are initialized and then passed as actual parameters in this call. Provide the missing declarations (and, incidentally, change the names of the two variables). gcc/ada/ * bindgen.adb: Introduce two new string constants for the names of the C-String variables that are assigned the names for adainit and adafinal. Replace string literals in Gen_CUDA_Init with references to these constants. In Gen_CUDA_Defs, generate C-String variable declarations where these constants are the names of the variables.
2022-11-04ada: Support lock-free protected objects with pragma Initialize_ScalarsPiotr Trojanek1-0/+9
In general, protected subprograms are only eligible for a lock-free expansion if they do not reference global assignable objects. However, it seems reasonable to ignore references to variables in System.Scalar_Values, which are generated when pragma Initialize_Scalars is active. Such references appear, for example, when protected subprogram has formal parameters of mode out. gcc/ada/ * sem_ch9.adb (Satisfies_Lock_Free_Requirements): Ignore references to global variables inserted due to pragma Initialize_Scalars.
2022-11-04ada: Remove VxWorks 6 and VxWorks 653 2.x content from the UGXCedric Landet3-6/+6
Because they are not supported anymore. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Remove VxWorks version 6. * gnat_rm.texi, gnat_ugn.texi: Regenerate.
2022-11-04ada: Reject expanded global names in lock-free protected objectsPiotr Trojanek1-2/+2
Lock-free expansion of protected subprograms is only possible when there are no references to global assignable objects. We only detected such references when they appeared as direct names, but we must similarly detect expanded names. gcc/ada/ * sem_ch9.adb (Satisfies_Lock_Free_Requirements): Detect references via expanded names.
2022-11-04ada: Generate host-side CUDA_Register_Function calls for device's ↵Steve Baird1-17/+49
adainit/adafinal To invoke a device-side subprogram from the host (via a CUDA_execute pragma), the subprogram also has to be registered by calling CUDA_Register_Function. The host-side adainit and adafinal procedures need to invoke the corresponding device-side procedures, so corresponding CUDA_Register_Function calls need to be generated. gcc/ada/ * bindgen.adb (Gen_CUDA_Init): Move existing loop body into a new local procedure, Gen_CUDA_Register_Function_Call, and replace that loop body with a call to this procedure. This first part is just semantics-preserving refactoring. The second part is to add Gen_CUDA_Register_Function_Call calls after the loop for the device-side adainit and adafinal procedures.
2022-11-04aarch64: Fix typo in aarch64-sve.md commentKyrylo Tkachov1-2/+2
gcc/ChangeLog: * config/aarch64/aarch64-sve2.md: Fix typo in Cryptographic extensions comment.
2022-11-04Remove support for Intel MIC offloadingThomas Schwinge10-817/+3
... after its deprecation in GCC 12. * Makefile.def: Remove module 'liboffloadmic'. * Makefile.in: Regenerate. * configure.ac: Remove 'liboffloadmic' handling. * configure: Regenerate. contrib/ * gcc-changelog/git_commit.py (default_changelog_locations): Remove 'liboffloadmic'. * gcc_update (files_and_dependencies): Remove 'liboffloadmic' files. * update-copyright.py (GCCCmdLine): Remove 'liboffloadmic' comment. gcc/ * config.gcc [target *-intelmic-* | *-intelmicemul-*]: Remove. * config/i386/i386-options.cc (ix86_omp_device_kind_arch_isa) [ACCEL_COMPILER]: Remove. * config/i386/intelmic-mkoffload.cc: Remove. * config/i386/intelmic-offload.h: Likewise. * config/i386/t-intelmic: Likewise. * config/i386/t-omp-device: Likewise. * configure.ac [target *-intelmic-* | *-intelmicemul-*]: Remove. * configure: Regenerate. * doc/install.texi (--enable-offload-targets=[...]): Update. * doc/sourcebuild.texi: Remove 'liboffloadmic' documentation. include/ * gomp-constants.h (GOMP_DEVICE_INTEL_MIC): Comment out. (GOMP_VERSION_INTEL_MIC): Remove. libgomp/ * libgomp-plugin.h (OFFLOAD_TARGET_TYPE_INTEL_MIC): Remove. * libgomp.texi (OpenMP Context Selectors): Remove Intel MIC documentation. * plugin/configfrag.ac <enable_offload_targets> [*-intelmic-* | *-intelmicemul-*]: Remove. * configure: Regenerate. * testsuite/lib/libgomp.exp (libgomp_init): Remove 'liboffloadmic' handling. (offload_target_to_openacc_device_type) [$offload_target = *-intelmic*]: Remove. (check_effective_target_offload_device_intel_mic) (check_effective_target_offload_device_any_intel_mic): Remove. * testsuite/libgomp.c-c++-common/on_device_arch.h (device_arch_intel_mic, on_device_arch_intel_mic, any_device_arch) (any_device_arch_intel_mic): Remove. * testsuite/libgomp.c-c++-common/target-45.c: Remove 'offload_device_any_intel_mic' XFAIL. * testsuite/libgomp.fortran/target10.f90: Likewise. liboffloadmic/ * ChangeLog: Remove. * Makefile.am: Likewise. * Makefile.in: Likewise. * aclocal.m4: Likewise. * configure: Likewise. * configure.ac: Likewise. * configure.tgt: Likewise. * doc/doxygen/config: Likewise. * doc/doxygen/header.tex: Likewise. * include/coi/common/COIEngine_common.h: Likewise. * include/coi/common/COIEvent_common.h: Likewise. * include/coi/common/COIMacros_common.h: Likewise. * include/coi/common/COIPerf_common.h: Likewise. * include/coi/common/COIResult_common.h: Likewise. * include/coi/common/COISysInfo_common.h: Likewise. * include/coi/common/COITypes_common.h: Likewise. * include/coi/sink/COIBuffer_sink.h: Likewise. * include/coi/sink/COIPipeline_sink.h: Likewise. * include/coi/sink/COIProcess_sink.h: Likewise. * include/coi/source/COIBuffer_source.h: Likewise. * include/coi/source/COIEngine_source.h: Likewise. * include/coi/source/COIEvent_source.h: Likewise. * include/coi/source/COIPipeline_source.h: Likewise. * include/coi/source/COIProcess_source.h: Likewise. * liboffloadmic_host.spec.in: Likewise. * liboffloadmic_target.spec.in: Likewise. * plugin/Makefile.am: Likewise. * plugin/Makefile.in: Likewise. * plugin/aclocal.m4: Likewise. * plugin/configure: Likewise. * plugin/configure.ac: Likewise. * plugin/libgomp-plugin-intelmic.cpp: Likewise. * plugin/offload_target_main.cpp: Likewise. * runtime/cean_util.cpp: Likewise. * runtime/cean_util.h: Likewise. * runtime/coi/coi_client.cpp: Likewise. * runtime/coi/coi_client.h: Likewise. * runtime/coi/coi_server.cpp: Likewise. * runtime/coi/coi_server.h: Likewise. * runtime/compiler_if_host.cpp: Likewise. * runtime/compiler_if_host.h: Likewise. * runtime/compiler_if_target.cpp: Likewise. * runtime/compiler_if_target.h: Likewise. * runtime/dv_util.cpp: Likewise. * runtime/dv_util.h: Likewise. * runtime/emulator/coi_common.h: Likewise. * runtime/emulator/coi_device.cpp: Likewise. * runtime/emulator/coi_device.h: Likewise. * runtime/emulator/coi_host.cpp: Likewise. * runtime/emulator/coi_host.h: Likewise. * runtime/emulator/coi_version_asm.h: Likewise. * runtime/emulator/coi_version_linker_script.map: Likewise. * runtime/liboffload_error.c: Likewise. * runtime/liboffload_error_codes.h: Likewise. * runtime/liboffload_msg.c: Likewise. * runtime/liboffload_msg.h: Likewise. * runtime/mic_lib.f90: Likewise. * runtime/offload.h: Likewise. * runtime/offload_common.cpp: Likewise. * runtime/offload_common.h: Likewise. * runtime/offload_engine.cpp: Likewise. * runtime/offload_engine.h: Likewise. * runtime/offload_env.cpp: Likewise. * runtime/offload_env.h: Likewise. * runtime/offload_host.cpp: Likewise. * runtime/offload_host.h: Likewise. * runtime/offload_iterator.h: Likewise. * runtime/offload_omp_host.cpp: Likewise. * runtime/offload_omp_target.cpp: Likewise. * runtime/offload_orsl.cpp: Likewise. * runtime/offload_orsl.h: Likewise. * runtime/offload_table.cpp: Likewise. * runtime/offload_table.h: Likewise. * runtime/offload_target.cpp: Likewise. * runtime/offload_target.h: Likewise. * runtime/offload_target_main.cpp: Likewise. * runtime/offload_timer.h: Likewise. * runtime/offload_timer_host.cpp: Likewise. * runtime/offload_timer_target.cpp: Likewise. * runtime/offload_trace.cpp: Likewise. * runtime/offload_trace.h: Likewise. * runtime/offload_util.cpp: Likewise. * runtime/offload_util.h: Likewise. * runtime/ofldbegin.cpp: Likewise. * runtime/ofldend.cpp: Likewise. * runtime/orsl-lite/include/orsl-lite.h: Likewise. * runtime/orsl-lite/lib/orsl-lite.c: Likewise. * runtime/orsl-lite/version.txt: Likewise.
2022-11-04Better integrate default 'sorry' 'TARGET_ASM_CONSTRUCTOR', ↵Thomas Schwinge7-72/+24
'TARGET_ASM_DESTRUCTOR' ... after commit 4ee35c11fd328728c12f3e086ae016ca94624bf8 "Restore default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR'". No functional change. gcc/ * Makefile.in (OBJS): Remove 'dbxout.o'. * config/nvptx/nvptx.cc: Don't '#include "dbxout.h"'. * dbxout.cc: Remove. * dbxout.h: Likewise. * target-def.h (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): Default to 'default_asm_out_constructor', 'default_asm_out_destructor'. * targhooks.cc (default_asm_out_constructor) (default_asm_out_destructor): New. * targhooks.h (default_asm_out_constructor) (default_asm_out_destructor): Declare.
2022-11-04Restore default 'sorry' 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR'Thomas Schwinge5-0/+74
... that got lost in commit 7e0db0cdf01e9c885a29cb37415f5bc00d90c029 "STABS: remove -gstabs and -gxcoff functionality". Previously, if a back end was not 'USE_COLLECT2', nor manually defined 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR', or got pointed to the respective 'default_[...]' functions due to 'CTORS_SECTION_ASM_OP', 'DTORS_SECTION_ASM_OP', or 'TARGET_ASM_NAMED_SECTION', it got pointed to 'default_stabs_asm_out_constructor', 'default_stabs_asm_out_destructor'. These would emit 'sorry' for any global constructor/destructor they're run into. This is now gone, and thus in such a back end configuration case 'TARGET_ASM_CONSTRUCTOR', 'TARGET_ASM_DESTRUCTOR' don't get defined anymore, and thus the subsequently following: #if !defined(TARGET_HAVE_CTORS_DTORS) # if defined(TARGET_ASM_CONSTRUCTOR) && defined(TARGET_ASM_DESTRUCTOR) # define TARGET_HAVE_CTORS_DTORS true # endif #endif ... doesn't define 'TARGET_HAVE_CTORS_DTORS' anymore, and thus per my understanding, 'gcc/final.cc:rest_of_handle_final': if (DECL_STATIC_CONSTRUCTOR (current_function_decl) && targetm.have_ctors_dtors) targetm.asm_out.constructor (XEXP (DECL_RTL (current_function_decl), 0), decl_init_priority_lookup (current_function_decl)); if (DECL_STATIC_DESTRUCTOR (current_function_decl) && targetm.have_ctors_dtors) targetm.asm_out.destructor (XEXP (DECL_RTL (current_function_decl), 0), decl_fini_priority_lookup (current_function_decl)); ... simply does nothing anymore for a 'DECL_STATIC_CONSTRUCTOR', 'DECL_STATIC_DESTRUCTOR'. This, effectively, means that GCC/nvptx now suddenly appears to "support" global constructors/destructors, which means that a ton of test cases now erroneously PASS that previously used to FAIL: sorry, unimplemented: global constructors not supported on this target Of course, such support didn't magically happen due to "STABS: remove -gstabs and -gxcoff functionality", so this is bad. And, corresponding execution testing then regularly FAILs (due to the global constructor/destructor functions never being invoked), for example: [-UNSUPPORTED:-]{+PASS:+} gcc.dg/initpri1.c {+(test for excess errors)+} {+FAIL: gcc.dg/initpri1.c execution test+} [-UNSUPPORTED:-]{+PASS:+} g++.dg/special/conpr-1.C {+(test for excess errors)+} {+FAIL: g++.dg/special/conpr-1.C execution test+} To restore the previous GCC/nvptx behavior, for traceability, this simply restores the previous code, stripped down to the bare minimum. gcc/ * Makefile.in (OBJS): Add 'dbxout.o'. * config/nvptx/nvptx.cc: '#include "dbxout.h"'. * dbxout.cc: New. * dbxout.h: Likewise. * target-def.h (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): Default to 'default_stabs_asm_out_constructor', 'default_stabs_asm_out_destructor'.
2022-11-04Support Intel AMX-FP16 ISAHongyu Wang29-14/+262
gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_available_features): Detect amx-fp16. * common/config/i386/i386-common.cc (OPTION_MASK_ISA2_AMX_FP16_SET, OPTION_MASK_ISA2_AMX_FP16_UNSET): New macros. (ix86_handle_option): Handle -mamx-fp16. * common/config/i386/i386-cpuinfo.h (enum processor_features): Add FEATURE_AMX_FP16. * common/config/i386/i386-isas.h: Add ISA_NAME_TABLE_ENTRY for amx-fp16. * config.gcc: Add amxfp16intrin.h. * config/i386/cpuid.h (bit_AMX_FP16): New. * config/i386/i386-c.cc (ix86_target_macros_internal): Define __AMX_FP16__. * config/i386/i386-isa.def: Add DEF_PTA for AMX_FP16. * config/i386/i386-options.cc (isa2_opts): Add -mamx-fp16. (ix86_valid_target_attribute_inner_p): Add new ATTR. (ix86_option_override_internal): Handle AMX-FP16. * config/i386/i386.opt: Add -mamx-fp16. * config/i386/immintrin.h: Include amxfp16intrin.h. * doc/extend.texi: Document -mamx-fp16. * doc/invoke.texi: Document amx-fp16. * doc/sourcebuild.texi: Document amx_fp16. * config/i386/amxfp16intrin.h: New file. gcc/testsuite/ChangeLog: * g++.dg/other/i386-2.C: Add -mamx-fp16. * g++.dg/other/i386-3.C: Ditto. * gcc.target/i386/sse-12.c: Ditto. * gcc.target/i386/sse-13.c: Ditto. * gcc.target/i386/sse-14.c: Ditto. * gcc.target/i386/sse-22.c: Ditto. * gcc.target/i386/sse-23.c: Ditto. * lib/target-supports.exp: (check_effective_target_amx_fp16): New proc. * gcc.target/i386/funcspec-56.inc: Add new target attribute. * gcc.target/i386/amx-check.h: Add AMX_FP16. * gcc.target/i386/amx-helper.h: New file to support amx-fp16. * gcc.target/i386/amxfp16-asmatt-1.c: New test. * gcc.target/i386/amxfp16-asmintel-1.c: Ditto. * gcc.target/i386/amxfp16-dpfp16ps-2.c: Ditto. Co-authored-by: Haochen Jiang <haochen.jiang@intel.com>
2022-11-04arm: Allow to override location of .gnu.sgstubs sectionTorbjörn SVENSSON6-5/+16
Depending on the DejaGNU board definition, the .gnu.sgstubs section might be placed on different locations in order to suit the target. With this patch, the start location of the section is overrideable from the board definition with the fallback of the previously hardcoded location. gcc/testsuite/ChangeLog: * gcc.target/arm/cmse/bitfield-1.c: Use overridable location. * gcc.target/arm/cmse/bitfield-2.c: Likewise. * gcc.target/arm/cmse/bitfield-3.c: Likewise. * gcc.target/arm/cmse/cmse-20.c: Likewise. * gcc.target/arm/cmse/struct-1.c: Likewise. * gcc.target/arm/cmse/cmse.exp (cmse_sgstubs): New. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2022-11-04c++: Use in-process client when networking is disabledTorbjörn SVENSSON2-1/+5
Without the patch, the output for bad-mapper-3.C would be: /src/gcc/gcc/testsuite/g++.dg/modules/bad-mapper-3.C:2:1: error: unknown Compiled Module Interface: no such module As this line is unexpected, the test case would fail. The same problem can also be seen for g++.dg/modules/bad-mapper-2.C. gcc/cp/ChangeLog: * mapper-client.cc: Use in-process client when networking is disabled. gcc/testsuite/ChangeLog: * g++.dg/modules/bad-mapper-3.C: Update dg-error pattern. Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2022-11-04Initial Sierra Forest SupportHaochen Jiang12-2/+46
gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_intel_cpu): Add Sierra Forest. * common/config/i386/i386-common.cc (processor_names): Add Sierra Forest. (processor_alias_table): Ditto. * common/config/i386/i386-cpuinfo.h (enum processor_types): Add INTEL_SIERRAFOREST. * config.gcc: Add -march=sierraforest. * config/i386/driver-i386.cc (host_detect_local_cpu): Handle Sierra Forest. * config/i386/i386-c.cc (ix86_target_macros_internal): Ditto. * config/i386/i386-options.cc (m_SIERRAFOREST): New define. (processor_cost_table): Add sierra forest. * config/i386/i386.h (enum processor_type): Add PROCESSOR_SIERRA_FOREST. (PTA_SIERRAFOREST): Ditto. * doc/extend.texi: Add sierra forest. * doc/invoke.texi: Ditto. gcc/testsuite/ChangeLog: * g++.target/i386/mv16.C: Add sierra forest. * gcc.target/i386/funcspec-56.inc: Handle new march.
2022-11-04Support Intel CMPccXADDHaochen Jiang33-15/+436
gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_available_features): Detect cmpccxadd. * common/config/i386/i386-common.cc (OPTION_MASK_ISA2_CMPCCXADD_SET, OPTION_MASK_ISA2_CMPCCXADD_UNSET): New. (ix86_handle_option): Handle -mcmpccxadd. * common/config/i386/i386-cpuinfo.h (enum processor_features): Add FEATURE_CMPCCXADD. * common/config/i386/i386-isas.h: Add ISA_NAME_TABLE_ENTRY for cmpccxadd. * config.gcc: Add cmpccxaddintrin.h. * config/i386/cpuid.h (bit_CMPCCXADD): New. * config/i386/i386-builtin-types.def: Add DEF_FUNCTION_TYPE(INT, PINT, INT, INT, INT) and DEF_FUNCTION_TYPE(LONGLONG, PLONGLONG, LONGLONG, LONGLONG, INT). * config/i386/i386-builtin.def (BDESC): Add new builtins. * config/i386/i386-c.cc (ix86_target_macros_internal): Define __CMPCCXADD__. * config/i386/i386-expand.cc (ix86_expand_special_args_builtin): Add new parameter to indicate constant position. Handle INT_FTYPE_PINT_INT_INT_INT and LONGLONG_FTYPE_PLONGLONG_LONGLONG_LONGLONG_INT. * config/i386/i386-isa.def (CMPCCXADD): Add DEF_PTA(CMPCCXADD). * config/i386/i386-options.cc (isa2_opts): Add -mcmpccxadd. (ix86_valid_target_attribute_inner_p): Handle cmpccxadd. * config/i386/i386.opt: Add option -mcmpccxadd. * config/i386/sync.md (cmpccxadd_<mode>): New define insn. * config/i386/x86gprintrin.h: Include cmpccxaddintrin.h. * doc/extend.texi: Document cmpccxadd. * doc/invoke.texi: Document -mcmpccxadd. * doc/sourcebuild.texi: Document target cmpccxadd. * config/i386/cmpccxaddintrin.h: New file. gcc/testsuite/ChangeLog: * g++.dg/other/i386-2.C: Add -mcmpccxadd. * g++.dg/other/i386-3.C: Ditto. * gcc.target/i386/avx-1.c: Ditto. * gcc.target/i386/funcspec-56.inc: Add new target attribute. * gcc.target/i386/sse-13.c: Add -mcmpccxadd. * gcc.target/i386/sse-23.c: Ditto. * gcc.target/i386/x86gprintrin-1.c: Ditto. * gcc.target/i386/x86gprintrin-2.c: Ditto. * gcc.target/i386/x86gprintrin-3.c: Ditto. * gcc.target/i386/x86gprintrin-4.c: Ditto. * gcc.target/i386/x86gprintrin-5.c: Ditto. * lib/target-supports.exp (check_effective_target_cmpccxadd): New. * gcc.target/i386/cmpccxadd-1.c: New test. * gcc.target/i386/cmpccxadd-2.c: Ditto.
2022-11-04Daily bump.GCC Administrator8-1/+504
2022-11-03c++: Quash -Wdangling-reference for member operator* [PR107488]Marek Polacek2-1/+33
-Wdangling-reference complains here: std::vector<int> v = ...; std::vector<int>::const_iterator it = v.begin(); while (it != v.end()) { const int &r = *it++; // warning } because it sees a call to __gnu_cxx::__normal_iterator<const int*, std::vector<int> >::operator* which returns a reference and its argument is a TARGET_EXPR representing the result of __gnu_cxx::__normal_iterator<const int*, std::vector<int> >::operator++ But 'r' above refers to one of the int elements of the vector 'v', not to a temporary object. Therefore the warning is a false positive. I suppose code like the above is relatively common (the warning broke cppunit-1.15.1 and a few other projects), so presumably it makes sense to suppress the warning when it comes to member operator*. In this case it's defined as reference operator*() const _GLIBCXX_NOEXCEPT { return *_M_current; } and I'm guessing a lot of member operator* are like that, at least when it comes to iterators. I've looked at _Fwd_list_iterator, _Fwd_list_const_iterator, __shared_ptr_access, _Deque_iterator, istream_iterator, etc, and they're all like that, so adding #pragmas would be quite tedious. :/ PR c++/107488 gcc/cp/ChangeLog: * call.cc (do_warn_dangling_reference): Quash -Wdangling-reference for member operator*. gcc/testsuite/ChangeLog: * g++.dg/warn/Wdangling-reference5.C: New test.
2022-11-03c++: requires-expr and access checking [PR107179]Patrick Palka2-0/+18
Like during satisfaction, we also need to avoid deferring access checks during substitution of a requires-expr because the outcome of an access check can determine the value of the requires-expr. Otherwise (in deferred access checking contexts such as within a base-clause), the requires-expr may evaluate to the wrong result, and along the way a failed access check may leak out from it into a non-SFINAE context and cause a hard error (as in the below testcase). PR c++/107179 gcc/cp/ChangeLog: * constraint.cc (tsubst_requires_expr): Make sure we're not deferring access checks. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-requires31.C: New test.
2022-11-03Add testcases resolved with ranger as VRP1.Andrew MacLeod3-0/+63
gcc/testsuite/ * g++.dg/pr99966.C: New. * gcc.dg/pr93917.c: New. * gcc.dg/pr102650.c: New.