Age | Commit message (Collapse) | Author | Files | Lines |
|
gcc:
* doc/gm2.texi (Documentation): Fix typos, grammar, and a link.
|
|
Array bounds checking is currently tied to VRP. This causes issues with
using laternate VRP algorithms as well as experimenting with moving
the location of the warnings later. This moves it to its own pass
and cleans up the vrp_pass object.
* gimple-array-bounds.cc (array_bounds_checker::array_bounds_checker):
Always use current range_query.
(pass_data_array_bounds): New.
(pass_array_bounds): New.
(make_pass_array_bounds): New.
* gimple-array-bounds.h (array_bounds_checker): Adjust prototype.
* passes.def (pass_array_bounds): New. Add after VRP1.
* timevar.def (TV_TREE_ARRAY_BOUNDS): New timevar.
* tree-pass.h (make_pass_array_bounds): Add prototype.
* tree-vrp.cc (execute_ranger_vrp): Remove warning param and do
not invoke array bounds warning pass.
(pass_vrp::pass_vrp): Adjust params.
(pass_vrp::close): Adjust parameters.
(pass_vrp::warn_array_bounds_p): Remove.
(make_pass_vrp): Remove warning param.
(make_pass_early_vrp): Remove warning param.
(make_pass_fast_vrp): Remove warning param.
|
|
bext is defined as (src >> n) & 1. With that formulation, particularly the
"&1" means the result is implicitly zero extended. So we can safely use it on
SI objects for rv64 without the need to do any explicit extension.
This patch adds the obvious pattern and a few testcases. I think one of the
tests is derived from coremark, the other two from spec2017.
This has churned through Ventana's CI system repeatedly since it was first
written. Assuming pre-commit CI doesn't complain, I'll commit it on Raphael's
behalf later today or Monday.
gcc/
* config/riscv/bitmanip.md (*bextdisi): New pattern.
gcc/testsuite
* gcc.target/riscv/zbs-ext.c: New test.
|
|
When enabled the PHI handing for COND_EXPR, we need to insert the gcall
to replace the PHI node. Unfortunately, I made a mistake that insert
the gcall to before the last stmt of the bb. See below gimple, the PHI
is located at no.1 but we insert the gcall (aka no.9) to the end of
the bb. Then the use of _9 in no.2 will have no def and will trigger
ICE when verify_ssa.
1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be deleted.
2. prephitmp_36 = (char *) _9;
3. buf.write_base = string_13(D);
4. buf.write_ptr = string_13(D);
5. buf.write_end = prephitmp_36;
6. buf.written = 0;
7. buf.mode = 3;
8. _7 = buf.write_end;
9. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to last bb by mistake
This patch would like to insert the gcall to before the start of the bb
stmt. To ensure the possible use of PHI_result will have a def exists.
After this patch the above gimple will be:
0. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to start bb by mistake
1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be deleted.
2. prephitmp_36 = (char *) _9;
3. buf.write_base = string_13(D);
4. buf.write_ptr = string_13(D);
5. buf.write_end = prephitmp_36;
6. buf.written = 0;
7. buf.mode = 3;
8. _7 = buf.write_end;
The below test suites are passed for this patch:
* The rv64gcv fully regression test with newlib.
* The rv64gcv build with glibc.
* The x86 regression test with newlib.
* The x86 bootstrap test with newlib.
PR target/115387
gcc/ChangeLog:
* tree-ssa-math-opts.cc (math_opts_dom_walker::after_dom_children): Take
the gsi of start_bb instead of last_bb.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/pr115387-1.c: New test.
* gcc.target/riscv/pr115387-2.c: New test.
|
|
This is a simple fix to the testcase as plain `char` could be
unsigned by default on some targets (e.g. aarch64 and powerpc).
Committed as obvious after quick test of the testcase on both aarch64 and x86_64.
gcc/testsuite/ChangeLog:
PR testsuite/115415
PR tree-optimization/115388
* gcc.dg/torture/pr115388.c: Use `signed char` directly instead
of plain `char`.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
|
|
bext is defined as (src >> n) & 1. With that formulation, particularly the
"&1" means the result is implicitly zero extended. So we can safely use it on
SI objects for rv64 without the need to do any explicit extension.
This patch adds the obvious pattern and a few testcases. I think one of the
tests is derived from coremark, the other two from spec2017.
This has churned through Ventana's CI system repeatedly since it was first
written. Assuming pre-commit CI doesn't complain, I'll commit it on Raphael's
behalf later today or Monday.
gcc/
* config/riscv/bitmanip.md (*bextdisi): New pattern.
gcc/testsuite
* gcc.target/riscv/bext-ext.c: New test.
|
|
The following fixes a latent bug in DSE with regarding to variant
array accesses where the code avoiding bogus DSE in loops fails to
handle irreducible regions. For those we need to make sure backedges
are marked and discover a header for the irreducible region to check
invariantness.
PR tree-optimization/115388
* tree-ssa-dse.cc (dse_classify_store): Handle irreducible
regions.
(pass_dse::execute): Make sure to mark backedges.
* gcc.dg/torture/pr115388.c: New testcase.
|
|
gcc/testsuite/
PR ada/114708
* gnat.dg/incomplete8.adb: New test.
|
|
gcc/testsuite/
PR ada/114398
* gnat.dg/access11.adb: New test.
|
|
When we continue a non-SLP reduction from the main loop in the
epilog with a SLP reduction we currently fail to handle an
adjustment by the initial value because that's not a thing with SLP.
As long as we have the possibility to mix SLP and non-SLP we have
to handle it though.
PR tree-optimization/115395
* tree-vect-loop.cc (vect_create_epilog_for_reduction):
Handle STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT also for SLP
reductions of group_size one.
* gcc.dg/vect/pr115395.c: New testcase.
|
|
The expansion of additive operations for nonbinary modular types implemented
in the front-end and its counterpart in code generators may create branches,
which is not allowed when restriction No_Implicit_Conditionals is in effect.
This changes it to use an explicit Mod operation when the restriction is in
effect, which is assumed not to create such branches.
gcc/ada/
* exp_ch4.adb (Expand_Nonbinary_Modular_Op): Create an explicit Mod
for additive operations if No_Implicit_Conditionals is in effect.
(Expand_Modular_Addition): Likewise.
(Expand_Modular_Subtraction): Likewise.
(Expand_Modular_Op): Always use an unsigned type obtained by calling
Small_Integer_Type_For on the required size.
|
|
At runtime the code generated by the compiler reports the
exception Storage_Error in an indirect call through an
access-to-subprogram variable that references a function
returning a limited tagged type object.
gcc/ada/
* sem_ch6.adb (Might_Need_BIP_Task_Actuals): Add support
for access-to-subprogram parameter types.
* exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call):
Add dummy BIP parameters to access-to-subprogram types
that may reference a function that has BIP parameters.
|
|
If a type DT is derived from a record type T with convention C_Pass_By_Copy
and explicitly specifies convention C (via aspect or pragma), then type DT
should not be treated as a type with convention C_Pass_By_Copy. Any parameters
of the derived type should be passed by reference rather than by copy. The
compiler was incorrectly inheriting convention C_Pass_By_Copy, by inheriting
the flag set on the parent type, but that flag needs to be unset in the case
where the convention is overridden.
gcc/ada/
* sem_prag.adb (Set_Convention_From_Pragma): If the specified convention on
a record type is not C_Pass_By_Copy, then force the C_Pass_By_Copy flag to
False, to ensure that it's overridden.
|
|
This is just changing a "not Present (...)" test to "No (...)"
to address a CB complaint from gnatcheck.
gcc/ada/
* sem_aggr.adb (Resolve_Iterated_Association): Change "not Present"
to "No" in test of Add_Named_Subp.
|
|
aggregate.
Extend existing special freezing rules for regular aggregates to also apply to
extension and delta aggregates.
gcc/ada/
* freeze.adb
(Should_Freeze_Type.Is_Dispatching_Call_Or_Aggregate): Treat an extension
aggregate or a delta aggregate like a regular aggregate.
|
|
This change set addresses compilation problems encountered in the draft
versions of the following ACATS B tests for container aggregates:
B435001 (container aggregates with Assign_Indexed)
B435002 (container aggregates with Add_Unnamed)
B435003 (container aggregates with Add_Named)
B435004 (container aggregates with Assign_Indexed and Add_Unnamed)
gcc/ada/
* sem_aggr.adb (Resolve_Iterated_Association): In the case of
N_Iterated_Element_Associations that have a key expression, issue
an error if the aggregate type does not have an Add_Named
operation, and include a reference to RM22 4.3.5(24) in the error
message. In the case of an N_Component_Association with a
Defining_Identifer where the "choice" is given by a function call,
in the creation of the iterator_specification associate a copy of
Choice as its Name, and remove the call to
Analyze_Iterator_Specification, which was causing problems with
the reanalysis of function calls originally given in prefixed form
that were transformed into function calls in normal (infix) form.
The iterator_specification will be analyzed later in any case, so
that call should not be done here. Remove the with and use of
Sem_Ch5.
|
|
This patch fixes an issue in the compiler whereby wrapping an operand
of a boolean operator resulted in a failure to detect whether or not
they were unnecessary for the -gnatyx style checks.
gcc/ada/
* ali.adb (Get_Nat): Remove unnecessary parentheses.
* exp_ch11.adb (Expand_Local_Exception_Handlers): Remove
unnecessary parentheses.
* freeze.adb (Freeze_Entity): Remove unnecessary parentheses.
* lib-list.adb (List): Remove unnecessary parentheses.
* par-ch5.adb (P_Condition): Add extra parentheses checks on
condition operands.
* sem_ch3.adb (Add_Interface_Tag_Components): Remove unnecessary
parentheses.
(Check_Delta_Expression): Remove unnecessary parenthesis.
(Check_Digits_Expression): Remove unnecessary parentheses.
* sem_ch12.adb (Validate_Array_Type_Instance): Remove unnecessary
parentheses.
|
|
This patch fixs an issue where iterator filters for formal container and
formal container element loops got silently ignored and remained unexpanded.
gcc/ada/
* exp_ch5.adb (Expand_Formal_Container_Element_Loop): Add
expansion of filter condition.
(Expand_Formal_Container_Loop): Add expansion of filter condition.
|
|
This patch fixes an issue in the compiler whereby calculating a static
accessibility level on a private type with an access discriminant resulted
in a compile time crash when No_Dynamic_Accessibility_Checks is enabled.
gcc/ada/
* accessibility.adb (Accessibility_Level): Use Get_Full_View to
avoid crashes when calculating scope.
|
|
This patch modifies the unreferenced entity warning in the compiler to avoid
noisily warning about unreferenced abstract subprogram.
gcc/ada/
* sem_warn.adb (Warn_On_Unreferenced_Entity): Add a condition to
ignore warnings on unreferenced abstract subprogram.
|
|
This patch adds the restriction on 'Super such that it cannot apply to objects
whose parent type is an interface.
gcc/ada/
* sem_attr.adb (Analyze_Attribute): Add check for interface parent
types.
|
|
We seem to have a convention of using "RM" in the GNAT comments, not
"Ada RM". Also, the paragraph references by convention should appear
in parentheses, e.g. "8.3(12.3/2)", not "8.3 12.3/2".
gcc/ada/
* einfo.ads, exp_attr.adb, exp_ch4.adb, exp_ch7.adb,
lib-writ.adb, libgnat/a-stbuut.ads, sem_ch13.adb, sem_ch3.adb,
sem_ch7.adb: Use "RM" in comments.
|
|
Code cleanup; semantics is unaffected.
gcc/ada/
* sem_util.adb
(Immediate_Context_Implies_Is_Potentially_Unevaluated): Use
collective subtypes in membership tests.
(Is_Known_On_Entry): Require all alternatives in a case statement
to return; this change could prevent a recently fixed glitch,
where one of the alternatives relied on the return statement
afterwards (also, the new code is shorter).
* sem_util.ads (Is_Potentially_Unevaluated): Clarify that this
routine applies to Ada 2012.
|
|
The dependency on Ada.Streams is problematic for light runtimes.
As these streaming facilities are in fact not used in formal containers,
remove the corresponding dead code.
gcc/ada/
* libgnat/a-chtgfo.adb (Generic_Read, Generic_Write): Remove.
* libgnat/a-chtgfo.ads: Same. Remove dependency on Ada.Streams.
|
|
This patches fixes the signature of the binding to SetThreadAffinityMask
in the run-time library. It also fixes the error checking after calls
to SetThreadAffinityMask. The previous code behaved as if
SetThreadAffinityMask returned 1 on success, but it in fact returns a
pointer value on success and 0 on failure.
gcc/ada/
* libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage of
SetThreadAffinityMask.
* libgnat/s-winext.ads (SetThreadAffinityMask): Fix binding
signature.
|
|
This patches fixes the way the run-time library checks the return
value of SetThreadIdealProcessor.
gcc/ada/
* libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage
of SetThreadIdealProcessor.
|
|
There is a special case of file paths on Windows that are absolute
but don't start with a drive letter: UNC paths. This patch removes
an assertion in System.OS_Lib.Normalize_Pathname that failed to take
this case into account. It also renames a local subprogram of
Normalize_Pathname to make its purpose clearer.
gcc/ada/
* libgnat/s-os_lib.adb (Normalize_Pathname): Remove incorrect
assert statement.
(Missed_Drive_Letter): Rename into...
(Drive_Letter_Omitted): This.
|
|
This patch fixes a subprogram in gnatlink that incorrectly assumed
that the strings it is passed as arguments all have a lower bound of
1.
gcc/ada/
* gnatlink.adb (Check_File_Name): Fix incorrect assumption.
|
|
In expansion of various attributes, in particular for the Input/Output
and Read/Write attributes, we can use constants that are already used
for expansion of many other attributes.
gcc/ada/
* exp_attr.adb (Expand_N_Attribute_Reference): Use constants
declared at the beginning of subprogram; tune layout.
* exp_ch3.adb (Predefined_Primitive_Bodies): Tune layout.
|
|
Extend code comment; move recently added documentation from pragma
No_Tagged_Streams to restriction No_Streams.
gcc/ada/
* doc/gnat_rm/implementation_defined_pragmas.rst
(No_Tagged_Streams): Move documentation.
* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
(No_Streams): Likewise.
* exp_disp.adb (Make_DT): Extend comment.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
|
|
Code cleanup; behavior is unaffected.
gcc/ada/
* sem_attr.adb (Analyze_Attribute): Use fully qualified name
without a NUL, so that it doesn't need to be skipped afterwards.
|
|
Recursive routine Type_Without_Stream_Operation was checking restriction
No_Default_Stream_Attributes at every call, which was confusing and
inefficient.
This routine is only called from the places: Check_Stream_Attribute,
which already checks if this restriction is active, and
Stream_Operation_OK, where we add such a check.
Cleanup related to extending the use of No_Streams restriction.
gcc/ada/
* exp_ch3.adb (Stream_Operation_OK): Check restriction
No_Default_Stream_Attributes before call to
Type_Without_Stream_Operation.
* sem_util.adb (Type_Without_Stream_Operation): Remove static
condition from recursive routine
|
|
With the support for forward GOTO statements in the GNATprove backend,
we can now inline subprograms with multiple return statements in the
frontend.
Also, fix inconsistent source locations in the inlined code, which were
now triggering assertion violations in the code for GNATprove
counterexamples.
gcc/ada/
* inline.adb (Has_Single_Return_In_GNATprove_Mode): Remove.
(Process_Formals): When rewriting an occurrence of a formal
parameter, use location of the occurrence, not of the inlined
call.
|
|
A new debug switch -gnatd_k is added, which has only effect in CodePeer
mode. When enabled, assertion expressions are no longer expanded (which
is the default in the CodePeer mode); instead, their expansion needs to
be explicitly enabled by pragma Assertion_Policy.
gcc/ada/
* debug.adb (d_k): Use first available debug switch.
* gnat1drv.adb (Adjust_Global_Switches): If new debug switch is
active then don't expand assertion expressions by default.
|
|
Code cleanup; semantics is unaffected.
gcc/ada/
* exp_ch6.adb (Install_Class_Preconditions_Check): Refactor
common code for checking if precondition fails, since the
difference is only in raising an exception or calling the
Raise_Assert_Failure procedure.
|
|
Code cleanup; semantics is unaffected.
gcc/ada/
* exp_ch6.adb (Build_Dynamic_Check_Helper_Call): Remove unused
iteration over formal parameters.
|
|
When resolving aspect expression, aspects CPU and Interrupt_Priority
should be handled like the aspect Priority; in particular, all these
expressions can reference discriminants of the annotated task type.
gcc/ada/
* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Make
discriminants visible when analyzing aspect Interrupt_Priority.
(Freeze_Entity_Checks): Likewise.
(Resolve_Aspect_Expressions): Likewise for both aspects CPU and
Interrupt_Priority.
|
|
Code cleanup; semantics is unaffected.
gcc/ada/
* sem_prag.adb (Report_Extra_Clauses): Remove redundant check
for empty list, because First works also for No_List.
|
|
Code cleanup; semantics is unaffected.
gcc/ada/
* sem_prag.adb (Check_Dependency_Clause, Check_Output_States,
Report_Extra_Clauses): Remove multiple checks for being inside
an instance.
(Analyze_Refined_Depends_In_Decl_Part): Add single check for
being inside an instance.
|
|
Code cleanup; semantics is unaffected.
gcc/ada/
* sem_prag.adb (Check_In_Out_States, Check_Input_States,
Check_Output_States, Check_Proof_In_States,
Check_Refined_Global_List, Report_Extra_Constituents,
Report_Missing_Items): Remove multiple checks for being inside
an instance.
(Analyze_Refined_Global_In_Decl_Part): Add single check for
being inside an instance.
|
|
The current implementation assumes to always be invoked with register
operands. For memory operands we even have an instruction
though (vlrep). With the patch we try this first and only if it fails
force the input into a register and continue.
vec_splats generation fails for single element 128bit types which are
allowed for vec_splat. This is something to sort out with another
patch I guess.
gcc/ChangeLog:
* config/s390/s390.cc (expand_perm_as_replicate): Handle memory
operands.
* config/s390/vx-builtins.md (vec_splats<mode>): Turn into parameterized expander.
(@vec_splats<mode>): New expander.
gcc/testsuite/ChangeLog:
* g++.dg/torture/vshuf-mem.C: New test.
|
|
In mips.cc(mips_reorg_process_insns), there is this claim:
Also delete cache barriers if the last instruction
was an annulled branch. INSN will not be speculatively
executed.
And with -O1 on mips64, we can generate binary code like this,
which fails this test.
gcc/testsuite
* gcc.target/mips/r10k-cache-barrier-13.c: Add -mno-branch-likely
option.
|
|
The EXTRACT_LAST_REDUCTION code isn't ready to deal with multiple stmt
copies but SLP no longer checks for this. The following adjusts
code generation to handle the situation.
PR tree-optimization/115383
* tree-vect-stmts.cc (vectorizable_condition): Handle
generating a chain of .FOLD_EXTRACT_LAST.
* gcc.dg/vect/pr115383.c: New testcase.
|
|
|
|
As of FreeBSD version 14, FreeBSD no longer provides profiled system
libraries like libc_p and libpthread_p. Stop linking against them if
the FreeBSD major version is 14 or more.
gcc:
* config/freebsd-spec.h: Change fbsd-lib-spec for FreeBSD > 13,
do not link against profiled system libraries if -pg is invoked.
Add a define to note about this change.
* config/aarch64/aarch64-freebsd.h: Use the note to inform if
-pg is invoked on FreeBSD > 13.
* config/arm/freebsd.h: Likewise.
* config/i386/freebsd.h: Likewise.
* config/i386/freebsd64.h: Likewise.
* config/riscv/freebsd.h: Likewise.
* config/rs6000/freebsd64.h: Likewise.
* config/rs6000/sysv4.h: Likeise.
|
|
Andreas noted we were getting an uninit warning after the recent constant
synthesis changes. Essentially there's no way for the uninit analysis code to
know the first entry in the CODES array is a UNKNOWN which will set X before
its first use.
So trivial initialization with NULL_RTX is the obvious fix.
Pushed to the trunk.
gcc/
* config/riscv/riscv.cc (riscv_move_integer): Initialize "x".
|
|
The following testcase:
unsigned
sub_sat (unsigned x, unsigned y)
{
unsigned res;
res = x - y;
res &= -(x >= y);
return res;
}
currently compiles (-O2) to:
sub_sat:
movl %edi, %edx
xorl %eax, %eax
subl %esi, %edx
cmpl %esi, %edi
setnb %al
negl %eax
andl %edx, %eax
ret
We can expand through ussub{m}3 optab to use carry flag from the subtraction
and generate code using SBB instruction implementing:
unsigned res = x - y;
res &= ~(-(x < y));
sub_sat:
subl %esi, %edi
sbbl %eax, %eax
notl %eax
andl %edi, %eax
ret
PR target/112600
gcc/ChangeLog:
* config/i386/i386.md (ussub<mode>3): New expander.
(sub<mode>_3): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr112600-b.c: New test.
|
|
The entire server/site appears gone for a while.
gcc:
* doc/install.texi (avr): Remove link to www.amelek.gda.pl/avr/.
|
|
shifts/rotates.
This patch tweaks RTL expansion of multi-word shifts and rotates to use
PLUS rather than IOR for disjunctive operations. During expansion of
these operations, the middle-end creates RTL like (X<<C1) | (Y>>C2)
where the constants C1 and C2 guarantee that bits don't overlap.
Hence the IOR can be performed by any any_or_plus operation, such as
IOR, XOR or PLUS; for word-size operations where carry chains aren't
an issue these should all be equally fast (single-cycle) instructions.
The benefit of this change is that targets with shift-and-add insns,
like x86's lea, can benefit from the LSHIFT-ADD form.
An example of a backend that benefits is ARC, which is demonstrated
by these two simple functions:
unsigned long long foo(unsigned long long x) { return x<<2; }
which with -O2 is currently compiled to:
foo: lsr r2,r0,30
asl_s r1,r1,2
asl_s r0,r0,2
j_s.d [blink]
or_s r1,r1,r2
with this patch becomes:
foo: lsr r2,r0,30
add2 r1,r2,r1
j_s.d [blink]
asl_s r0,r0,2
unsigned long long bar(unsigned long long x) { return (x<<2)|(x>>62); }
which with -O2 is currently compiled to 6 insns + return:
bar: lsr r12,r0,30
asl_s r3,r1,2
asl_s r0,r0,2
lsr_s r1,r1,30
or_s r0,r0,r1
j_s.d [blink]
or r1,r12,r3
with this patch becomes 4 insns + return:
bar: lsr r3,r1,30
lsr r2,r0,30
add2 r1,r2,r1
j_s.d [blink]
add2 r0,r3,r0
This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
and make -k check, both with and without --target_board=unix{-m32}
with no new failures. Ok for mainline?
gcc/ChangeLog
* expmed.cc (expand_shift_1): Use add_optab instead of ior_optab
to generate PLUS instead or IOR when unioning disjoint bitfields.
* optabs.cc (expand_subword_shift): Likewise.
(expand_binop): Likewise for double-word rotate.
|
|
|