Age | Commit message (Collapse) | Author | Files | Lines |
|
The use of the TLS register in a TOC/GOT address computation was
probably a cut&pasto or a thinko. It causes a linker warning and,
because the TLS access in the test is incomplete, may cause
significant confusion. Adjust to use the TOC/GOT register as base.
for gcc/ChangeLog
* configure.ac: Adjust base register in linker test for large
TOC support.
* configure: Rebuild.
|
|
The widen-mul removed the unnecessary cast, thus adjust the
SAT_MUL of wide-mul to a simpler form.
gcc/ChangeLog:
* match.pd: Remove unnecessary cast of unsigned
SAT_MUL for widen-mul.
Signed-off-by: Pan Li <pan2.li@intel.com>
|
|
The widening-mul will insert a cast for the widen-mul, the
function build_and_insert_cast is design to take care of it.
In some case the optimized gimple has some unnecessary cast,
for example as below code.
#define SAT_U_MUL_FMT_5(NT, WT) \
NT __attribute__((noinline)) \
sat_u_mul_##NT##_from_##WT##_fmt_5 (NT a, NT b) \
{ \
WT x = (WT)a * (WT)b; \
NT hi = x >> (sizeof(NT) * 8); \
NT lo = (NT)x; \
return lo | -!!hi; \
}
SAT_U_MUL_FMT_5(uint64_t, uint128_t)
There will be a additional cast to uint128_t after optimized,
this patch would like to refine this by checking the def of
the rhs cast, if it comes from a cast with less or equal
precision, the rhs of the def will be leveraged.
Before this patch:
29 │ _1 = (__int128 unsigned) a_8(D);
30 │ _2 = (__int128 unsigned) b_9(D);
31 │ _35 = (unsigned long) _1;
32 │ _34 = (unsigned long) _2;
33 │ x_10 = _35 w* _34;
After this patch:
27 │ _35 = (unsigned long) a_8(D);
28 │ _34 = (unsigned long) b_9(D);
29 │ x_10 = _35 w* _34;
gcc/ChangeLog:
* tree-ssa-math-opts.cc (build_and_insert_cast): Refine
the cast insert by check the rhs of val.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/sat/widen-mul-0.c: New test.
* gcc.target/riscv/sat/widen-mul-1.c: New test.
* gcc.target/riscv/sat/widen-mul-2.c: New test.
* gcc.target/riscv/sat/widen-mul-3.c: New test.
* gcc.target/riscv/sat/widen-mul.h: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
|
|
The 'size' argument of ctf_add_sou was size_t. After the prior fixes
for PR121411, this could cause the struct size to be truncated when
encoding extremely large structs on a host where size_t is smaller than
unsigned HOST_WIDE_INT, manifesting for example as the test failure
reported in PR121903. Change the argument to uHWI to resolve the issue.
PR debug/121411
PR debug/121903
gcc/
* ctfc.h (ctf_add_sou): Change size arg from size_t to uHWI.
* ctfc.cc (ctf_add_sou): Likewise.
|
|
gcc/ada
PR ada/114065
PR ada/121953
* Makefile.rtl (LIBGNAT_TARGET_PAIRS) [x32-linux]: Replace
libgnarl/s-osinte__x32.adb with libgnarl/s-osinte__posix.adb.
* libgnarl/s-osinte__x32.adb: Delete.
|
|
It turns out easy to add support for memcpy copy prop when the memcpy
has changed into `MEM<char[N]>` copy.
Instead of rejecting right out we need to figure out that
`a` and `MEM<char[N]>[&a]` are equivalent in terms of address and size.
And then create a VIEW_CONVER_EXPR from the original src to the new type.
Note this also allows for `a.b` and `a` being considered equivalent if b is the
only field (PR 121751).
Changes since v1:
* v2: Move check for IMAG/REAL and BFR earlier.
Add a wrapping function around get_inner_reference and use that instead
of get_addr_base_and_unit_offset.
Bootstrapped and tested on x86_64-linux-gnu.
PR tree-optimization/121751
PR tree-optimization/121418
PR tree-optimization/121417
gcc/ChangeLog:
* tree-ssa-forwprop.cc (split_core_and_offset_size): New function.
(optimize_agr_copyprop_1): Allow for the same
address but different type accesses via a VCE.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/copy-prop-aggregate-1.c: New test.
* gcc.dg/tree-ssa/copy-prop-aggregate-memcpy-1.c: New test.
* gcc.dg/tree-ssa/copy-prop-aggregate-memcpy-2.c: New test.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
|
|
The sufficient conditions are that the aspect be deferred and the object be
rewritten as a renaming because of the complex initialization expression.
gcc/ada/ChangeLog:
* gcc-interface/trans.cc (gnat_to_gnu)
<N_Object_Renaming_Declaration>: Deal with objects whose elaboration
is deferred.
(process_freeze_entity): Deal with renamed objects whose elaboration
is deferred.
|
|
There are cases where GNAT introduces a dependence on the secondary stack
in a build-in-place function with a result subtype that is definite, when
this dependence could be avoided. In particular this is done for record
types that requires finalization due to having a controlled component.
At one time such functions required the secondary stack in order to
properly handle cases where the function might raise an exception
(to avoid improper finalization in the caller), but that is no longer
necessary. We remove the dependence of these functions on the SS,
along with the BIPalloc formal and the generation of the big if_statement
that uses that formal.
An additional small change is to revise the condition for determining when
to generate SS mark/release within functions.
gcc/ada/ChangeLog:
* exp_ch6.ads (Make_Build_In_Place_Call_In_Allocator): Simplify comment.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Remove obsolete
comment about not being able to allocate fixed-size controlled results
on the caller side, and replace another obsolete comment with a simpler
comment. Call Build_Allocate_Deallocate_Proc when the function doesn't
need a BIPalloc formal to ensure that function results with controlled
parts allocated on the caller side will be chained for finalization.
(Make_Build_In_Place_Call_In_Object_Declaration): Call Needs_BIP_Collection
on the function's Entity_Id rather than the function call.
(Needs_BIP_Collection): If a BIP function doesn't need a BIPalloc formal
then it doesn't need a BIP collection either; return False in that case.
(Needs_BIP_Alloc_Form): Remove test of Needs_BIP_Collection.
* exp_ch7.adb (Expand_Cleanup_Actions): Move test of Uses_Sec_Stack
to be the first conjunct in setting of Needs_Sec_Stack_Mark, and put
the other tests in a disjunction subsidiary to that. Improve preceding
comment.
|
|
The problem is that Apply_Discriminant_Check introduces an unnecessary
temporary for an assignment where both sides have the same constrained
subtype but the left-hand side is an aliased component.
This comes from an approximation in the implementation introduced long
time ago to deal with aliased unconstrained objects in Ada 95, more
specifically to still generate a check when both sides have the same
unconstrained subtype in this case; it is replaced by an explicit test
that the common subtype is constrained.
gcc/ada/ChangeLog:
* checks.adb (Apply_Discriminant_Check): Remove undocumented test
on Is_Aliased_View applied to the left-hand side to skip the check
in the case where the subtypes are the same, and replace it with a
test that the subtypes are constrained.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
gcc/ada/ChangeLog:
* ghost.adb (Check_Assignment_Policies): The level of the assignee
should depend on the level of the region.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
gcc/ada/ChangeLog:
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Remove the note on light runtimes.
|
|
gcc/ada/ChangeLog:
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Move
recommendation of Toolchain_Name up.
* gnat_ugn.texi: Regenerate.
|
|
`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.
|
|
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.
|
|
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.
|
|
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.
|
|
"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.
|
|
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.
|
|
Add support for some recent AVR devices.
gcc/
* config/avr/avr-mcus.def: Add avr32eb14, avr32eb20,
avr32eb28, avr32eb32.
* doc/avr-mmcu.texi: Rebuild.
|
|
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>
|
|
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.
|
|
[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.
|
|
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.
|
|
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.
|
|
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
gcc/cp/ChangeLog:
* mangle.cc (write_real_cst): Replace 8 spaces with Tab.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
gcc:
* target.def (dtors_from_cxa_atexit): Properly mark up
__cxa_atexit as code.
* doc/tm.texi: Regenerate.
|