aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-05-18graphite: Extend SCoP detection dump outputFrederik Harwath2-21/+219
Extend dump output to make understanding why Graphite rejects to include a loop in a SCoP easier (for GCC developers). gcc/ChangeLog: * graphite-scop-detection.cc (scop_detection::can_represent_loop): Output reason for failure to dump file. (scop_detection::harmful_loop_in_region): Likewise. (scop_detection::graphite_can_represent_expr): Likewise. (scop_detection::stmt_has_simple_data_refs_p): Likewise. (scop_detection::stmt_simple_for_scop_p): Likewise. (print_sese_loop_numbers): New function. (scop_detection::add_scop): Use from here. gcc/testsuite/ChangeLog: * gcc.dg/graphite/scop-22a.c: New test.
2022-05-18demangler: Reorganize for module demanglingNathan Sidwell1-139/+83
Module demangling requires some changes in how substitutions are handled. This adjusts things to make that possible. libiberty/ * cp-demangle.c (d_name): Add SUBSTABLE parameter, push substitution if requested. Adjust unscoped name handling. (d_prefix): Reorder main loop. Adjust all calls. (d_unqualified_name): Add SCOPE parameter, create qualified name here. Adjust all calls. (cplus_demangle_type): Do not handle 'S' here, leave all to d_class_enum_type. (d_class_enum_type): Add SUBSTABLE parameter.
2022-05-18'include/cuda/cuda.h': Add parts necessary for nvptx-tools 'nvptx-run'Thomas Schwinge1-1/+10
include/ * cuda/cuda.h (enum CUjit_option): Add 'CU_JIT_GENERATE_DEBUG_INFO', 'CU_JIT_GENERATE_LINE_INFO'. (enum CUlimit): Add 'CU_LIMIT_STACK_SIZE', 'CU_LIMIT_MALLOC_HEAP_SIZE'. (cuCtxSetLimit, cuGetErrorName): Add.
2022-05-18'include/cuda/cuda.h': For C++, wrap in 'extern "C"'Thomas Schwinge1-0/+8
include/ * cuda/cuda.h: For C++, wrap in 'extern "C"'.
2022-05-18OpenMP: Add Fortran support for inoutset depend-kindTobias Burnus13-13/+221
Fortran additions to the C/C++ + ME/libgomp commit r13-556-g2c16eb3157f86ae561468c540caf8eb326106b5f gcc/fortran/ChangeLog: * gfortran.h (enum gfc_omp_depend_op): Add OMP_DEPEND_INOUTSET. (gfc_omp_clauses): Enlarge ENUM_BITFIELD. * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Handle 'inoutset' depend modifier. * openmp.cc (gfc_match_omp_clauses, gfc_match_omp_depobj): Likewise. * trans-openmp.cc (gfc_trans_omp_clauses, gfc_trans_omp_depobj): Likewise. libgomp/ChangeLog: * libgomp.texi (OpenMP 5.1): Set 'inoutset' to Y. (OpenMP Context Selectors): Add missing comma. * testsuite/libgomp.fortran/depend-5.f90: Add inoutset test. * testsuite/libgomp.fortran/depend-6.f90: Likewise. * testsuite/libgomp.fortran/depend-7.f90: Likewise. * testsuite/libgomp.fortran/depend-inoutset-1.f90: New test. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/all-memory-1.f90: Add inoutset test. * gfortran.dg/gomp/all-memory-2.f90: Likewise. * gfortran.dg/gomp/depobj-1.f90: Likewise. * gfortran.dg/gomp/depobj-2.f90: Likewise.
2022-05-18[Ada] Fix proof of runtime unit s-imageuClaire Dross1-8/+1
Update to provers caused some proof regressions. Fix the proof by adding an assertion. gcc/ada/ * libgnat/s-imageu.adb (Set_Image_Unsigned): Change assertion.
2022-05-18[Ada] qnx-7.1: warning in sigtramp-qnx.c __gnat_sigtrampDoug Rupp1-1/+1
Fix compilation warning. The code was using a cast to struct sigcontext *, which doesn't exist. It worked by accident. gcc/ada/ * sigtramp-qnx.c: Change struct sigcontext * to mcontext_t *.
2022-05-18[Ada] arm-qnx-7.1: stack-checking and sigtramp implementationDoug Rupp1-43/+36
Rewrite and base on VxWorks RTP implementation. gcc/ada/ * sigtramp-arm-qnx.c: Rewrite.
2022-05-18[Ada] Adapt proof of double arithmetic runtime unitYannick Moy1-16/+67
After changes in Why3 and generation of VCs, ghost code needs to be adapted for proofs to remain automatic. gcc/ada/ * libgnat/s-aridou.adb (Big3): Change return type. (Lemma_Mult_Non_Negative, Lemma_Mult_Non_Positive): Reorder alphabetically. (Lemma_Concat_Definition, Lemma_Double_Big_2xxsingle): New lemmas. (Double_Divide, Scaled_Divide): Add assertions.
2022-05-18[Ada] Fix proof of runtime unit s-valeuClaire Dross1-4/+8
Update to provers caused some proof regressions. Fix the proof by changing ghost code. gcc/ada/ * libgnat/s-valueu.adb (Scan_Raw_Unsigned): Add assertions.
2022-05-18[Ada] Make sure output variable is always initializedKévin Le Gouguec1-0/+1
gcc/ada/ * libgnat/s-dwalin.adb (Read_Aranges_Header): Initialize output parameter in case we return early.
2022-05-18[Ada] Disable Vet calls when container checks are disabledBob Duff17-17/+79
Calls to various Vet functions are used throughout the containers packages to check internal consistency. This patch improves efficiency by disabling these calls when Container_Checks are suppressed. gcc/ada/ * libgnat/a-crbtgo.ads, libgnat/a-rbtgbo.ads, libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb, libgnat/a-cbhase.adb, libgnat/a-cdlili.adb, libgnat/a-cfdlli.adb, libgnat/a-cfhama.adb, libgnat/a-cfhase.adb, libgnat/a-cidlli.adb, libgnat/a-cihama.adb, libgnat/a-cihase.adb, libgnat/a-cohama.adb, libgnat/a-cohase.adb, libgnat/a-crbtgo.adb, libgnat/a-crdlli.adb, libgnat/a-rbtgbo.adb (Vet): Make the Vet functions do nothing when Container_Checks'Enabled is False, and inline them, so the calls disappear when optimizing.
2022-05-18[Ada] arm-qnx-7.1: undefined reference to fma* symbolsDoug Rupp1-1/+4
Configure the arm-qnx runtime packages to avoid generating these symbols. gcc/ada/ * Makefile.rtl (arm-qnx): Use default (non-fma) target pair.
2022-05-18[Ada] Fix DWARF parsing for 32-bit targets on 64-bit hostsKévin Le Gouguec1-25/+20
Currently, a 64-bit gnatsymbolize fails to output line numbers and accurate symbol names when run on 32-bit executables (and vice-versa). This is because a couple of spots in System.Dwarf_Lines expect the Address_Size found in the DWARF data to match the host Address'Size. This patch corrects that assumption. gcc/ada/ * libgnat/s-dwalin.adb (Aranges_Lookup, Enable_Cache): Adapt to changes in the signature of Read_Aranges_*. (Debug_Info_Lookup): Do not control address size read from DWARF. (Read_Aranges_Header): Do not control address size read from DWARF; return this size. (Read_Aranges_Entry): Use the size returned by Read_Aranges_Header.
2022-05-18[Ada] Improve error messages for occurrence of GNAT extensions without -gnatXGary Dismukes9-36/+32
The error message issued for use of GNAT extension features without specifying -gnatX (or pragma Extensions_Allowed) was confusing in the presence of a pragma specifying a language version (such as "pragma Ada_2022;"), because the pragma supersedes the switch. The message is improved by testing for use of such a pragma, plus use of pragma Extensions_Allowed is now suggested, and several cases are changed to call the common error procedure for flagging uses of extension features. gcc/ada/ * errout.ads (Error_Msg_GNAT_Extension): Add formal Loc and revise comment. * errout.adb (Error_Msg_GNAT_Extension): Condition message on the flag Ada_Version_Pragma, and add suggestion to use of pragma Extensions_Allowed in messages. * par-ch3.adb, par-ch5.adb, par-ch6.adb, par-ch11.adb, par-ch12.adb: Add actual Token_Ptr on calls to Error_Msg_GNAT_Extension. * par-ch4.adb: Change Error_Msg to Error_Msg_GNAT_Extension for error calls related to use of extension features. * sem_ch13.adb: Likewise.
2022-05-18[Ada] Fix Ada-QNX task priority conversionJohannes Kliemann1-1/+1
The conversion between OS and Ada priorties should be done in the wider Interfaces.C.int type rather than Any_Priority otherwise Constraint_Error will be raised when coverting Any_Priority'Last to int. gcc/ada/ * libgnarl/s-osinte__qnx.adb (To_Target_Priority): Perform arithmetic in int.
2022-05-18[Ada] Use specific predicate before manipulating BIP_Alloc_FormEric Botcazou1-4/+2
For the sake of consistency with other similar manipulations. gcc/ada/ * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Use Needs_BIP_Alloc_Form.
2022-05-18[Ada] Crash building VSS with compiler built with assertionsJavier Miranda4-3/+17
When a tagged type T has aspect String_Literal, a derived type defines a null extension T2, and the context to resolve the use of an object of type T2 where the string literal is applicable is a class-wide type the frontend crashes trying to evaluate if the object is a null extension. This problem does not reproduce when the compiler is built with assertions disabled. gcc/ada/ * sem_ch6.adb (Find_Corresponding_Spec): Avoid calling Is_Null_Extension with a class-wide type entity. (Overrides_Visible_Function): Handle alias entities. * sem_res.adb (Has_Applicable_User_Defined_Literal): Conversion not needed if the result type of the call is class-wide or if the result type matches the context type. * sem_util.ads (Is_Null_Extension): Adding documentation. (Is_Null_Extension_Of): Adding documentation. * sem_util.adb (Is_Null_Extension): Adding assertion. (Is_Null_Extension_Of): Adding assertions.
2022-05-18[Ada] Ada2022: AI12-0143 Index attribute for entry familiesJavier Miranda5-1/+344
gcc/ada/ * snames.ads-tmpl (Name_Index): New attribute name. (Attribute_Id): Adding Attribute_Index as regular attribute. * sem_attr.adb (Attribute_22): Adding Attribute_Index as Ada 2022 attribute. (Analyze_Index_Attribute): Check that 'Index appears in a pre-/postcondition aspect or pragma associated with an entry family. (Analyze_Attribute): Adding semantic analysis for 'Index. (Eval_Attribute): Register 'Index as can never be folded. (Resolve_Attribute): Resolve attribute 'Index. * sem_ch9.adb (Check_Wrong_Attribute_In_Postconditions): New subprogram. (Analyze_Requeue): Check that the requeue target shall not have an applicable specific or class-wide postcondition which includes an Index attribute reference. * exp_attr.adb (Expand_N_Attribute_Reference): Transform attribute Index into a renaming of the second formal of the wrapper built for an entry family that has contract cases. * einfo.ads (Is_Entry_Wrapper): Complete documentation.
2022-05-18[Ada] Fix proof of runtime unitsYannick Moy3-0/+9
Update to latest version of Why3 caused some proof regressions. Fix the proof by changing ghost code. gcc/ada/ * libgnat/s-imagei.adb (Set_Digits): Add assertion. * libgnat/s-imgboo.adb (Image_Boolean): Add assertions. * libgnat/s-valueu.adb (Scan_Raw_Unsigned): Add assertion.
2022-05-18[Ada] Errors missed on ACATS test B650007Arnaud Charlet2-14/+7
This ACATS test shows that we need to call Is_Immutably_Limited_Type in Analyze_Function_Return and also that we have a latent bug in Is_Immutably_Limited_Type which shouldn't look through private types. gcc/ada/ * sem_aux.adb (Is_Immutably_Limited_Type): Do not look through private types as per RM 7.5(8.1). * sem_ch6.adb (Analyze_Function_Return): Use Is_Immutably_Limited_Type as per RM 6.5(5.10).
2022-05-18[Ada] Fix the parsing for delta aggregateMarc Poulhiès3-1/+12
In Ada 2022, delta aggregate must use parentheses not square brackets except array delta aggregates. gcc/ada/ * gen_il-gen-gen_nodes.adb (Gen_IL.Gen.Gen_Nodes): Add Is_Homogeneous_Aggregate field for N_Delta_Aggregate nodes. * par-ch4.adb (P_Aggregate_Or_Paren_Expr): Minor reformatting. * sem_aggr.adb (Resolve_Delta_Aggregate): Reject square brackets for record aggregate. (Resolve_Record_Aggregate): Uniformise error message.
2022-05-18[Ada] Secondary stack and a-tagsArnaud Charlet3-66/+46
The simple use of Ada.Tags triggers a dependency on the secondary stack mechanism, which is unwanted on small embedded targets. To avoid this dependency, we special case a-tags.ali in ALI.Scan_ALI to not set Sec_Stack_Used. If some other code calls one of the functions returning a string, this code will also be marked as requiring the secondary stack. We also remove the need to import and set __gnat_binder_ss_count in this case by ensuring this variable defaults to 0. gcc/ada/ * ali.adb (Scan_ALI): Special case a-tags.ali when setting Sec_Stack_Used. * bindgen.adb (Gen_Adainit): Simplify handling of secondary stack related code, and only import __gnat_binder_ss_count when needed. * libgnat/s-secsta.adb (Binder_SS_Count): Default initialize to 0.
2022-05-18[Ada] Fix problematic underflow for Float_Type'ValueEric Botcazou2-1/+20
We need a couple of guards for boundary conditions in the support code. gcc/ada/ * libgnat/s-dourea.adb ("/"): Add guard for zero and infinite divisor. * libgnat/s-valuer.adb (Scan_Raw_Real): Add guard for very large exponent values.
2022-05-18[Ada] Spurious error on freezing of tagged types in SPARKYannick Moy1-1/+11
SPARK RM 7.7(8) mandates that the freezing point of a tagged type must occur within the so-called early call region of all its primitives. This check may lead to spurious errors due to generated constructs being considered in the search for the start of the early call region. gcc/ada/ * sem_elab.adb (Is_Suitable_Construct): Fix for generated constructs.
2022-05-18[Ada] Rework optimization skipping pragma check in object declarationMarc Poulhiès2-4/+8
When an object declaration is initialized with a type conversion: Var : Typ := Typ (Value); we skip the check for Typ's predicate as it is already checked during the type conversion. This is not correct when Var's subtype and the target subtype of the conversion do not statically match: Var : Typ := OtherTyp (Value); In such case, we can't skip the check of Typ's predicate. Fix minor typos in comment. gcc/ada/ * sem_ch3.adb (Analyze_Object_Declaration): Skip predicate check for type conversion if object's subtype and expression's subtype statically match. * exp_prag.adb (Expand_Pragma_Check): Typo fix in comment.
2022-05-18[Ada] Fix internal error on subprogram instantiationEric Botcazou2-1/+2
The compiler builds renamings for actuals of formal objects for debugging purposes in this case, but it must not generate them for temporaries. gcc/ada/ * exp_dbug.ads (Build_Subprogram_Instance_Renamings): Fix typo. * exp_dbug.adb (Build_Subprogram_Instance_Renamings): Build the renaming only for actuals of formal objects.
2022-05-18[Ada] Overriding error on type derived from discriminated untagged private typeGary Dismukes1-1/+9
When a derived type DT has an untagged private parent type PT with a discriminant, where the full type of PT is tagged, and DT inherits a function F with an anonymous access result that designates the type, the compiler wrongly reports an error saying that DT must be declared abstract or F overridden. A test is added to exclude checking the abstract overriding rules that should only apply to inherited subprograms of tagged derived types. gcc/ada/ * sem_ch3.adb (Check_Abstract_Overriding): If the type is derived from an untagged type, then don't perform any of the abstract overriding error checks.
2022-05-18[Ada] Prevent overflow in computation of aggregate sizePiotr Trojanek1-2/+2
When computing size of a static aggregate to decide if it should be transformed into assignments and loops we could have an overflow check. This is mostly harmless, because colossal aggregates will likely crash the application anyway, no matter how we transform them. This was not detected because compiler was built with -gnatg switch that suppresses overflow checks (they are only enabled by an explicit -gnato switch). gcc/ada/ * exp_aggr.adb (Component_Count): Calculate size as an Uint and only then check if it is in the range of Int, as otherwise the multiplication of Int values can overflow.
2022-05-18[Ada] Fast implementation of floating-point mathematical functionsEric Botcazou8-149/+439
This adds a package renaming unit to the GNAT hierarchy so as to expose the underlying implementation of floating-point mathematical functions, thus also making it possible to use their vector implementation, if any. The change also contains a small improvement to the Hide_Public_Entities mechanism in Sem_Ch7 that makes it possible to clear the Is_Public flag within instances of generic packages that do not have a body. gcc/ada/ * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-gfmafu$(objext). (SIMD_PATH_TARGET_PAIRS): New variable. (TRASYM_DWARF_COMMON_OBJS): Minor tweak. (x86-64/Linux): Use SIMD_PATH_TARGET_PAIRS. (x32/Linux): Likewise. * doc/gnat_rm/the_gnat_library.rst (Generic_Fast_Math_Functions): New entry. * gnat_rm.texi: Regenerate. * impunit.adb (Non_Imp_File_Names_95): Add g-gfmafu. * sem_ch7.adb (Has_Referencer): Do not set In_Nested_Instance for instances of generic packages that do not have a body. * libgnat/a-nalofl__simd.ads: New SIMD-enabled version. * libgnat/a-nuaufl__simd.ads: Likewise. * libgnat/g-gfmafu.ads: New package renaming unit.
2022-05-18[Ada] Freezing too strict in instancesArnaud Charlet1-7/+10
Should_Freeze_Type is relaxed to only take the relevant case into account (entities denoted by generic actual parameters as per 13.14(5/3), as well as profile of any subprograms named as per 13.14(10.2/4)), instead of being overly conservative wrt instances and as a result, wrongly rejecting some legal code. In practice this means we only need to worry about profile of subprograms named as part of instances. gcc/ada/ * freeze.adb (Should_Freeze_Type): Fix handling of freezing in instances.
2022-05-18[Ada] Fix incorrect freezing with generic child unitMarc Poulhiès1-2/+2
The Analyze_Associations.Check_Generic_Parent function was using an incorrect node as the instanciation node for the actual, possibly leading to incorrect freeze node being created (and later crashing in gigi). Using Get_Unit_Instantiation_Node fixes the issue. gcc/ada/ * sem_ch12.adb (Check_Generic_Parent): Use Get_Unit_Instantiation_Node instead of Next.
2022-05-18[Ada] Ada.Numerics.Aux.*: Mention more Intrinsic and less C Math LibraryAlexandre Oliva4-18/+27
Since we import the elemental math functions as intrinsics, it's not accurate to state we're drawing them in from the C math library. gcc/ada/ * libgnat/a-nagefl.ads: Replace mentions of C/unix math library with intrinsics. * libgnat/a-nallfl.ads: Likewise. State compatibility requirements. * libgnat/a-nalofl.ads: Likewise. * libgnat/a-nuaufl.ads: Likewise.
2022-05-18[Ada] Small performance tweak in recent changeEric Botcazou1-2/+1
This avoids a useless walk of the prefix chain in instances. gcc/ada/ * sem_ch8.adb (Analyze_Subprogram_Renaming): Move final test on In_Instance to outer condition.
2022-05-18[Ada] New port arm-qnxDoug Rupp4-9/+174
The QNX system specs for ARM and AARCH64 are identical. It makes more sense to have it named for the base architecture. gcc/ada/ * Makefile.rtl: Rename system-qnx-aarch64.ads to system-qnx-arm.ads. (AARCH64 QNX section): Modify to handle both arm and arch64. * tracebak.c (__QNX__): Add new __ARMEL__ section. * sigtramp-arm-qnx.c: New file. * libgnat/system-qnx-aarch64.ads: Renamed to ... * libgnat/system-qnx-arm.ads: this.
2022-05-18Enhance final_value_replacement_loop to handle bitwise induction.liuhongt8-1/+652
This patch will enable below optimization: { - int bit; - long long unsigned int _1; - long long unsigned int _2; - <bb 2> [local count: 46707768]: - - <bb 3> [local count: 1027034057]: - # tmp_11 = PHI <tmp_8(3), tmp_6(D)(2)> - # bit_13 = PHI <bit_9(3), 63(2)> - _1 = 1 << bit_13; - _2 = ~_1; - tmp_8 = _2 & tmp_11; - bit_9 = bit_13 + -3; - if (bit_9 != -3(OVF)) - goto <bb 3>; [95.65%] - else - goto <bb 4>; [4.35%] - - <bb 4> [local count: 46707768]: - return tmp_8; + tmp_12 = tmp_6(D) & 7905747460161236406; + return tmp_12; } gcc/ChangeLog: PR middle-end/103462 * match.pd (bitwise_induction_p): New match. * tree-scalar-evolution.cc (gimple_bitwise_induction_p): Declare. (analyze_and_compute_bitwise_induction_effect): New function. (enum bit_op_kind): New enum. (final_value_replacement_loop): Enhanced to handle bitwise induction. gcc/testsuite/ChangeLog: * gcc.target/i386/pr103462-1.c: New test. * gcc.target/i386/pr103462-2.c: New test. * gcc.target/i386/pr103462-3.c: New test. * gcc.target/i386/pr103462-4.c: New test. * gcc.target/i386/pr103462-5.c: New test. * gcc.target/i386/pr103462-6.c: New test.
2022-05-18This patch adds a combine pattern for "CA minus one". The SImode "CA minus ↵Haochen Gui2-0/+24
one" can be converted to DImode as CA only has two values (0 or 1). gcc/ PR target/95737 * config/rs6000/rs6000.md (*subfsi3_carry_in_xx_64): New. gcc/testsuite/ PR target/95737 * gcc.target/powerpc/pr95737.c: New.
2022-05-18recognize bzhi pattern when there's zero_extendsidi.liuhongt2-0/+25
backend has 16550(define_insn "*bmi2_bzhi_<mode>3_2" 16551 [(set (match_operand:SWI48 0 "register_operand" "=r") 16552 (and:SWI48 16553 (plus:SWI48 16554 (ashift:SWI48 (const_int 1) 16555 (match_operand:QI 2 "register_operand" "r")) 16556 (const_int -1)) 16557 (match_operand:SWI48 1 "nonimmediate_operand" "rm"))) 16558 (clobber (reg:CC FLAGS_REG))] 16559 "TARGET_BMI2" 16560 "bzhi\t{%<k>2, %1, %0|%0, %1, %<k>2}" 16561 [(set_attr "type" "bitmanip") 16562 (set_attr "prefix" "vex") 16563 (set_attr "mode" "<MODE>")]) But there's extra zero_extend in pattern match. 424Failed to match this instruction: 425(parallel [ 426 (set (reg:DI 90) 427 (zero_extend:DI (and:SI (plus:SI (ashift:SI (const_int 1 [0x1]) 428 (subreg:QI (reg:SI 98) 0)) 429 (const_int -1 [0xffffffffffffffff])) 430 (subreg:SI (reg:DI 95) 0)))) 431 (clobber (reg:CC 17 flags)) 432 ]) Add new define_insn for it. gcc/ChangeLog: PR target/104375 * config/i386/i386.md (*bmi2_bzhi_zero_extendsidi_4): New define_insn. gcc/testsuite/ChangeLog: * gcc.target/i386/pr104375.c: New test.
2022-05-18Expand __builtin_memcmp_eq with ptest for OImode.liuhongt3-1/+38
gcc/ChangeLog: PR target/104610 * config/i386/i386-expand.cc (ix86_expand_branch): Use ptest for QImode when code is EQ or NE. * config/i386/i386.md (cbranchoi4): New expander. gcc/testsuite/ChangeLog: * gcc.target/i386/pr104610.c: New test.
2022-05-17rs6000: Prefer assigning the MMA vector operands to altivec registers [PR105556]Peter Bergner1-75/+75
When optimizing the DGEMM kernel in OpenBLAS to use MMA, the MMA code uses all 8 accumulators, which overlap all vs0-vs31 vector registers. Current trunk assigns one of the normal vector inputs to one of the MMA instructions, which forces us to spill one of the accumulators to memory, leading to poor performance. The solution here is to replace the "wa" constraints for the vector input operands in the MMA instruction patterns with "v,?wa" so that we prefer using the altivec registers vs32-vs63 over the vs0-vs31 registers. 2022-05-17 Peter Bergner <bergner@linux.ibm.com> Segher Boessenkool <segher@kernel.crashing.org> gcc/ PR target/105556 * config/rs6000/mma.md (mma_<vv>, mma_<avv>, mma_<pv>, mma_<apv>, mma_<vvi4i4i8>, mma_<avvi4i4i8>, mma_<vvi4i4i2>, mma_<avvi4i4i2>, mma_<vvi4i4>, mma_<avvi4i4>, mma_<pvi4i2>, mma_<apvi4i2>, mma_<vvi4i4i4>, mma_<avvi4i4i4>): Replace "wa" constraints with "v,?wa". Update other operands accordingly.
2022-05-18Daily bump.GCC Administrator12-1/+597
2022-05-17compiler: load LHS subexpressions of op= assignment only onceIan Lance Taylor2-1/+11
Fixes golang/go#52811 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/405617
2022-05-17c++: constexpr ref to array of array [PR102307]Jason Merrill2-5/+24
The problem here is that first check_initializer calls build_aggr_init_full_exprs, which does overload resolution, but then in the case of failed constexpr throws away the result and does it again in build_functional_cast. But in the first overload resolution, reshape_init_array_1 decided to reuse the inner CONSTRUCTORs because tf_error is set, so we know we're committed. But the second pass gets confused by the CONSTRUCTORs with non-init-list types. Fixed by avoiding a second pass: instead, pass the call from build_aggr_init to build_cplus_new, which will turn it into a TARGET_EXPR. I don't bother to change the object argument because it will be replaced later in simplify_aggr_init_expr. PR c++/102307 gcc/cp/ChangeLog: * decl.cc (check_initializer): Use build_cplus_new in case of constexpr failure. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/constexpr-array2.C: New test.
2022-05-17c: use CONST_DECL for enumerators in TYPE_VALUESMarek Polacek2-5/+8
The C and C++ FEs differ in TYPE_VALUES for an enum type: an entry in the list in the C++ FE has a CONST_DECL in the TREE_VALUE, but the C FE has only the numerical value of the CONST_DECL there. This has caused me some trouble in my PR105497 patch. Using a CONST_DECL is preferable because a CONST_DECL can track more information (e.g., attributes), and you can always get the value simply by looking at its DECL_INITIAL. This turned out to be a trivial change. One place in godump.cc had to be adjusted. I'm not changing the CONST_DECL check in c_do_switch_warnings because I'll be changing it soon in my next patch. I didn't see any other checks that this patch makes redundant. gcc/c/ChangeLog: * c-decl.cc (finish_enum): Store the CONST_DECL into TREE_VALUE, not its value. gcc/ChangeLog: * godump.cc (go_output_typedef): Use the DECL_INITIAL of the TREE_VALUE.
2022-05-17Fix register count when not splitting Complex IEEE 128-bit args.Pat Haugen1-0/+6
For ABI_V4, we do not split complex args. This created a problem because even though an arg would be passed in two VSX regs, we were only advancing the function arg counter by one VSX register. Fixed with this patch. PR target/99685 gcc/ * config/rs6000/rs6000-call.cc (rs6000_function_arg_advance_1): Bump register count when not splitting IEEE 128-bit Complex.
2022-05-17OpenMP: Skip target-nesting warning for reverse offloadTobias Burnus2-0/+38
gcc/ChangeLog: * omp-low.cc (check_omp_nesting_restrictions): Skip warning for target inside target if inner is reverse offload. gcc/testsuite/ChangeLog: * c-c++-common/gomp/target-device-ancestor-5.c: New test.
2022-05-17libstdc++: Relax memory ordering for default memory resource objectJonathan Wakely1-6/+6
Currently pmr::set_default_resource and pmr::get_default_resource both use sequentially consistent memory ordering. This is overkill. The standard only requires that a call to set_default_resource synchronizes with subsequent calls to set_default_resource and get_default_resource. Using acquire-release for the setter and acquire for the getter is sufficient to meet the requirement. Reviewed-by: Thomas Rodgers <trodgers@redhat.com> libstdc++-v3/ChangeLog: * src/c++17/memory_resource.cc (set_default_resource): Use memory_order_acq_rel. (get_default_resource): Use memory_order_acquire.
2022-05-17libstdc++: Add attributes to functions in <memory_resource>Jonathan Wakely1-5/+25
Add attributes to the accessors for the global memory resource objects, to allow the compiler to eliminate redundant calls to them. For example, multiple calls to std::pmr::new_delete_resource() will always return the same object, and so the compiler can replace them with a single call. Ideally we would like adjacent calls to std::pmr::get_default_resource() to be combined into a single call by the CSE pass. The 'pure' attribute would permit that. However, the standard requires that calls to std::pmr::set_default_resource() synchronize with subsequent calls to std::pmr::get_default_resource(). With 'pure' the DCE pass might eliminate seemingly redundant calls to std::pmr::get_default_resource(). That might be unsafe, because the caller might be relying on the associated synchronization. We could use a hypothetical attribute that allows CSE but not DCE, but we don't have one. So it can't be 'pure'. Also add [[nodiscard]] to equality operators. libstdc++-v3/ChangeLog: * include/std/memory_resource (new_delete_resource): Add nodiscard, returns_nonnull and const attributes. (null_memory_resource): Likewise. (set_default_resource, get_default_resource): Add returns_nonnull attribute. (memory_resource::is_equal): Add nodiscard attribute. (operator==, operator!=): Likewise.
2022-05-17libstdc++: Add attributes to <system_error> and relatedJonathan Wakely3-3/+29
Add the const attribute to std::future_category() and std::iostream_category(), to match the existing attributes on std::generic_category() and std::system_category(). Also add [[nodiscard]] to those functions and to the comparison operators for std::error_code and std::error_condition, and to std::make_error_code and std::make_error_condition overloads. libstdc++-v3/ChangeLog: * include/bits/ios_base.h (io_category): Add const and nodiscard attributes. (make_error_code, make_error_condition): Add nodiscard. * include/std/future (future_category): Add const and nodiscard. (make_error_code, make_error_condition): Add nodiscard. * include/std/system_error (generic_category system_category): Add nodiscard. Replace _GLIBCXX_CONST with C++11 attribute. (error_code::value, error_code::category, error_code::operator bool) (error_condition::value, error_condition::category) (error_condition::operator bool, make_error_code) (make_error_condition, operator==, operator!=, operator<=>): Add nodiscard.
2022-05-17Revert 'Use more ARRAY_SIZE.' for mkoffloadTobias Burnus2-4/+4
Revert commit r13-472-gca32b29ec3e92dcf8dda5c2501d0baf9dd1cb09d partially; namely for {gcn,nvptx}/mkoffload.cc, only. The patch changed 'sizeof(...)/sizeof(...[0])' to the 'ARRAY_SIZE' macro, which is in principle a good idea – except that in the two mkoffload.cc, the change happened inside a string that is used to generate plain C code. With offlading to nvptx or gcn, the mkoffload genenates then the C file and compilation of the latter fails with "warning: implicit declaration of function 'ARRAY_SIZE'" followed by "error: initializer element is not constant" gcc/ * config/gcn/mkoffload.cc (process_obj): Revert: Use ARRAY_SIZE. * config/nvptx/mkoffload.cc (process): Likewise.