aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
3 daysada: Document hardening features not supported by LLVMJose Ruiz3-1/+5
gcc/ada/ChangeLog: * doc/gnat_rm/security_hardening_features.rst: clarify that hardening options are not supported by the LLVM back end. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
3 daysada: Avoid ghost context errors when preanalyzing Loop_InvariantViljar Indus1-0/+6
gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Pragma): Disable context checks for the preanalysis of the expression for Loop_Invariant pragmas as the ghost region for the pragma has not been set up yet.
3 daysada: Match assertion levels by nameViljar Indus1-1/+1
Since Assertion_Levels cannot be named after valid assertion names we no longer need the policies to be matched by entity. gcc/ada/ChangeLog: * sem_prag.adb (Get_Applicable_Policy): Match assertion levels by name.
3 daysada: C_Pass_By_Copy convention incorrectly ignoredSteve Baird2-2/+29
In some cases involving a convention-C anonymous access-to-subprogram type with a parameter whose type has a convention of C_Pass_By_Copy, that C_Pass_By_Copy convention is incorrectly ignored. gcc/ada/ChangeLog: * freeze.adb (Freeze_Entity): In the case of an anonymous access-to-subprogram type where Do_Freeze_Profile is True, freeze the designated subprogram type. (Should_Freeze_Type): Do not call Unit_Declaration_Node with a parentless argument. * sem_ch3.adb (Analyze_Object_Declaration): When calling Freeze_Before, override the default value for Do_Freeze_Profile. This is needed in some cases to prevent premature freezing in the case of an object of an anonymous access-to-subprogram type.
3 daysada: Add Assertion_Policy checks for assertion levelsViljar Indus1-0/+16
Implement SPARK RM 6.9(19) check: An Assertion_Policy pragma specifying an Assertion_Level policy shall not occur within a ghost subprogram or package associated to an assertion level which depends on this level. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Pragma): Add ghost level check to Assertion_Policy.
3 daysada: Fix ghost condition for level dependencies for assignmentsViljar Indus1-3/+5
gcc/ada/ChangeLog: * ghost.adb (Check_Assignment_Policies): The level of the assignee should depend on the level of the region.
3 daysada: Remove checks for the old rule 20Viljar Indus1-43/+5
This rule was removed. This can scenario can be detected by Rule 18. gcc/ada/ChangeLog: * ghost.adb (Is_Ok_Pragma): Remove calls to Check_Policies.
3 daysada: Update ghost code SPARK RM rulesViljar Indus9-54/+54
gcc/ada/ChangeLog: * contracts.adb: Update SPARK RM reference numbers. * freeze.adb: Likewise. * ghost.adb: Likewise. * ghost.ads: Likewise. * sem_ch12.adb: Likewise. * sem_ch3.adb: Likewise. * sem_ch6.adb: Likewise. * sem_prag.adb: Likwise. * sem_res.adb: Likewise.
3 daysada: Refactor ghost argument consistency checksViljar Indus2-158/+172
Create a new method for checking and emitting errors on pragmas Unused, Unrefefrenced, Unreferenced_Objects, Inline and No_Return that support specifying multiple entities as arguments. Emit an error when one argument is ghost and the other is not and when one argument has a ghost policy check and the other has ghost policy ignore. Update the Suppressed_Ghost_Policy_Check_Pragma list pragma Inline that should be there to avoid an incorrect invalid pragma context error. gcc/ada/ChangeLog: * sem_prag.adb (Check_Inconsistent_Argument_Ghostliness): new method for handling the ghost constency errors between different arguments. Use this method in the processing for pragmas Unused, Unrefefrenced, Unreferenced_Objects, Inline and No_Return. * sem_prag.ads (Suppressed_Ghost_Policy_Check_Pragma): add missing entry for pragma Inline.
3 daysada: Fix the condition of ghost level dependencies inside assignmentsViljar Indus1-8/+5
The assignee should depend on the level of all of the ghost entiies with the assignment. gcc/ada/ChangeLog: * ghost.adb (Check_Assignee_Levels): Fix the condition and improve error message handling.
3 daysada: Add System.C_Time and GNAT.C_Time units to libgnatNicolas Boulenguez72-2371/+765
The first unit provides the time_t, timeval and timespec types corresponding to the C types defined by the OS, as well as various conversion functions. The second unit is a mere renaming of the first under the GNAT hierarchy. This removes C time types and conversions under System, and from bodies and private parts under GNAT, while keeping visible types and conversions under GNAT as Obsolescent. gcc/ada/ChangeLog: PR ada/114065 * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-c_time$(objext) and s-c_time$(objext). (Aarch64/Android): Do not use s-osinte__android.adb. (SPARC/Solaris): Do not use s-osprim__solaris.adb. (x86/Solaris): Likewise. (LynxOS178): Do not use s-parame__posix2008.ads. (RTEMS): Likewise. (x32/Linux): Likewise, as well as s-linux__x32.ads. Replace s-osprim__x32.adb with s-osprim__posix.adb. (LIBGNAT_OBJS): Remove cal.o. * cal.c: Delete. * doc/gnat_rm/the_gnat_library.rst (GNAT.C_Time): New entry. (GNAT.Calendar): Do not mention the obsolete conversion functions. * impunit.adb (Non_Imp_File_Names_95): Add g-c_time. * libgnarl/a-exetim__posix.adb: Add with clause for System.C_Time (Clock): Use type and functions from System.C_Time. * libgnarl/s-linux.ads: Remove with clause for System.Parameters. Remove declarations of C time types. * libgnarl/s-linux__alpha.ads: Likewise. * libgnarl/s-linux__android-aarch64.ads: Likewise. * libgnarl/s-linux__android-arm.ads: Likewise. * libgnarl/s-linux__hppa.ads: Likewise. * libgnarl/s-linux__loongarch.ads: Likewise. * libgnarl/s-linux__mips.ads: Likewise. * libgnarl/s-linux__riscv.ads: Likewise. * libgnarl/s-linux__sparc.ads: Likewise. * libgnarl/s-osinte__aix.ads: Likewise. * libgnarl/s-osinte__android.ads: Likewise. * libgnarl/s-osinte__cheribsd.ads: Likewise. * libgnarl/s-osinte__darwin.ads: Likewise. * libgnarl/s-osinte__dragonfly.ads: Likewise. * libgnarl/s-osinte__freebsd.ads: Likewise. * libgnarl/s-osinte__gnu.ads: Likewise. * libgnarl/s-osinte__hpux.ads: Likewise. * libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise. * libgnarl/s-osinte__linux.ads: Likewise. * libgnarl/s-osinte__lynxos178e.ads: Likewise. * libgnarl/s-osinte__qnx.ads: Likewise. * libgnarl/s-osinte__rtems.ads: Likewise. * libgnarl/s-osinte__solaris.ads: Likewise. * libgnarl/s-osinte__vxworks.ads: Likewise. * libgnarl/s-qnx.ads: Likewise. * libgnarl/s-linux__x32.ads: Delete. * libgnarl/s-osinte__darwin.adb (To_Duration): Remove. (To_Timespec): Likewise. * libgnarl/s-osinte__aix.adb: Likewise. * libgnarl/s-osinte__dragonfly.adb: Likewise. * libgnarl/s-osinte__freebsd.adb: Likewise. * libgnarl/s-osinte__gnu.adb: Likewise. * libgnarl/s-osinte__lynxos178.adb: Likewise. * libgnarl/s-osinte__posix.adb: Likewise. * libgnarl/s-osinte__qnx.adb: Likewise. * libgnarl/s-osinte__rtems.adb: Likewise. * libgnarl/s-osinte__solaris.adb: Likewise. * libgnarl/s-osinte__vxworks.adb: Likewise. * libgnarl/s-osinte__x32.adb: Likewise. * libgnarl/s-taprop__solaris.adb: Add with clause for System.C_Time. (Monotonic_Clock): Use type and functions from System.C_Time. (RT_Resolution): Likewise. (Timed_Sleep): Likewise. (Timed_Delay): Likewise. * libgnarl/s-taprop__vxworks.adb: Likewise. * libgnarl/s-tpopmo.adb: Likewise. * libgnarl/s-osinte__android.adb: Delete. * libgnat/g-c_time.ads: New file. * libgnat/g-calend.adb: Delegate to System.C_Time. * libgnat/g-calend.ads: Likewise. * libgnat/g-socket.adb: Likewise. * libgnat/g-socthi.adb: Likewise. * libgnat/g-socthi__vxworks.adb: Likewise. * libgnat/g-sothco.ads: Likewise. * libgnat/g-spogwa.adb: Likewise. * libgnat/s-c_time.adb: New file. * libgnat/s-c_time.ads: Likewise. * libgnat/s-optide.adb: Import nanosleep here. * libgnat/s-os_lib.ads (time_t): Remove. (To_Ada): Adjust. (To_C): Likewise. * libgnat/s-os_lib.adb: Likewise. * libgnat/s-osprim__darwin.adb: Delegate to System.C_Time. * libgnat/s-osprim__posix.adb: Likewise. * libgnat/s-osprim__posix2008.adb: Likewise. * libgnat/s-osprim__rtems.adb: Likewise. * libgnat/s-osprim__unix.adb: Likewise. * libgnat/s-osprim__solaris.adb: Delete. * libgnat/s-osprim__x32.adb: Likewise. * libgnat/s-parame.ads (time_t_bits): Remove. * libgnat/s-parame__hpux.ads: Likewise. * libgnat/s-parame__vxworks.ads: Likewise. * libgnat/s-parame__posix2008.ads: Delete. * s-oscons-tmplt.c (SIZEOF_tv_nsec): New constant. * gnat_rm.texi: Regenerate.
3 daysada: Fix crash on iterator of type with Constant_Indexing aspectEric Botcazou1-2/+7
This happens when the type returned by the indexing function is a private type whose completion is derived from another private type, because the Finalize_Address routine cannot correctly fetch the actual root type. gcc/ada/ChangeLog: * exp_util.adb (Finalize_Address): In an untagged derivation, call Root_Type on the full view of the base type if the partial view is itself not a derived type. (Is_Untagged_Derivation): Minor formatting tweak.
3 daysada: Fix missing finalization for qualified expression in conditional expressionEric Botcazou5-6/+46
A qualified expression around a function call may cause a temporary to be created and, therefore, cannot be bypassed in Expand_Ctrl_Function_Call. gcc/ada/ChangeLog: * exp_util.ads (Unqualified_Unconditional_Parent): New function. * exp_util.adb (Unconditional_Parent): Do not look through qualified expressions. (Unqualified_Unconditional_Parent): New function identical to the original Unconditional_Parent. * exp_aggr.adb (Convert_To_Assignments): Replace Unconditional_Parent with Unqualified_Unconditional_Parent. (Expand_Array_Aggregate): Likewse. * exp_ch4.adb (Expand_N_Case_Expression): Likewise. (Expand_N_If_Expression): Likewise. * exp_ch6.adb (Expand_Ctrl_Function_Call): Do not bypass an enclosing qualified expression in the parent chain.
3 daysada: Fix section of Finalizable extension in GNAT RMRonan Desplanques3-321/+321
The generalized finalization extension was awarded the title of curated extension some time ago, but this wasn't reflected in the GNAT reference manual before this patch, which moves the documentation for generalized finalization in the curated extension section. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Fix section of Finalizable. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
3 daysada: Avoid ghost context check in early freezeViljar Indus1-0/+9
We freeze the expression for expression functions that complete before we have set up the ghost region from both the existing spec and body. Avoid triggering the ghost context checks during the analysis for this early freeze as the expression will be reanalyzed when we analyze the new function body created for the expression function. gcc/ada/ChangeLog: * sem_ch6.adb (Analyze_Expression_Function): Disable ghost checks during the early freeze.
3 daysada: Implement Super aspect and improve implementation of related features.Steve Baird7-344/+517
Implement the GNAT-defined Super aspect (which should not be confused with with the Super attribute). For a two-part constructor procedure declaration, an Initialize aspect specification is permitted on the subprogram body, and not on the subprogram specification (this reverses was what was previously implemented). Improve the implementation of the Make attribute. gcc/ada/ChangeLog: * aspects.ads: Define Super aspect; allow Initialize aspect specification on a subprogram body. * exp_attr.adb (Expand_N_Attribute_Reference): Rewrite Make attribute implementation. * exp_ch3.adb (Initialization_Control): Delete Initialization_Mode and Make_Mode_Literal (those declarations were moved to the spec). (Build_Record_Init_Proc): For a constructor type, component initialization (other than for the tag component, if any) must be performed by calling the single-argument constructor procedure. (Requires_Init_Proc): Return True for a constructor type. * exp_ch3.ads (Make_Mode_Literal, Initialization_Mode): New, moved from the body of this package. * exp_ch6.adb (Expand_N_Subprogram_Body): Declare, implement, and call a new local procedure, Prepend_Constructor_Procedure_Prologue in order to generate component initialization for a constructor procedure. * sem_attr.adb (Analyze_Attribute): Improve the error message generated for a 'Make attribute reference if GNAT extensions are not all allowed. * sem_ch13.adb (Analyze_One_Aspect): Improved implementation of aspect specifications for Initialize, Constructor, and Super aspects. For Super, there was no previous implementation.
3 daysada: Improve ghost region creation for pragmasViljar Indus6-43/+106
gcc/ada/ChangeLog: * atree.adb (Mark_New_Ghost_Node): Set Is_Implicit_Ghost for all newly created nodes. * gen_il-fields.ads (Is_Implicit_Ghost): New attribute. * gen_il-gen-gen_entities.adb (Entity_Kind): Add Is_Implicit_Ghost attribute. * ghost.adb (Ghost_Policy_In_Effect): Implicit_Ghost_Entities inside pragmas get the ghost mode from the region isntead of the global ghost policy. (Ghost_Assertion_Level_In_Effect): New function that returns the applicable assertion level for the given entity in a similar manner as Ghost_Policy_In_Effect. (Install_Ghost_Region): Set Is_Inside_Statement_Or_Pragma attribute. (Mark_And_Set_Ghost_Body): Update the logic for deriving the ghost region. (Set_Ghost_Mode): Ignored pragmas attached to checked ghost entities now create an ignored ghost region. Pragmas attached to non-ghost entities create the ghost region based on the policy applied to the given pragma. * opt.ads (Ghost_Config_Type): add new attribute Is_Inside_Statement_Or_Pragama to track whether we should take the active ghost mode from the ghost region for implicit ghost entities. * sem_prag.adb (Analyze_Pragma): Mark entities that have an explicit ghost pragma as non-implicit ghost.
3 daysada: Remove the note that GNAT LLVM doesn't ship the light runtimeSebastian Poeplau1-2/+1
gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Remove the note on light runtimes.
3 daysada: Recommend GPR's Toolchain_Name for GNAT LLVM more prominentlySebastian Poeplau2-30/+26
gcc/ada/ChangeLog: * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Move recommendation of Toolchain_Name up. * gnat_ugn.texi: Regenerate.
3 daysada: Don't generate call of `System.Standard_Library.Adafinal`Vadim Godunko1-2/+7
`adafinal` is not available on targets without standard library. gcc/ada/ChangeLog: * bindgen.adb (Gen_Adafinal): Don't generate call of adafinal when use of standard library suppressed.
3 daysada: Fix code generation when there is no No_Finalization restictionVadim Godunko1-1/+3
Check whether library is elaborated is not generated when there is not standard library available on target. gcc/ada/ChangeLog: * bindgen.adb (Gen_Adafinal): Don't generate code when use of standard library suppressed.
3 daysada: Add `Set_[Wide_]Wide_String` subprograms to auxiliary packages.Vadim Godunko6-0/+94
gcc/ada/ChangeLog: * libgnat/a-swunau.ads (Set_Wide_String): New subprogram. * libgnat/a-swunau.adb (Set_Wide_String): Likewise. * libgnat/a-swunau__shared.adb (Set_Wide_String): Likewise. * libgnat/a-szunau.ads (Set_Wide_Wide_String): Likewise. * libgnat/a-szunau.adb (Set_Wide_Wide_String): Likewise. * libgnat/a-szunau__shared.adb (Set_Wide_Wide_String): Likewise.
3 daysada: Disable ghost context checks before context is setViljar Indus3-0/+55
There are cases where we need to analyze the argument of the pragma in order to determine the ghostliness of the pragma. However during that analysis the ghost region of the pragma is not set yet so we cannot perform the ghost context checks at that moment. This patch provides the mechanism for disabling ghost context checks and disables them for pragma arguments that determine the ghostliness of the pragma. gcc/ada/ChangeLog: * ghost.adb (Check_Ghost_Context): Avoid context checks when they are globally disabled. * sem.ads (Ghost_Context_Checks_Disabled): New flag to control whether ghost context checks are activated or not. * sem_prag.adb (Analyze_Pragma): Disable ghost context checks for pragmas that determine their ghostliness based on one of its arguments.
3 daysada: Fix documentation of Is_Ancestor_PackageRonan Desplanques2-5/+5
"Is_Ancestor_Package (E, E)" returns True and this patch fixes a comment that claimed otherwise. This patch also renames an object local to Is_Ancestor_Package that was misleadingly named "Par", a common abbreviation of "Parent". gcc/ada/ChangeLog: * sem_util.ads (Is_Ancestor_Package): Fix documentation comment. * sem_util.adb (Is_Ancestor_Package): Rename local object.
3 daysmatch.pd: Add missing type check to reduc(ctor) pattern [PR121772]Alex Coplan2-0/+6
In this PR we have a reduction of a vector constructor, where the type of the constructor is int16x8_t and the elements are int16x4_t; i.e. it is representing a concatenation of two vectors. This triggers a match.pd pattern which looks like it was written to handle reductions of vector constructors where the elements of the ctor are scalars, not vectors. There is no type check to enforce this property, which leads to the pattern replacing a reduction to scalar with an int16x4_t vector in this case, which of course is a type error, leading to an invalid GIMPLE ICE. This patch adds a type check to the pattern, only going ahead with the transformation if the element type of the ctor matches that of the reduction. gcc/ChangeLog: PR tree-optimization/121772 * match.pd: Add type check to reduc(ctor) pattern. gcc/testsuite/ChangeLog: PR tree-optimization/121772 * gcc.target/aarch64/torture/pr121772.c: New test.
3 daysAVR: Support AVR32EB14/20/28/32.Georg-Johann Lay2-1/+5
Add support for some recent AVR devices. gcc/ * config/avr/avr-mcus.def: Add avr32eb14, avr32eb20, avr32eb28, avr32eb32. * doc/avr-mmcu.texi: Rebuild.
3 daysx86: Don't align destination for a single instructionH.J. Lu11-24/+187
If a single instruction can store or move the whole block of memory, use vector instruction and don't align destination. gcc/ PR target/121934 * config/i386/i386-expand.cc (ix86_expand_set_or_cpymem): If a single instruction can store or move the whole block of memory, use vector instruction and don't align destination. gcc/testsuite/ PR target/121934 * gcc.target/i386/pr121934-1a.c: New test. * gcc.target/i386/pr121934-1b.c: Likewise. * gcc.target/i386/pr121934-2a.c: Likewise. * gcc.target/i386/pr121934-2b.c: Likewise. * gcc.target/i386/pr121934-3a.c: Likewise. * gcc.target/i386/pr121934-3b.c: Likewise. * gcc.target/i386/pr121934-4a.c: Likewise. * gcc.target/i386/pr121934-4b.c: Likewise. * gcc.target/i386/pr121934-5a.c: Likewise. * gcc.target/i386/pr121934-5b.c: Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 daysLoongArch: Fix wrong code from bstrpick splitXi Ruoyao2-7/+38
After late-combine is added, split1 can see an input like (insn 56 55 169 5 (set (reg/v:DI 87 [ n ]) (ior:DI (and:DI (reg/v:DI 87 [ n ]) (const_int 281474976710655 [0xffffffffffff])) (and:DI (reg:DI 131 [ _45 ]) (const_int -281474976710656 [0xffff000000000000])))) "pr121906.c":22:8 108 {*bstrins_di_for_ior_mask} (nil)) And the splitter ends up emitting (insn 184 55 185 5 (set (reg/v:DI 87 [ n ]) (reg:DI 131 [ _45 ])) "pr121906.c":22:8 -1 (nil)) (insn 185 184 169 5 (set (zero_extract:DI (reg/v:DI 87 [ n ]) (const_int 48 [0x30]) (const_int 0 [0])) (reg/v:DI 87 [ n ])) "pr121906.c":22:8 -1 (nil)) which obviously lost everything in r87, instead of retaining its lower bits as we expect. It's because the splitter didn't anticipate the output register may be one of the input registers. PR target/121906 gcc/ * config/loongarch/loongarch.md (*bstrins_<mode>_for_ior_mask): Always create a new pseudo for the input register of the bstrins instruction. gcc/testsuite/ * gcc.target/loongarch/pr121906.c: New test.
3 daysexpr, tree: Ensure get_range_pos_neg is called only on scalar integral types ↵Jakub Jelinek2-1/+2
[PR121904] The gcc.c-torture/compile/20111209-1.c testcase which uses typedef char* char_ptr32 __attribute__ ((mode(SI))); ICEs on s390x since my change to optimize extensions by cheaper of signed or unsigned extension if sign bit is known from VRP not to be set. The problem is that get_range_pos_neg uses ranger into int_range_max and so ICEs on pointers. All the other current callers call it from places where only scalar integral types can appear (scalar division/modulo, overflow ifns, etc.) I think, this spot was just testing SCALAR_INT_MODE_P. The following patch adds check for INTEGRAL_TYPE_P, I think ranger will not do anything useful for pointers here anyway and what is a negative pointer is also fuzzy. I've changed both get_range_pos_neg to punt on that and the caller, either of those changes are sufficient to fix the ICE, but I think it doesn't hurt to do it in both places. 2025-09-15 Jakub Jelinek <jakub@redhat.com> PR middle-end/121904 * tree.cc (get_range_pos_neg): Return 3 if arg doesn't have scalar integral type. * expr.cc (expand_expr_real_2) <CASE_CONVERT>: Only choose between sign and zero extension based on costs for scalar integral inner types.
3 daysRISC-V: Fix vendor intrinsic tests for disabled multilib configurationsKito Cheng15-8/+85
Add wrapper headers that prevent vendor vector headers from including system stdint.h, ensuring tests work correctly when multilib is disabled. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/andes_vector.h: New file. * gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/nds_vfncvtbf16s.c (#include): Use local andes_vector.h instead of system header. * gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/nds_vfwcvtsbf16.c (#include): Likewise. * gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/andes_vector.h: New file. * gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/nds_vfncvtbf16s.c (#include): Use local andes_vector.h instead of system header. * gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/nds_vfwcvtsbf16.c (#include): Likewise. * gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/andes_vector.h: New file. * gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/nds_vfncvtbf16s.c (#include): Use local andes_vector.h instead of system header. * gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/nds_vfwcvtsbf16.c (#include): Likewise. * gcc.target/riscv/rvv/xandesvector/policy/overloaded/andes_vector.h: New file. * gcc.target/riscv/rvv/xandesvector/policy/overloaded/nds_vfncvtbf16s.c (#include): Use local andes_vector.h instead of system header. * gcc.target/riscv/rvv/xandesvector/policy/overloaded/nds_vfwcvtsbf16.c (#include): Likewise. * gcc.target/riscv/rvv/xsfvector/sifive_vector.h: New file. * gcc.target/riscv/rvv/xtheadvector/riscv_th_vector.h: New file. * gcc.target/riscv/rvv/xtheadvector/riscv_vector.h: New file.
3 daysBail out early during gimplify_asm_expr [PR121391]Stefan Schulze Frielinghaus3-8/+28
In case an asm operand is an error node, constraints etc. are still validated. Furthermore, all other operands are gimplified, although an error is returned in the end anyway. For hard register constraints an operand is required in order to determine the mode from which the number of registers follows. Therefore, instead of adding extra guards, bail out early. gcc/ChangeLog: PR middle-end/121391 * gimplify.cc (gimplify_asm_expr): In case an asm operand is an error node, bail out early. gcc/testsuite/ChangeLog: * gcc.dg/pr121391-1.c: New test. * gcc.dg/pr121391-2.c: New test.
3 daysFix whitespace after r16-3679-g19d1c7c28f4fd0Matthias Kretz1-1/+1
Signed-off-by: Matthias Kretz <m.kretz@gsi.de> gcc/cp/ChangeLog: * mangle.cc (write_real_cst): Replace 8 spaces with Tab.
3 daysFortran: Dependency check in PDT specification assignments [PR83763]Paul Thomas3-22/+100
2025-09-15 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/83763 * trans-decl.cc (gfc_trans_deferred_vars): Ensure that the parameterized components of PDTs that do not have allocatable components are deallocated on leaving scope. * trans-expr.cc (gfc_trans_assignment_1): Do a dependency check on PDT assignments. If there is a dependency between lhs and rhs, deallocate the lhs parameterized components after the rhs has been evaluated. gcc/testsuite/ PR fortran/83763 * gfortran.dg/pdt_46.f03: New test.
3 daysDaily bump.GCC Administrator4-1/+76
4 dayslto/121935 - visit all DECL_ARGUMENTS in free-lang-dataRichard Biener2-1/+15
With no longer visiting TREE_CHAIN for decls we have to visit the DECL_ARGUMENT chain manually. PR lto/121935 * ipa-free-lang-data.cc (find_decls_types_r): Visit DECL_ARGUMENTS chain manually. * g++.dg/lto/pr121935_0.C: New testcase.
4 daysfortran: implement conditional expression for fortran 2023Yuao Ma18-18/+522
This patch adds support for conditional expressions in Fortran 2023 for a limited set of types (logical, numerical), and also includes limited support for conditional arguments without `.nil.` support. gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_expr): Add support for EXPR_CONDITIONAL. * expr.cc (gfc_get_conditional_expr): Add cond-expr constructor. (gfc_copy_expr, free_expr0, gfc_is_constant_expr, simplify_conditional, gfc_simplify_expr, gfc_check_init_expr, check_restricted, gfc_traverse_expr): Add support for EXPR_CONDITIONAL. * frontend-passes.cc (gfc_expr_walker): Ditto. * gfortran.h (enum expr_t): Add EXPR_CONDITIONAL. (gfc_get_operator_expr): Format fix. (gfc_get_conditional_expr): New decl. * matchexp.cc (match_conditional, match_primary): Parsing for EXPR_CONDITIONAL. * module.cc (mio_expr): Add support for EXPR_CONDITIONAL. * resolve.cc (resolve_conditional, gfc_resolve_expr): Ditto. * trans-array.cc (gfc_walk_conditional_expr, gfc_walk_subexpr): Ditto. * trans-expr.cc (gfc_conv_conditional_expr): Codegen for EXPR_CONDITIONAL. (gfc_apply_interface_mapping_to_expr, gfc_conv_expr, gfc_conv_expr_reference): Add support for EXPR_CONDITIONAL. gcc/testsuite/ChangeLog: * gfortran.dg/conditional_1.f90: New test. * gfortran.dg/conditional_2.f90: New test. * gfortran.dg/conditional_3.f90: New test. * gfortran.dg/conditional_4.f90: New test. * gfortran.dg/conditional_5.f90: New test. * gfortran.dg/conditional_6.f90: New test. * gfortran.dg/conditional_7.f90: New test. * gfortran.dg/conditional_8.f90: New test. * gfortran.dg/conditional_9.f90: New test.
4 daysIntegrate SLP permute transform into vect_transform_stmtRichard Biener5-40/+27
This adds permute_info_type and removes the duplication from vect_schedule_slp_node. * tree-vectorizer.h (stmt_vec_info_type::permute_info_type): Add. (vectorizable_slp_permutation): Declare. * tree-vect-slp.cc (vectorizable_slp_permutation): Export. (vect_slp_analyze_node_operations_1): Set permute_info_type on permute nodes successfully analyzed. (vect_schedule_slp_node): Dispatch to vect_transform_stmt for all nodes. * tree-vect-stmts.cc (vect_transform_stmt): Remove redundant dump, handle permute_info_type. * gcc.dg/vect/vect-reduc-chain-2.c: Adjust. * gcc.dg/vect/vect-reduc-chain-3.c: Likewise.
4 daysAvoid VMAT_ELEMENTWISE for negative stride SLPRichard Biener1-9/+5
The following makes us always use VMAT_STRIDED_SLP for negative stride multi-element accesses. That handles falling back to single element accesses transparently. * tree-vect-stmts.cc (get_load_store_type): Use VMAT_STRIDED_SLP for negative stride accesses when VMAT_CONTIGUOUS_REVERSE isn't applicable.
4 daysDo less redundant vect_transform_slp_perm_load callsRichard Biener2-21/+27
The following tries to do vect_transform_slp_perm_load exactly once during analysis and once during transform. There's a 2nd case left during analysis in get_load_store_type. Temporarily this records n_perms in the load-store info and verifies that against the value computed at transform stage. * tree-vectorizer.h (vect_load_store_data::n_perms): New. * tree-vect-stmts.cc (vectorizable_load): Analyze SLP_TREE_LOAD_PERMUTATION only once and remember n_perms. Verify the transform-time n_perms against the value stored during analysis.
4 daysDaily bump.GCC Administrator4-1/+43
4 daystarget.def: Properly mark up __cxa_atexit as codeGerald Pfeifer2-6/+8
gcc: * target.def (dtors_from_cxa_atexit): Properly mark up __cxa_atexit as code. * doc/tm.texi: Regenerate.
5 dayslra: Stop constraint processing on error [PR121205]Stefan Schulze Frielinghaus1-1/+4
It looks like we didn't have a test so far reaching this point which changed with the new hard register constraint tests. Bootstrap and regtest are still running on x86_64. If they succeed, ok for mainline? -- >8 -- As noted by Sam in the PR, with checking enabled tests gcc.target/i386/asm-hard-reg-{1,2}.c fail with an ICE. If an error is detected in curr_insn_transform(), lra_asm_insn_error() is called and deletes the current insn. However, afterwards processing continues with the deleted insn and via lra_process_new_insns() we finally call recog() for NOTE_INSN_DELETED which ICEs in case of a checking build. Thus, in case of an error during curr_insn_transform() bail out and stop processing. gcc/ChangeLog: PR rtl-optimization/121205 * lra-constraints.cc (curr_insn_transform): Stop processing on error.
5 daysdoc: Editorial changes around -fprofile-partial-trainingGerald Pfeifer1-10/+10
gcc: * doc/invoke.texi (Optimize Options): Editorial changes around -fprofile-partial-training.
5 daystestsuite: Port asm-hard-reg tests for PRUDimitar Dimitrov3-1/+12
Add the necessary register definitions for PRU, so that asm-hard-reg tests can pass for PRU. gcc/testsuite/ChangeLog: * gcc.dg/asm-hard-reg-error-1.c: Enable test for PRU, and define registers for PRU. * gcc.dg/asm-hard-reg-error-4.c: Define hard regs for PRU. * gcc.dg/asm-hard-reg-error-5.c: Ditto. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
5 daysc: Implement C2y N3517 array subscripting without decayJoseph Myers10-11/+415
N3517 (array subscripting without decay) has been added to C2y (via a remote vote in May, not at a meeting). Implement this in GCC. The conceptual change, that the array subscripting operator [] no longer involves an array operand decaying to a pointer, is something GCC has done for a very long time. The main effect in terms of what is made possible in the language, subscripting a register array (undefined behavior in C23 and before), was available as a GNU extension, but only with constant indices. There is also a new constraint that array indices must not be negative when they are integer constant expressions and the array operand has array type (negative indices are fine with pointers) - an access out of bounds of an array (even when contained within a larger object) has undefined behavior at runtime when not a constraint violation. Thus, the previous GCC extension is adapted to allow the cases of register arrays not previously allowed, clearing DECL_REGISTER on them as needed (similar to what is done with register declarations of structures with volatile members) and restricting the pedwarn to pedwarn_c23. That pedwarn_c23 is also extended to cover the C23 case of register compound literals (although not strictly needed since it was undefined behavior rather than a constraint violation in C23). The new error is added (only for flag_isoc2y) for negative array indices with an operand of array type. N3517 has some specific wording about the type of the result of non-lvalue array element access. It's unclear what's actually desired there in the case where the array element is itself of array type; see C23 issue 1001 regarding types of qualified members of rvalue structures and unions more generally. Rather than implementing the specific wording about this in N3517, that is deferred until there's an accepted resolution to issue 1001 and can be dealt with as part of implementing such a resolution. Nothing specific is done about the obsolescence in that paper of writing index[array] or index[pointer] as opposed to array[index] or pointer[index], although that seems like a reasonable enough thing to warn about. Bootstrapped with no regressions for x86_64-pc-linux-gnu. gcc/c/ * c-typeck.cc (c_mark_addressable): New parameter override_register. (build_array_ref): Update calls to c_mark_addressable. Give error in C2Y mode for negative array indices when array expression is an array not a pointer. Use pedwarn_c23 for subscripting register array; diagnose that also for register compound literal. * c-tree.h (c_mark_addressable): Update prototype. gcc/testsuite/ * gcc.dg/c23-array-negative-1.c, gcc.dg/c23-register-array-1.c, gcc.dg/c23-register-array-2.c, gcc.dg/c23-register-array-3.c, gcc.dg/c23-register-array-4.c, gcc.dg/c2y-array-negative-1.c, gcc.dg/c2y-register-array-2.c, gcc.dg/c2y-register-array-3.c: New tests.
5 daysDaily bump.GCC Administrator4-1/+224
5 daysFix latent LRA bugJeff Law1-0/+1
Shreya's work to add the addptr pattern on the RISC-V port exposed a latent bug in LRA. We lazily allocate/reallocate the ira_reg_equiv structure and when we do (re)allocation we'll over-allocate and zero-fill so that we don't have to actually allocate and relocate the data so often. In the case exposed by Shreya's work we had N requested entries at the last rellocation step. We actually allocate N+M entries. During LRA we allocate enough new pseudos and thus have N+M+1 pseudos. In get_equiv we read ira_reg_equiv[regno] without bounds checking so we read past the allocated part of the array and get back junk which we use and depending on the precise contents we fault in various fun and interesting ways. We could either arrange to re-allocate ira_reg_equiv again on some path through LRA (possibly in get_equiv itself). We could also just insert the bounds check in get_equiv like is done elsewhere in LRA. Vlad indicated no strong preference in an email last week. So this just adds the bounds check in a manner similar to what's done elsewhere in LRA. Bootstrapped and regression tested on x86_64 as well as RISC-V with Shreya's work enabled and regtested across the various embedded targets. gcc/ * lra-constraints.cc (get_equiv): Bounds check before accessing data in ira_reg_equiv.
6 daysTestsuite: Fix more spurious failure of ACATS-4 testsEric Botcazou3-10/+10
This tentatively applies the same tweak to twin testcases. gcc/testsuite/ PR ada/121532 * ada/acats-4/tests/cxa/cxai034.a: Use Long_Switch_To_New_Task constant instead of Switch_To_New_Task in delay statements. * ada/acats-4/tests/cxa/cxai035.a: Likewise. * ada/acats-4/tests/cxa/cxai036.a: Likewise.
6 daysc++: pack indexing is a non-deduced context [PR121795]Patrick Palka3-2/+25
We weren't explicitly treating a pack index specifier as a non-deduced context (as per [temp.deduct.type]/5), leading to an ICE for the first testcase below. PR c++/121795 gcc/cp/ChangeLog: * pt.cc (unify) <case PACK_INDEX_TYPE>: New non-deduced context case. gcc/testsuite/ChangeLog: * g++.dg/cpp26/pack-indexing17.C: New test. * g++.dg/cpp26/pack-indexing17a.C: New test. Reviewed-by: Marek Polacek <polacek@redhat.com> Reviewed-by: Jason Merrill <jason@redhat.com>
6 daysRISC-V: Support vnclip idiom testcase [PR120378]Edwin Lu4-0/+84
This patch contains testcases for PR120378 after the change made to support the vnclipu variant of the SAT_TRUNC pattern. PR target/120378 gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr120378-1.c: New test. * gcc.target/riscv/rvv/autovec/pr120378-2.c: New test. * gcc.target/riscv/rvv/autovec/pr120378-3.c: New test. * gcc.target/riscv/rvv/autovec/pr120378-4.c: New test. Signed-off-by: Edwin Lu <ewlu@rivosinc.com>