Age | Commit message (Collapse) | Author | Files | Lines |
|
This patches fixes ICE when ipa-split is run from ipa-profile. In normal
computation we recompute the flag elsewhere, but it is supposed to be kept
up-to-date by passes possibly modifying it.
gcc/ChangeLog:
* cgraphclones.cc (cgraph_node::create_version_clone): Recompute
calls_comdat_local
|
|
This patch makes inliner and ipa-cp to consider optimization interesting even
in scenarios where aufdo countis 0, but scaleis high enough to make optimization
worthwhile.
gcc/ChangeLog:
* cgraph.cc (cgraph_edge::maybe_hot_p): For AFDO profiles force
count to be non-zero.
|
|
Autogenerate for -fmem-report and -ftime-report.
Fixes: 273b53effbf5 ("PR modula2/121856: New wideset implementation")
gcc/m2/ChangeLog:
* lang.opt.urls: Regenerate.
|
|
Increase scaling factor for auto-fdo profiles. I origianlly used
n_bits/2 which is also used by local guessing algorithm. For local guessing
algorithm the main factor is to prevent inliner scaling up the profile till
overflow.
With sane IPA profile large scaling up should essentially never happen. Inliner and
ipa-cp only duplicates code and should only scale down. ipa-icf and tail merging merges
code but not very large number of code paths.
In practice scaling up still happens when profile is inconsisent, so this use
n_bits-10, which is 50 currently. The main advantage of this is to reduce chances
things drop to 0 and we hit the various special cases for 0 auto-FDO profile.
gcc/ChangeLog:
* auto-profile.cc (autofdo_source_profile::read): Scale profile up to
profile_count::n_bits - 10.
|
|
-fexternal-blas64 requires front-end optimization to be turned on.
This patch issues a hard error if this is not the case, and also issues
an error on not-64 bit systems, where specifying it would make no sense,
and lead to errors. Finally, this makes sure that the test is only performed
on 64-bit systems.
I tried creating test cases for the hard errors for the wrong option
combinations, but didn't succeed; see the thread on the gcc mailing
list on that topic. These can always be added afterwards.
gcc/fortran/ChangeLog:
PR fortran/121161
* invoke.texi: Mention that -ffrontend-optimize is required
for -fexternal-blas64.
* options.cc (gfc_post_options): Fatal error if -fexternal-blas64
is specified without -ffrontend-optimize.
* trans-types.cc (gfc_init_kinds): Fatal error if -fexternal-blas64
is specified on a system which does not have 64-bit ptrdiff_t.
gcc/testsuite/ChangeLog:
PR fortran/121161
* gfortran.dg/matmul_blas_3.f90: Add effective target lp64.
|
|
This patch makes inliner to not subtract inlined function profile from the
offline copy in cases where profile is clearly not consistent. As a result we
do not drop the offline version to likely never executed profile. This helps
in cases the profile got lost, i.e. by comdat function merging and also for
auto-fdo.
gcc/ChangeLog:
* ipa-inline-transform.cc (clone_inlined_nodes): Add KEEP_OFFLINE_COPY
parameter.
(inline_call): Sanity check profile and if it is clearly broken do
not subtract profile from original function.
* ipa-inline.cc (recursive_inlining): Update.
* ipa-inline.h (clone_inlined_nodes): Update.
|
|
PR fortran/108581
gcc/fortran/ChangeLog:
* trans-array.cc (gfc_conv_expr_descriptor): Take the dynamic
string length into account when deriving the dataptr offset for
a deferred-length character array.
gcc/testsuite/ChangeLog:
* gfortran.dg/deferred_character_39.f90: New test.
|
|
|
|
This small patch fixes -Wodr warnings and also corrects a prototype.
gcc/m2/ChangeLog:
PR modula2/122009
* gm2-compiler/M2GenGCC.mod (FromM2WIDESETImport): Assign
sym to NulSym.
(CodeMakeAdr): Remove fourth parameter to BuildLogicalOrAddress.
(FoldMakeAdr): Ditto.
* gm2-compiler/M2Quads.mod (BuildAssignmentBoolean): Remove
unused parameter checkTypes.
(doBuildAssignment): Remove checkTypes parameter when calling
BuildAssignmentBoolean.
* gm2-gcc/m2expr.def (BuildLogicalOrAddress): Remove
needconvert parameter.
* gm2-gcc/m2statement.def (IfExprJump): Change label type
to CharStar.
* gm2-gcc/m2type.cc (m2type_BuildEnumerator): Remove const.
* gm2-gcc/m2type.h (m2type_BuildEnumerator): Ditto.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
|
|
Here the normal form of the two immediately-declared D<<placeholder>, V>
constraints is the same, so we rightfully share the normal form between
them. We first compute the normal form from the context of auto deduction
for W in which case the placeholder has level 2 where the set of
in-scope template parameters has depth 2 (a dummy level is added from
normalize_placeholder_type_constraints).
Naturally the atomic constraint only depends on the template parameter
V of depth 1 index 0. The depth 2 of current_template_parms however
means that find_template_parameters when it sees V within the atomic
constraint will recurse into its TREE_TYPE, an auto of level 2, and mark
the atomic constraint as also depending on the template parameter of
depth 2 index 0, which is clearly wrong. Later during constraint
checking for B we ICE within the satisfaction cache since we lack two
levels of template arguments supposedly needed by the cached atomic
constraint.
I think when find_template_parameters sees an NTTP, it doesn't need to
walk its TREE_TYPE because NTTP substitution is done obliviously with
respect to its type -- only the corresponding NTTP argument matters,
not other template arguments possibly used within its type. This is
most clearly true for (unconstrained) auto NTTPs as in the testcase, but
also true for other NTTPs. Doing so fixes the testcase because we no
longer record any depth 2 when walking V within the atomic constraint.
PR c++/121981
gcc/cp/ChangeLog:
* pt.cc (any_template_parm_r) <case TEMPLATE_TYPE_PARM>:
Don't walk TREE_TYPE.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-placeholder15.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
|
|
PR c++/119048
gcc/cp/ChangeLog:
* lambda.cc (compare_lambda_sig): Only skip first parameter for
object members.
gcc/testsuite/ChangeLog:
* g++.dg/cpp23/static-operator-call8.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
|
|
2025-09-20 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/83746
* trans-decl.cc (gfc_trans_deferred_vars): If a procedure with
an non-allocatable, non-pointer explicit PDT result has no
default initializer, the parameterized components should be
allocated.
|
|
Currently we speculatively devirtualize using static analysis (with no profile
feedback) only when there is one possible target found. With profile feedback
we support multiple targets which seems useful in some scenarios.
This patch adds --param max-devirt-targets which enables devirtualization up to
given number of targets and defaults it to 3. This happens i.e. in spec2017
omnetpp, though the devirtualizaton is later undone by inliner since it is not
considered useful. The patch still seems to improve omnetpp by 2% in some
setups.
Other advantage of the patch is that the multi-target devirtualizatoin gets
tested without profile feedback so we more likely notice problems with it.
gcc/ChangeLog:
* doc/invoke.texi (--param max-devirt-targets) Document.
* ipa-devirt.cc (ipa_devirt): Implement muti-target
devirtualization.
* params.opt (max-devirt-targets): New parameter.
gcc/testsuite/ChangeLog:
* g++.dg/ipa/devirt-2.C: Update template.
* g++.dg/ipa/devirt-42.C: Update template.
* g++.dg/lto/devirt-2_0.C: Update template.
|
|
C2y replaces undefined behavior for lvalue conversion of an lvalue
with incomplete, non-array type with a constraint violation.
Implement this in GCC, which means disallowing lvalue conversion of
qualified or atomic void for C2y. (Unqualified, non-atomic void is
excluded from the definition of "lvalue".)
I'm not convinced that the resolution of C90 DR#106 (which said that
certain cases with qualified void were valid) was really justified
even based on the wording of C90; nevertheless, this patch takes the
conservative approach of only disallowing qualified void here for C2y.
The test for this change showed that attempting to access an _Atomic
void object produced an ICE-after-error attempting the atomic load
logic for such a type. require_complete_type returning
error_mark_node prevents this ICE from occurring any more in C2y mode;
to avoid it in older modes, a check of COMPLETE_TYPE_P is added to
really_atomic_lvalue. I didn't find any existing bug report in
Bugzilla for this issue.
Bootstrapped with no regressions for x86_64-pc-linux-gnu.
gcc/c/
* c-typeck.cc (really_atomic_lvalue): Return false for incomplete
types.
(convert_lvalue_to_rvalue): Call require_complete_type for
qualified void for C2y.
gcc/testsuite/
* gcc.dg/c11-atomic-6.c, gcc.dg/c23-incomplete-1.c,
gcc.dg/c2y-incomplete-3.c: New tests.
|
|
|
|
Add non-type template parameter function-object/-pointer argument
versions of bind_front, bind_back, and not_fn.
This introduces a new internal type _Bind_fn_t to carry the
template-argument function object when no arguments are bound,
used in both bind_front and bind_back. Otherwise they return
a lambda object that has captured the arguments.
There is no need to change libstdc++-v3/src/c++23/std.cc.in
because existing exports: "using std::bind_front;" etc. export
the new overloads.
libstdc++-v3/ChangeLog:
PR libstdc++/119744
* include/bits/version.def: Redefine __cpp_lib_bind_front etc.
* include/bits/version.h: Ditto.
* include/std/functional: Add new bind_front etc. overloads
* testsuite/20_util/function_objects/bind_back/1.cc:
Check plumbing better
* testsuite/20_util/function_objects/bind_back/nttp.cc: New test.
* testsuite/20_util/function_objects/bind_back/nttp_neg.cc: New test.
* testsuite/20_util/function_objects/bind_front/1.cc:
Check plumbing better
* testsuite/20_util/function_objects/bind_front/nttp.cc: New test.
* testsuite/20_util/function_objects/bind_front/nttp_neg.cc: New test.
* testsuite/20_util/function_objects/not_fn/nttp.cc: New test.
* testsuite/20_util/function_objects/not_fn/nttp_neg.cc: New test.
* testsuite/20_util/headers/functional/synopsis.cc: New decls.
|
|
This was reported as LWG 4257 and moved to Tentatively Ready status.
libstdc++-v3/ChangeLog:
* include/bits/chrono_io.h: Remove unused <iomanip> header.
(operator<<): Constrain overload for chrono::local_time.
* testsuite/std/time/clock/local/io.cc: Check constraints.
Reviewed-by: Patrick Palka <ppalka@redhat.com>
|
|
An aarch64 toolchain built with --enable-default-pie fails
gcc.target/aarch64/sme/nonlocal_goto_[123].c because the register
allocator ends up resetting equivalences, so it concludes it needs to
preserve a rematerializable function invariant across a call instead
of rematerializing it.
Restore the find_reg_equiv_invariant_const logic that was in place
before commit 55a2c3226a3e90a6d65f19710bab1ac377054234 rewrote it and
added a (spurious?) requirement for non-function-invariants to retain
an equivalence when other PIC-related conditions didn't apply. That
requirement seems either reversed or unnecessary.
for gcc/ChangeLog
* ira.cc (setup_reg_equiv): Retain function invariant
equivalences.
|
|
stmt instead of gsi
As mentioned, optimize_aggr_zeroprop and optimize_agr_copyprop don't change the stmt
so they should take stmt instead of the iterator.
Pushed as obvious after bootstrap/test on x86_64-linux-gnu.
gcc/ChangeLog:
* tree-ssa-forwprop.cc (optimize_aggr_zeroprop): Take gimple*
instead of iterator.
(optimize_agr_copyprop): Likewise.
(simplify_builtin_call): Update call to optimize_aggr_zeroprop.
(pass_forwprop::execute): Update calls to optimize_aggr_zeroprop
and optimize_agr_copyprop.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
|
|
optimize_agr_copyprop return true
Since now optimize_aggr_zeroprop and optimize_agr_copyprop work by forward walk to prop
the zero/aggregate and does not change the statement at hand, there is no reason to
repeat the loop if they do anything. This will prevent problems like PR 121962 from
happening again as we will never loop.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* tree-ssa-forwprop.cc (optimize_aggr_zeroprop_1): Change return type
to void.
(optimize_aggr_zeroprop): Likewise.
(optimize_agr_copyprop_1): Likewise.
(optimize_agr_copyprop_arg): Likewise.
(optimize_agr_copyprop): Likewise.
(simplify_builtin_call): Handle update of the return type
of optimize_aggr_zeroprop.
(pass_forwprop::execute): Likewise and optimize_agr_copyprop.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
|
|
Atomic support enhanced to fix existing atomic_compare_and_swapsi pattern
to handle side effects; new patterns atomic_fetch_op and atomic_test_and_set
added. As MicroBlaze has no QImode test/set instruction, use shift magic
to implement atomic_test_and_set.
PR target/118280
gcc/
* config/microblaze/iterators.md: New.
* config/microblaze/microblaze-protos.h: Add
microblaze_subword_address.
* config/microblaze/microblaze.cc: Ditto.
* config/microblaze/microblaze.md: constants: Add UNSPECV_CAS_BOOL,
UNSPECV_CAS_MEM, UNSPECV_CAS_VAL, UNSPECV_ATOMIC_FETCH_OP
type: add atomic
* config/microblaze/sync.md: Add atomic_fetch_<atomic_optab>si
atomic_test_and_set
Signed-off-by: Kirk Meyer <kirk.meyer@sencore.com>
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
Signed-off-by: Gopi Kumar Bulusu <gopi@sankhya.com>
Signed-off-by: Michael Eager <eager@eagercon.com>
|
|
This patch implements logic to estimate_edge_devirt_benefit to not account call
statement sizes of speculative calls in case we know the call we be turned to
direct call by inlining. I also noticed that estimate_edge_size_and_time fails
to accont code size savings by devirtualization when not asked to compute hints
(this is quite rare; only early inliner and inlining functions called once is
affected) and compensated for that in estimate_calls_size_and_time
gcc/ChangeLog:
* ipa-fnsummary.cc (estimate_edge_devirt_benefit): Handle speculative
edges correctly.
(estimate_edge_size_and_time): Even when not collecting hints,
devirtualization affects function size.
(estimate_calls_size_and_time): Do not use tables when devirtualization
is possible.
|
|
This patch fixed devirtualization time benefit of ipa-cp which should be scaled
by edge frequency but it is not. The cost model is still not correct for speculative
calls, since it does not take into account the fact that code size will shrink if
speculation is removed.
I also made cgraph_edge::make_direct to not ICE when there are multiple speculations
to same target. This can happen in combination of devirtualization and ICF in some
rare cases.
gcc/ChangeLog:
* cgraph.cc (cgraph_edge::make_direct): Do not ICE when there are
multiple speculations to comptaible targets
(cgraph_edge::combined_sreal_frequency): New member function.
* cgraph.h (cgraph_edge::combined_sreal_frequency): Declare.
* ipa-cp.cc (devirtualization_time_bonus): Return sreal; consider
profile.
(estimate_local_effects): Likewise.
|
|
2025-09-19 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/83746
* trans-array.cc (structure_alloc_comps): Add the pre and post
blocks to 'fnblock' for all the evaluations of parameterized
expressions in PDT component allocatation.
gcc/testsuite/
PR fortran/83746
* gfortran.dg/pdt_48.f03: New test.
|
|
The new wideset implementation uses an ARRAY OF BYTE (internally) to
represent large sets. This replaces the huge struct of anonymous
fields created by the old implementation and results in quicker
declaration times for large set types.
gcc/ChangeLog:
PR modula2/121856
* doc/gm2.texi (Compiler options): New item -fwideset.
gcc/m2/ChangeLog:
PR modula2/121856
* Make-lang.in (GM2-LIBS-BOOT-DEFS): Add M2Diagnostic.def.
Add Selective.def.
(GM2-LIBS-BOOT-MODS): Add M2Diagnostic.mod.
(GM2-LIBS-BOOT-C): Add Selective.c.
(GM2-LIBS-DEFS): Add Selective.def.
(GM2-LIBS-MODS): Add M2Diagnostic.mod.
(MC-LIB-MODS): Add M2Diagnostic.mod.
(m2/gm2-libs-boot/Selective.o): New rule.
(BUILD-PGE-O): Add m2/pge-boot/GM2Diagnostic.o.
Add m2/pge-boot/GM2Diagnostic.o.
Add m2/pge-boot/GStringConvert.o.
Add m2/pge-boot/Gdtoa.o.
Add m2/pge-boot/Gldtoa.o.
* Make-maintainer.in (PPG-LIB-DEFS): Add M2Diagnostic.def.
Add StringConvert.def.
(PPG-LIB-MODS): Add M2Diagnostic.mod.
Add StringConvert.mod.
(PGE-DEF): Add M2Diagnostic.def.
(PGE-DEPS): Add GM2Diagnostic.cc.
Add GM2Diagnostic.h.
* gm2-compiler/FifoQueue.def (PutSetIntoFifoQueue): New
procedure.
(GetSetFromFifoQueue): New procedure function.
* gm2-compiler/FifoQueue.mod (PutSetIntoFifoQueue): New
procedure.
(GetSetFromFifoQueue): New procedure function.
* gm2-compiler/M2ALU.def (KillValue): New procedure.
(PushSetTree): Rename parameter t to value.
(ConstructSetConstant): Rewrite comment.
* gm2-compiler/M2ALU.mod: Rewrite to use the new set type
and introduce memory diagnostics.
* gm2-compiler/M2Base.mod (InitBaseProcedures): Lookup M2WIDESET.
* gm2-compiler/M2CaseList.mod (CheckCaseBoundsResolved): Change
format specifier to allow the preceeding indefinite article to
have a n concatenated providing the following string substitute
begins with a vowel.
(checkTypes): Ditto.
* gm2-compiler/M2Check.mod (checkGenericUnboundedTyped): New
procedure function.
* gm2-compiler/M2Code.mod (OptimizationAnalysis): Replace with ...
(ResourceAnalysis): ... this.
* gm2-compiler/M2Comp.mod (PopulateResource): New procedure.
(compile): Call PopulateResource.
Call M2Diagnostic.Generate.
* gm2-compiler/M2GCCDeclare.mod: Rewrite for new set type.
* gm2-compiler/M2GenGCC.mod: Rewrite implementation for
becomes, incl, excl, and, or, not, xor for the new set type.
* gm2-compiler/M2MetaError.def: Extend comment documenting
the v format specifier.
* gm2-compiler/M2MetaError.mod (errorBlock): New field vowel.
(initErrorBlock): Initialize field vowel.
Reformat comments.
(pop): Call checkVowel.
(checkVowel): New procedure.
(isVowel): New procedure function.
(symDesc): Remove indefinite article.
(op): Set vowel field in case clause.
* gm2-compiler/M2Options.def (OptimizeSets): New global.
(TimeReport): Ditto.
(MemReport): Ditto.
(SetMemReport): New procedure.
(SetTimeReport): Ditto.
(SetWideset): Ditto.
(GetWideset): New procedure function.
* gm2-compiler/M2Options.mod (SetOptimizing): Assign
OptimizeSets depending upon the optimization level.
(SetMemReport): New procedure.
(SetTimeReport): Ditto.
(SetWideset): Ditto.
(GetWideset): New procedure function.
(OptimizeSets): Initialize to FALSE.
(TimeReport): Ditto.
(MemReport): Ditto.
* gm2-compiler/M2Quads.mod (M2Diagnostic): Import.
(QuadsMemDiag): New global variable.
(NewQuad): Bump QuadsMemDiag whenever a quad is allocated.
(BuildAssignmentBoolean): New procedure.
(doBuildAssignment): Ditto.
Add v to the format specifier.
(CheckCompatibleWithBecomes): Add v to the format specifier.
(CheckProcTypeAndProcedure): Ditto.
(BuildAddAdrFunction): Ditto.
(BuildSubAdrFunction): Ditto.
(BuildDifAdrFunction): Ditto.
(BuildDesignatorArrayStaticDynamic): Ditto.
(BuildDesignatorPointer): Ditto.
(CheckVariableOrConstantOrProcedure): Ditto.
(Init): Initialize QuadsMemDiag.
* gm2-compiler/M2Range.mod (CodeTypeAssign): Add v to the
format specifier.
* gm2-compiler/M2Scaffold.mod (DeclareScaffoldFunctions):
Generate more precise warning note.
* gm2-compiler/M2SymInit.mod (PrintSymInit): Add record
field warning.
* gm2-compiler/M2System.mod
(IsPseudoSystemFunctionConstExpression): Add TBitSize.
* gm2-compiler/NameKey.mod: Add MemDiagnostic code
commented out.
* gm2-compiler/P1SymBuild.mod (StartBuildProcedure):
Add v format specifier.
* gm2-compiler/P2SymBuild.mod (BuildFieldRecord): Ditto.
* gm2-compiler/P3Build.bnf (SetType): Reformat.
* gm2-compiler/PathName.def (Copyright): Added.
* gm2-compiler/PathName.mod: Remove blank line.
* gm2-compiler/SymbolConversion.mod (gdbhook): New procedure.
(BreakWhenSymBooked): Ditto.
(CheckBook): Ditto.
(Init): Rewrite.
* gm2-compiler/SymbolTable.def (GetSetArray): New procedure.
(PutSetArray): Ditto.
(MakeSetArray): New procedure function.
(PutSetInWord): New procedure.
(GetSetInWord): New procedure function.
(IsConstVar): Ditto.
* gm2-compiler/SymbolTable.mod (SymSet): SetInWord new field.
SetArray new field.
Align new field.
(SymMemDiag): New global variable.
(Init): Initialize SymMemDiag.
(IsConstVar): New procedure function.
(IsVariableSSA): Replace InternalError with Return FALSE.
(GetNthParamOrdered): Reimplement.
(GetNthParamAnyClosest): Ditto.
(GetOuterModuleScope): Ditto.
(MakeSet): Ditto.
(PutSetArray): New procedure.
(GetSetArray): New procedure function.
(MakeSetArray): Ditto.
(PutSetInWord): New procedure.
(GetSetInWord): New procedure function.
* gm2-gcc/init.cc (_M2_M2Diagnostic_init): Define
prototype.
(init_FrontEndInit):Call _M2_M2Diagnostic_init.
* gm2-gcc/m2block.cc (m2block_GetTotalConstants): New function.
(m2block_GetGlobalTypes): Ditto.
* gm2-gcc/m2block.def (GetTotalConstants): New procedure function.
(GetGlobalTypes): New procedure function.
* gm2-gcc/m2block.h (m2block_GetTotalConstants): New function
prototype.
(m2block_GetGlobalTypes): Ditto.
* gm2-gcc/m2convert.cc (converting_ISO_generic): Reimplement.
(m2convert_ToPIMByte): New function.
* gm2-gcc/m2convert.def (ToLoc): New procedure function.
(ToPIMByte): Ditto.
* gm2-gcc/m2convert.h (m2convert_ToPIMByte): Ditto.
* gm2-gcc/m2decl.h (m2decl_RememberVariables): Ditto.
* gm2-gcc/m2expr.cc (m2expr_BuildLogicalShift): Reimplement.
(m2expr_BuildLRotate): Ditto.
(m2expr_BuildLRLn): Ditto.
(m2expr_BuildLRRn): Ditto.
(m2expr_BuildLogicalRotate): Ditto.
(buildUnboundedArrayOf): Ditto.
(BuildIfBitInSetLower): New function.
(m2expr_BuildBinarySetDo): Reimplement.
(m2expr_BuildIfInSet): Ditto.
(m2expr_BuildIfNotInSet): New function.
(m2expr_Build4LogicalOr): Reimplement.
(m2expr_BuildSetNegate): Ditto.
(m2expr_BuildLogicalOrAddress): Ditto.
(m2expr_BuildLogicalOr): Ditto.
(m2expr_BuildLogicalAnd): Ditto.
(m2expr_BuildSymmetricDifference): Ditto.
(m2expr_BuildLogicalDifference): Ditto.
(boolean_enum_to_unsigned): Ditto.
(m2expr_BuildIsSuperset): Ditto.
(m2expr_BuildIsNotSuperset): Ditto.
(m2expr_BuildIsSubset): Ditto.
(m2expr_BuildIfBitInSetJump): Ditto.
(m2expr_BuildIfNotConstInVar): Ditto.
(m2expr_BuildIfVarInVar): Ditto.
(m2expr_BuildIfNotVarInVar): Remove.
(m2expr_BuildIfConstInVar): Remove.
(m2expr_BuildForeachWordInSetDoIfExpr): Ditto.
(m2expr_BuildBinaryForeachWordDo): Ditto.
(m2expr_BuildIfInRangeGoto): Reimplement.
(m2expr_BuildIfNotInRangeGoto): Ditto.
(m2expr_SetAndNarrow): Ditto.
(m2expr_GetBitsetZero): New function.
(m2expr_GetRValue): Ditto.
* gm2-gcc/m2expr.def (GetBitsetZero): New function.
(BuildSetNegate): Ditto.
(BuildLogicalOr): Reimplement.
(BuildLogicalAnd): Ditto.
(BuildSymmetricDifference): Ditto.
(BuildLogicalDifference): Ditto.
(BuildIfInSet): New procedure function.
(BuildIfNotInSet): Ditto.
(BuildEqualTo): Reimplement.
(BuildNotEqualTo): Ditto.
(BuildBinaryForeachWordDo): Remove.
(BuildBinarySetDo): Ditto.
(GetRValue): New procedure function.
* gm2-gcc/m2expr.h (m2expr_BuildBinaryForeachWordDo): Remove.
(m2expr_BuildForeachWordInSetDoIfExpr): Ditto.
(m2expr_BuildIfNotVarInVar): Ditto.
(m2expr_BuildIfVarInVar): Ditto.
(m2expr_BuildIfNotConstInVar): Ditto.
(m2expr_BuildIfConstInVar): Ditto.
(m2expr_BuildLogicalDifference): Reimplement.
(m2expr_BuildSymmetricDifference): Ditto.
(m2expr_BuildLogicalAnd): Ditto.
(m2expr_BuildLogicalOr): Ditto.
(m2expr_BuildLogicalOrAddress): Ditto.
(m2expr_BuildSetNegate): Ditto.
(m2expr_GetBitsetZero): New function.
(m2expr_GetRValue): Ditto.
(m2expr_BuildIfInSet): Ditto.
(m2expr_BuildIfNotInSet): Ditto.
* gm2-gcc/m2options.h (M2Options_SetTimeReport): New function.
(M2Options_SetMemReport): Ditto.
(M2Options_SetWideset): Ditto.
(M2Options_GetWideset): Ditto.
* gm2-gcc/m2pp.cc (m2pp_shiftrotate_expr): New function.
(m2pp_simple_expression): Ditto.
* gm2-gcc/m2statement.cc (m2statement_BuildStartFunctionCode):
Tidyup comments.
(m2statement_BuildEndFunctionCode): Ditto.
(m2statement_BuildPushFunctionContext): Ditto.
(copy_array): Ditto.
(CopyByField_Lower): Ditto.
(m2statement_BuildGoto): Ditto.
(m2statement_DeclareLabel): Ditto.
(m2statement_BuildParam): Ditto.
(nCount): Ditto.
(m2statement_BuildProcedureCallTree): Ditto.
(m2statement_BuildBuiltinCallTree): Ditto.
(m2statement_BuildFunctValue): Ditto.
(m2statement_BuildCall2): Ditto.
(m2statement_BuildCall3): Ditto.
(m2statement_BuildFunctionCallTree): Ditto.
(m2statement_SetLastFunction): Ditto.
(m2statement_SetParamList): Ditto.
(m2statement_GetLastFunction): Ditto.
(m2statement_GetParamList): Ditto.
(m2statement_GetCurrentFunction): Ditto.
(m2statement_GetParamTree): Ditto.
(m2statement_BuildTryFinally): Ditto.
(m2statement_BuildCleanUp): Ditto.
(m2statement_BuildUnaryForeachWordDo): Remove.
(m2statement_BuildExcludeVarConst): Ditto.
(m2statement_BuildExcludeVarVar): Ditto.
(m2statement_BuildIncludeVarConst): Ditto.
(m2statement_BuildIncludeVarVar): Ditto.
(m2statement_DoJump): Remove.
(m2statement_IfExprJump): New function.
(m2statement_IfBitInSetJump): Ditto.
* gm2-gcc/m2statement.def (DoJump): Remove.
(IfExprJump): New procedure function.
(BuildUnaryForeachWordDo): Remove.
(IfBitInSetJump): New procedure function.
* gm2-gcc/m2statement.h (m2statement_BuildForeachWordDo): Remove.
(m2statement_DoJump): Ditto.
(m2statement_IfExprJump): New function.
(m2statement_IfBitInSetJump): Ditto.
* gm2-gcc/m2treelib.cc (m2treelib_do_jump_if_bit): Reimplement.
(nCount): Replace with ...
(m2treelib_nCount): ... this.
(m2treelib_DoCall): Reimplement.
(m2treelib_get_rvalue): Remove.
* gm2-gcc/m2treelib.def (get_rvalue): Remove.
(nCount): New procedure function.
* gm2-gcc/m2treelib.h (m2treelib_get_rvalue): Remove.
(m2treelib_nCount): New function.
* gm2-gcc/m2type.cc (constructor_elements): Change type to vec.
(m2type_BuildEndArrayType): Reformat.
(build_m2_type_node_by_array): Ditto.
(m2type_GetBooleanEnumList): New procedure function.
(m2type_BuildEnumerator): Add const to char *.
(m2type_BuildSetConstructorElement): Reimplement.
(m2type_BuildEndSetConstructor): Ditto.
(build_record_constructor): New function.
(m2type_BuildEndRecordConstructor): Reimplement.
(m2type_BuildRecordConstructorElement): Ditto.
(m2type_BuildStartArrayConstructor): Reimplement.
(m2type_BuildEndArrayConstructor): Remove blank lines.
* gm2-gcc/m2type.def (BuildSetConstructorElement): Reimplement.
(BuildEndArrayType): Reformat.
(GetBooleanEnumList): New function.
* gm2-gcc/m2type.h (m2type_BuildEnumerator): Add const to char *.
(m2type_BuildSetConstructorElement): Reimplement.
(m2type_GetBooleanEnumList): New procedure function.
* gm2-lang.cc (OPT_fmem_report): New option.
(OPT_ftime_report): Ditto.
(OPT_fwideset): Ditto.
* gm2-libs-coroutines/SYSTEM.def (ShiftVal): Remove.
(ShiftLeft): Ditto.
(ShiftRight): Ditto.
(RotateVal): Ditto.
(RotateLeft): Ditto.
(RotateRight): Ditto.
* gm2-libs-coroutines/SYSTEM.mod: Reimplement.
* gm2-libs-iso/SYSTEM.def (ShiftVal): Remove.
(ShiftLeft): Ditto.
(ShiftRight): Ditto.
(RotateVal): Ditto.
(RotateLeft): Ditto.
(RotateRight): Ditto.
* gm2-libs-iso/SYSTEM.mod: Reimplement.
* gm2-libs/SYSTEM.def (ShiftVal): Remove.
(ShiftLeft): Ditto.
(ShiftRight): Ditto.
(RotateVal): Ditto.
(RotateLeft): Ditto.
(RotateRight): Ditto.
* gm2-libs/SYSTEM.mod: Reimplement.
* gm2-libs/SysStorage.def (DEALLOCATE): Improve comment.
* gm2-libs/SysStorage.mod: Improve comment.
* init/ppginit (M2Diagnostic): Add.
(StringConvert): Add.
* lang.opt (fmem-report): Add access to c.opt.
(ftime-report): Ditto.
(fwideset): New option.
* pge-boot/main.cc (_M2_M2Diagnostic_init): New function.
(_M2_M2Diagnostic_fini): Ditto.
(_M2_StringConvert_init): Ditto.
(_M2_StringConvert_fini): Ditto.
(main): Call _M2_M2Diagnostic_init.
Call _M2_StringConvert_init.
Call _M2_M2Diagnostic_fini.
Call _M2_StringConvert_fini.
* tools-src/makeSystem: Add -gdb option.
* gm2-libs/M2Diagnostic.def: New file.
* gm2-libs/M2Diagnostic.mod: New file.
* gm2-libs/M2WIDESET.def: New file.
* gm2-libs/M2WIDESET.mod: New file.
* mc-boot/GM2Diagnostic.cc: New file.
* mc-boot/GM2Diagnostic.h: New file.
* pge-boot/GM2Diagnostic.cc: New file.
* pge-boot/GM2Diagnostic.h: New file.
* pge-boot/GSelective.h: New file.
* pge-boot/GStringConvert.cc: New file.
libgm2/ChangeLog:
* libm2pim/Makefile.am (M2MODS): Add M2Diagnostic.mod.
Add M2WIDESET.mod.
(M2DEFS): Add M2Diagnostic.def.
Add M2WIDESET.def.
* libm2pim/Makefile.in: Regenerate.
gcc/testsuite/ChangeLog:
* gm2/errors/fail/testbit2.mod: Rewrite.
* gm2/iso/run/pass/shift4.mod: Rewrite adding more internal
tests.
* gm2/iso/run/pass/testsystem.mod (FindFirstElement): Add
bounds check.
* gm2/sets/run/pass/multisetrotate4.mod: Add more runtime
error messages.
* gm2/sets/run/pass/simplepacked.mod (testpset): Correct
setname.
* lib/gm2.exp (gm2_init_minx): Add -fno-wideset.
* gm2/iso/run/pass/assigncons.mod: New test.
* gm2/iso/run/pass/constructor3.mod: New test.
* gm2/iso/run/pass/proc_test.mod: New test.
* gm2/iso/run/pass/simplelarge2.mod: New test.
* gm2/iso/run/pass/simplelarge3.mod: New test.
* gm2/iso/run/pass/simplelarge4.mod: New test.
* gm2/pimlib/wideset/run/pass/bitset.mod: New test.
* gm2/pimlib/wideset/run/pass/bitset2.mod: New test.
* gm2/pimlib/wideset/run/pass/colorset.mod: New test.
* gm2/pimlib/wideset/run/pass/colorset2.mod: New test.
* gm2/pimlib/wideset/run/pass/colorset3.mod: New test.
* gm2/pimlib/wideset/run/pass/highbit.mod: New test.
* gm2/pimlib/wideset/run/pass/highbit2.mod: New test.
* gm2/sets/run/pass/multisetrotate5.mod: New test.
* gm2/sets/run/pass/setcard.mod: New test.
* gm2/sets/run/pass/setincl.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
|
|
So this was a naked REGNO usage, which of course blows up if RTL checking is
enabled and something else sneaks in (SUBREG). Thankfully it never results in
incorrect code, though I could theorize it could cause a bootstrap comparison
failure in the "right" circumstances.
Bootstrapped & regression tested on the Pioneer. Also regression tested on
riscv64-elf and riscv32-elf. I'll push to the trunk once pre-commit CI is
done.
jeff
PR target/121983
gcc/
* config/riscv/riscv.cc (riscv_macro_fusion_pair_p): Make sure
object is a REG before asking for its REGNO. Fix a trivial
whitespace nit.
gcc/testsuite/
* gcc.target/riscv/pr121983.c: New test.
|
|
Improve shuffle_slide_patterns to better recognize permutations that
can be constructed by a slideup or slidedown, covering more cases:
Slideup one vector into the middle the other like
{0, 4, 5, 3}.
Slidedown one vector not ending in the last element like
{5, 6, 2, 3}.
Slidedown one vector from the beginning like
{4, 5, 2, 3}.
gcc/ChangeLog:
* config/riscv/riscv-v.cc
(shuffle_slide_patterns): Cover more permutations.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/shuffle-slide-run.h:
New test.
* gcc.target/riscv/rvv/autovec/shuffle-slidedown-run.c:
Likewise.
* gcc.target/riscv/rvv/autovec/shuffle-slideup-run.c:
Likewise.
* gcc.target/riscv/rvv/autovec/vls-vlmax/shuffle-slide.h:
Likewise.
* gcc.target/riscv/rvv/autovec/vls-vlmax/shuffle-slidedown-1.c:
Likewise.
* gcc.target/riscv/rvv/autovec/vls-vlmax/shuffle-slidedown-2.c:
Likewise.
* gcc.target/riscv/rvv/autovec/vls-vlmax/shuffle-slidedown-perm.h:
Likewise.
* gcc.target/riscv/rvv/autovec/vls-vlmax/shuffle-slideup-1.c:
Likewise.
* gcc.target/riscv/rvv/autovec/vls-vlmax/shuffle-slideup-2.c:
Likewise.
* gcc.target/riscv/rvv/autovec/vls-vlmax/shuffle-slideup-perm.h:
Likewise.
|
|
Previously the spec
https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/70
has changed the save/restore routines to save/restore the registers which
are really used for ILP32E/LP64 rather than always save/restore all
of ra/s0/s1.
I also found here that lacks the implementation for lp64e. If it's
necessary I will file anothor patch for that.
gcc/ChangeLog:
* config/riscv/riscv.cc (riscv_compute_frame_info): Remove the
dedicated calculation for RVE.
libgcc/ChangeLog:
* config/riscv/save-restore.S: Only save/restore the registers
which are really used for ILP32E/LP64.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/save-restore-cfi-3.c: New test.
|
|
Daniel Barboza and I were looking at deepsjeng recently and spotted an oddity.
In particular we had a sequence like this:
addi a1,a0,-1
and a1,a0,a1
That idiom clears the lowest set bit in a0. In the initial code we looked at
there was a subsequent ctz dest,a0. In other cases I could see an earlier ctz.
And when I went digging further I even found the ctz between the addi/and.
The key is the ctz uses the same input as the addi, but a different output. So
the ctz doesn't participate in combine with the addi/and.
Tackling this in gimple isn't really feasible as the resultant code is going to
have a higher expression count. The bclr idiom looks like (and (rotate (-2)
(count) (input)) where the count comes from a ctz. SO to make it work from a
costing standpoint, we'd have to go find the ctz and use it.
Tackling in gimple->rtl expansion looked potentially feasible, but sign and
general type changes make that painful. So while I could see the add+and and
could speculatively hope there was a nearby ctz it looked less than ideal from
an implementation standpoint. It also tickled some undesirable behavior in the
combiner.
Tackling in combine isn't possible because the ctz doesn't feed the addi/and or
vice-versa.
Tackling with a peephole works sometimes, but is easily thwarted by the
scheduler putting random code in the middle of the sequences we want to adjust.
So in the end I just made a new RISC-V pass that runs after combine.
It walks each block looking for the addi+and construct. When found it then
looks a few instructions in either direction for a related ctz. When found
it'll move things around as necessary and use ctz+bclr. It depends on DCE to
eliminate the almost certainly dead addi+and insns.
I haven't benchmarked this one on design, but it's definitely picking up the
opportunities in deepsjeng and saves a few billion instructions. It has
survived a riscv64-elf and riscv32-elf build. Bootstrap on the BPI is in
flight, bootstrap on the Pioneer passes, but this code won't trigger this
because the Pioneer doesn't have ctz or bclr instructions.
Note while I would expect some of this pass to be usable on other targets, it
does make some assumptions about RTL structure that hold on RISC-V. For
example subword arithmetic has an explicit sign extension to word mode, bit
position is QImode, etc.
Comments? Other thoughts on how to resolve?
gcc/
* config.gcc (riscv*); Add riscv-bclr-lowest-set-bit.o to extra_objs.
* config/riscv/riscv-bclr-lowest-set-bit.cc: New file.
* config/riscv/riscv-passes.def: Add new pass after combine.
* config/riscv/riscv-protos.h (make_pass_bclr_lowest_set_bit): Add
prototype.
* config/riscv/t-riscv: Add rules to build riscv-bclr-lowest-set-bit.o.
gcc/testsuite
* gcc.target/riscv/bclr-lowest-set-bit-1.c: New test.
|
|
The following removes a block I added (and disabled again) when
developing the PR121720 fix.
* tree-ssa-pre.cc (compute_antic_aux): Remove dead code.
|
|
gcc/ada/ChangeLog:
* gcc-interface/gigi.h (create_var_decl): Add LINKONCE_FLAG boolean
parameter.
(create_subprog_decl): Likewise.
* gcc-interface/decl.cc (gnat_to_gnu_entity): Adjust calls to
create_var_decl and create_subprog_decl.
(elaborate_expression_1): Likewise.
* gcc-interface/trans.cc (gigi): Likewise.
(build_raise_check): Likewise.
(Subprogram_Body_to_gnu): Likewise.
(create_temporary): Likewise.
(Exception_Handler_to_gnu): Likewise.
(Compilation_Unit_to_gnu): Likewise.
(gnat_to_gnu): Likewise.
(use_alias_for_thunk_p): Return false for a one-only target.
* gcc-interface/utils.cc (maybe_pad_type): Adjust call to
create_var_decl.
(create_var_decl): Add LINKONCE_FLAG boolean parameter.
(create_subprog_decl): Likewise.
|
|
This change introduces the support for the new GNAT specific
Extended_Access aspect for access to unconstrained array type :
type Ext_Access is access all Some_Array_Type with Extended_Access;
This new kind of access type does not use the existing "fat" layout with
a record of two pointers: one to the actual data, one to a record with the
bounds of the array. Instead, it removes the second indirection and extends
the record to contain the pointer to the actual data followed by the bounds.
This mainly allows the following features:
- have access to slice of array
- easier interface when allocation is done in a foreign language
gcc/ada/ChangeLog:
* gcc-interface/ada-tree.h (TYPE_EXTENDED_POINTER_P): New.
(TYPE_IS_EXTENDED_POINTER_P): New.
(TYPE_EXTENDED_UNCONSTRAINED_ARRAY): New.
(SET_TYPE_EXTENDED_UNCONSTRAINED_ARRAY): New.
(TYPE_DUMMY_EXT_POINTER_TO): New.
(SET_TYPE_DUMMY_EXT_POINTER_TO): New.
* gcc-interface/decl.cc (get_extended_unconstrained_array): New.
(gnat_to_gnu_entity): Handle extended access type.
(get_unpadded_extended_type): New.
(gnat_to_gnu_component_type): Handle extended access type.
(build_template_type): New.
(gnat_to_gnu_field): Handle extended access type.
(validate_size): Likewise.
(set_rm_size): Likewise.
(copy_and_substitute_in_layout): Likewise.
(rm_size): Likewise.
* gcc-interface/gigi.h (get_unpadded_extended_type): New.
(build_template_type): New.
(build_dummy_unc_pointer_types_ext): New.
(finish_extended_pointer_type): New.
(build_unc_object_type_from_ptr): Rename first parameter.
* gcc-interface/misc.cc (gnat_print_type): Handle extended access type.
* gcc-interface/trans.cc (Identifier_to_gnu): Likewise.
(Attribute_to_gnu): Likewise.
(gnat_to_gnu): Likewise.
* gcc-interface/utils.cc (convert_to_fat_pointer): Assert if converting an
extended pointer.
(build_dummy_unc_pointer_types_ext): New.
(finish_extended_pointer_type): New.
(finish_record_type): Handle extended access type.
(build_unc_object_type_from_ptr): Likewise.
(convert_to_extended_pointer): New.
(convert): Handle extended access type.
(gnat_pushdecl): Likewise.
(maybe_pad_type): Likewise.
* gcc-interface/utils2.cc (build_unary_op): Likewise.
(build_binary_op): Likewise.
(build_allocator): Likewise.
(gnat_save_expr): Likewise.
(gnat_protect_expr): Likewise.
(gnat_stabilize_reference_1): Likewise.
|
|
This adds a guard for the case of a selected component whose prefix is an
illegal structural generic instance.
gcc/ada/ChangeLog:
* sem_ch4.adb (Analyze_Selected_Component): Bail out if the prefix
has Void_Type.
|
|
Code cleanup; semantics is unaffected.
gcc/ada/ChangeLog:
* sem_ch4.adb (Analyze_User_Defined_Binary_Op): Remove declare block.
|
|
It contains the changes to the parser required for the new syntax, as well
as the mechanism to instantiate generics implicitly. The implementation is
strictly structural, in the sense that if the implicit instantiation cannot
be made structural for semantic dependence reasons, then it is rejected.
gcc/ada/ChangeLog:
* doc/gnat_rm/gnat_language_extensions.rst (Structural Generic
Instantiation): New entry
* einfo.ads (Is_Link_Once): New flag defined in entities.
* sinfo.ads (Is_Structural): New flag defined in instantiations.
* gen_il-fields.ads (Opt_Field_Enum): Add Is_Link_Once and
Is_Structural.
* gen_il-gen-gen_entities.adb (Entity_Kind): Add Is_Link_Once
semantic flag.
* gen_il-gen-gen_nodes.adb (N_Generic_Instantiation): Move up
Parent_Spec field and add Is_Structural semantic flag.
* frontend.adb: Add with clause for Sem_Ch12.
(Frontend): After analysis is complete and bodies are instantiated,
call Sem_Ch12.Mark_Link_Once on the declarations of the main unit.
* par.adb (P_Qualified_Simple_Name): Delete.
(P_Qualified_Simple_Name_Resync): Likewise
(P_Exception_Name): New function declaration.
(P_Label_Name): Likewise.
(P_Loop_Name): Likewise.
(P_Generic_Unit_Name): Likewise.
(P_Library_Unit_Name): Likewise.
(P_Package_Name): Likewise.
(P_Parent_Unit_Name): Likewise.
(P_Subtype_Name): Likewise.
(P_Subtype_Name_Resync): Likewise.
* par-ch3.adb (P_Subtype_Mark_Resync): Replace call to
P_Qualified_Simple_Name_Resync by P_Subtype_Name_Resync.
(P_Identifier_Declarations): Replace call to
P_Qualified_Simple_Name_Resync by P_Exception_Name.
(P_Derived_Type_Def_Or_Private_Ext_Decl): Replace call to
P_Qualified_Simple_Name by P_Subtype_Name.
(P_Interface_Type_Definition): Replace calls to
P_Qualified_Simple_Name by P_Subtype_Name.
* par-ch4.adb (P_Reduction_Attribute_Reference): Move around and
change name of parameter.
(P_Name): Document new grammar rule and make a couple of tweaks.
(P_Exception_Name): New function.
(P_Label_Name): Likewise.
(P_Loop_Name): Likewise.
(P_Generic_Unit_Name): Likewise.
(P_Library_Unit_Name): Likewise.
(P_Package_Name): Likewise.
(P_Parent_Unit_Name): Likewise.
(P_Subtype_Name): Likewise.
(P_Subtype_Name_Resync): Likewise.
(P_Qualified_Simple_Name): Rename into...
(P_Simple_Name): ...this.
(P_Qualified_Simple_Name_Resync): Rename into...
(P_Simple_Name_Resync): ...this. Accept left parenthesis and
dot as name extensions.
(P_Allocator): Replace call to P_Qualified_Simple_Name_Resync
by P_Subtype_Name_Resync.
* par-ch5.adb (P_Goto_Statement): Replace call to
P_Qualified_Simple_Name by P_Label_Name.
(Parse_Loop_Flow_Statement): Replace call to
P_Qualified_Simple_Name by P_Loop_Name.
* par-ch6.adb (P_Subprogram): Replace call to
P_Qualified_Simple_Name by P_Generic_Unit_Name.
* par-ch7.adb (P_Package): Replace calls to
P_Qualified_Simple_Name by P_Package_Name and P_Generic_Unit_Name.
* par-ch8.adb (P_Use_Package_Clause): Replace calls to
P_Qualified_Simple_Name by P_Package_Name.
* par-ch9.adb (P_Task): Replace call to
P_Qualified_Simple_Name by P_Subtype_Name.
(P_Protected): Likewise.
* par-ch10.adb (P_Context_Clause): Replace call to
P_Qualified_Simple_Name by P_Library_Unit_Name.
(P_Subunit): Replace call to P_Qualified_Simple_Name by
P_Parent_Unit_Name.
* par-ch12.adb (P_Generic): Replace call to
P_Qualified_Simple_Name by P_Generic_Unit_Name.
(P_Formal_Derived_Type_Definition): Replace call to
P_Qualified_Simple_Name by P_Subtype_Name.
(P_Formal_Package_Declaration): Replace call to
P_Qualified_Simple_Name by P_Generic_Unit_Name.
* sem_ch4.adb: Add with and use clauses for Sem_Ch12.
(Analyze_Call): Accept implicit instantiations with -gnatX0.
(Analyze_Indexed_Component_Form): Likewise.
* sem_ch8.adb (Analyze_Use_Package): Add guard before inserting
a with clause automatically when there is a use clause.
(Check_In_Previous_With_Clause): Retrieve original names.
(Check_Library_Unit_Renaming): Deal with structural instances.
(End_Use_Type): Minor tweak.
* sem_ch10.adb (Analyze_With_Clause): Remove useless test and
call Defining_Entity_Of_Instance.
* sem_ch12.ads (Build_Structural_Instantiation): New function.
(Mark_Link_Once): New procedure.
* sem_ch12.adb: Add with and use clauses for Exp_Dbug.
(Analyze_Associations): Add support for structural instantiations.
(Analyze_Package_Instantiation): Likewise.
(Analyze_Subprogram_Instantiation): Likewise.
(Analyze_Structural_Associations): New procedure.
(Need_Subprogram_Instance_Body): Return True for instantiation is
in the auxiliary declarations of the main unit.
(Build_Structural_Instantiation): New function.
(Mark_Link_Once): New procedure.
* sem_util.ads (Add_Local_Declaration): New procedure.
(Defining_Entity_Of_Instance): New function.
* sem_util.adb (Add_Local_Declaration): New procedure.
(Defining_Entity_Of_Instance): New function.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
|
|
The comment this patch changes claimed that operational aspects are
"view-specific". The following excerpt from ARM 13.1 (11/5) indicates
that the set of view-specific aspects is in fact much more restricted:
If a type-related aspect is defined for the partial view of a type,
then it has the same definition for the full view of the type, except
for certain Boolean-valued operational aspects where the language
specifies that the partial view can have the value False even when
the full view has the value True.
On the other hand, a feature of operational aspects is that they can be
specified on partial views, unlike representation aspects. That's stated
by AARM 13.1 (9.c/1):
Unlike representation items, operational items can be specified on
partial views.
So this patch changes the comment to be about that instead.
gcc/ada/ChangeLog:
* aspects.ads: Fix comment.
|
|
The comment this patch removes was about representation aspects but it
was placed above Operational_Aspect. The comment in itself was not very
helpful either since operational aspects, for example, are also needed
during expansion and code generation.
gcc/ada/ChangeLog:
* aspects.ads: Remove comment.
|
|
Add the Put_Image_Extended_Access_Pointer procedure for supporting
Ext_Access'Image.
gcc/ada/ChangeLog:
* libgnat/s-putima.ads (Ext_Access_Pointer): New.
(Put_Image_Extended_Access_Pointer): New.
* libgnat/s-putima.adb (Ext_Acc_Instance): New.
(Put_Image_Extended_Access_Pointer): New.
* rtsfind.ads (RE_Id, RE_Unit_Table): Set value for
RE_Put_Image_Extended_Access_Pointer.
* exp_put_image.adb (Build_Elementary_Put_Image_Call): Handle extended
access.
|
|
gcc/ada/ChangeLog:
* fe.h (Is_Extended_Access_Type): Add C bindings.
* sem_util.ads (Is_Extended_Access_Type): Add comment that any
change to the function must take care of the C binding.
|
|
The size of an extended access is unknown at this stage, so leave Esize
empty.
gcc/ada/ChangeLog:
* layout.adb (Layout_Type): Adjust comment and code extended
accesses.
|
|
This patch removes two occurrences of the following pattern:
Analyze_Component_Declaration (N);
Mutate_Ekind (Defining_Identifier (N), E_Component);
The second statement here has absolutely no effect, so its presence can
be confusing to the reader.
gcc/ada/ChangeLog:
* sem_ch3.adb (Add_Tag): Remove superfluous statements.
|
|
When necessary, the compiler builds subprograms to implement the streaming
attributes (or the Put_Image attribute) for a type. In some cases involving
separate subunits, these compiler-generated subprograms were inserted at the
wrong point in the tree, resulting in internal compiler errors.
gcc/ada/ChangeLog:
* exp_attr.adb (Interunit_Ref_OK): Treat a subunit like a body.
(Build_And_Insert_Type_Attr_Subp): When climbing up the
tree, go from an N_Subunit node to its stub (instead of to the
subunit's N_Compilation_Unit node).
|
|
The compiler fails, either with an Assert_Failure (for a compiler with
assertions enabled) or by producing a bad value, when processing a VADS_Size
attribute (or a Size attribute when pragma Use_VADS_Size is in force),
in the case where the prefix denotes a composite type or subtype whose
object size (Esise) is not known by the front end. The bug is due to
Eval_Attribute attempting to fold a VADS-related size attribute even
when Esize is not yet known for the type.
gcc/ada/ChangeLog:
* sem_attr.adb (Eval_Attribute): In the case of a VADS-specific
size attribute, only fold to the object size when the Esize field
is known.
|
|
libstdc++-v3/ChangeLog:
* include/bits/version.def (start_lifetime_as): Move adjacent to
other C++23 macros.
* include/bits/version.h: Regenerate.
|
|
This was only used for non-SLP.
* tree-vectorizer.h (_stmt_vec_info::store_count): Remove.
(DR_GROUP_STORE_COUNT): Likewise.
* tree-vect-stmts.cc (vect_transform_stmt): Remove non-SLP
path.
|
|
The following removes the dual non-SLP/SLP API in favor of only
handling SLP. This also removes the possibility to override
vectype of a SLP node with an inconsistent one while still using
the SLP nodes number of lanes. This requires adjustment of
a few places where such inconsistencies happened.
* tree-vectorizer.h (vect_get_num_copies): Remove unused
overload. Remove defaulted vectype argument and always
use the vector type of the SLP node.
* tree-vect-loop.cc (vect_reduction_update_partial_vector_usage):
Adjust.
(vectorizable_lane_reducing): Likewise.
(vect_transform_reduction): Likewise.
(vectorizable_nonlinear_induction): Likewise.
* tree-vect-stmts.cc (check_load_store_for_partial_vectors):
Likewise.
|
|
The following removes the redundant SLP_TREE_NUMBER_OF_VEC_STMTS,
replacing it with vect_get_num_copies. Previously it was already
made sure that all setters adhere to that.
* tree-vectorizer.h (_slp_tree::vec_stmts_size): Remove.
(SLP_TREE_NUMBER_OF_VEC_STMTS): Likewise.
* tree-vect-loop.cc (vectorizable_reduction): Adjust.
(vect_transform_cycle_phi): Likewise.
(vect_transform_lc_phi): Likewise.
(vectorizable_recurr): Likewise.
(vectorizable_induction): Likewise.
(vectorizable_live_operation): Likewise.
* tree-vect-slp.cc (_slp_tree::_slp_tree): Do not set
SLP_TREE_NUMBER_OF_VEC_STMTS.
(vect_slp_analyze_node_operations_1): Likewise.
(vect_slp_analyze_node_operations): Likewise.
(vect_prologue_cost_for_slp): Adjust.
(vect_create_constant_vectors): Likewise.
(vect_get_slp_vect_def): Likewise.
(vect_transform_slp_perm_load_1): Likewise.
(vectorizable_slp_permutation_1): Likewise.
(vect_schedule_slp_node): Likewise.
(vectorize_slp_instance_root_stmt): Likewise.
* tree-vect-stmts.cc (vect_model_simple_cost): Likewise.
(vectorizable_bswap): Likewise.
(vectorizable_call): Likewise.
(vectorizable_conversion): Likewise.
(vectorizable_shift): Likewise.
(vectorizable_operation): Likewise.
(vectorizable_store): Likewise.
(vectorizable_load): Likewise.
(vectorizable_condition): Likewise.
(vectorizable_early_exit): Likewise.
|
|
|
|
Add further tests for things defined in C2Y that correspond to how GCC
already behaves. Some of these are for previous undefined behavior
where what is violated has become a constraint but previously was a
"shall" outside Constraints. Others (c2y-anon-init-1.c and
c2y-incomplete-2.c) reflect semantics that were intended all along but
not correctly or sufficiently clearly stated in the standard.
Tested for x86_64-pc-linux-gnu.
* gcc.dg/c2y-anon-init-1.c, gcc.dg/c2y-incomplete-2.c:
gcc.dg/c2y-linkage-1.c, gcc.dg/c2y-linkage-2.c,
gcc.dg/c2y-linkage-3.c, gcc.dg/c2y-linkage-4.c,
gcc.dg/c2y-static-assert-1.c: New tests.
|
|
It's now possible to see an active member of a union that has not actually
been initialized, so let's clarify the diagnostic.
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_component_reference): Clarify diagnostic.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/constexpr-98122.C: Adjust diagnostic.
* g++.dg/cpp26/constexpr-new6a.C: New test.
|