Age | Commit message (Collapse) | Author | Files | Lines |
|
In the pattern X - (X / Y) * Y to X % Y, this patch guards the
simplification for vector types by a check for:
1) Support of the mod optab for vectors OR
2) Application before vector lowering for non-VL vectors.
This is to prevent reverting vectorization of modulo to div/mult/sub
if the target does not support vector mod optab.
The patch was bootstrapped and tested with no regression on
aarch64-linux-gnu and x86_64-linux-gnu.
OK for mainline?
Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
gcc/
PR tree-optimization/116569
* match.pd: Guard simplification to trunc_mod with check for
mod optab support.
gcc/testsuite/
PR tree-optimization/116569
* gcc.dg/torture/pr116569.c: New test.
|
|
The new macro is required because reload and LRA are using different
representations for a multi-register frame pointer. As ELIMINABLE_REGS
is used to initialize static const objects, it can't depend on -mlra.
PR rtl-optimization/116326
gcc/
* reload1.cc (reg_eliminate_1): Initialize from
RELOAD_ELIMINABLE_REGS if defined.
* config/avr/avr.h (RELOAD_ELIMINABLE_REGS): Copy from ELIMINABLE_REGS.
(ELIMINABLE_REGS): Don't mention sub-regnos of the frame pointer.
* doc/tm.texi.in (Eliminating Frame Pointer and Arg Pointer)
<RELOAD_ELIMINABLE_REGS>: Add documentation.
* doc/tm.texi: Rebuild.
gcc/testsuite/
* gcc.target/avr/torture/lra-pr116324.c: New test.
* gcc.target/avr/torture/lra-pr116325.c: New test.
|
|
gcc/
* doc/install.texi (Host/Target specific installation notes for GCC)
[avr]: Update web links to AVR-LibC and AVR Options.
Remove outdated note about Binutils.
|
|
split_constant_offset when looking through SSA defs can end up
picking SSA leafs that are subject to abnormal coalescing. This
can lead to downstream consumers to insert code based on the
result (like from dataref analysis) in places that violate constraints
for abnormal coalescing. It's best to not expand defs whose operands
are subject to abnormal coalescing - and not either do something when
a subexpression has operands like that already.
PR tree-optimization/116585
* tree-data-ref.cc (split_constant_offset_1): When either
operand is subject to abnormal coalescing do no further
processing.
* gcc.dg/torture/pr116585.c: New testcase.
|
|
This C++ify cond_if_else_store_replacement by using range fors
and changing using a std::pair instead of 2 vecs.
I had a hard time understanding the code when there was 2 vecs
so having a vec of a pair makes it easier to understand the relationship
between the 2.
gcc/ChangeLog:
* tree-ssa-phiopt.cc (cond_if_else_store_replacement): Use
range fors and use one vec for then/else stores instead of 2.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
|
|
While trying to debug PR 116747, I noticed there was no dump
saying what was done. So this adds the debug dump and it helps
debug what is going on in PR 116747 too.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* tree-ssa-phiopt.cc (cond_if_else_store_replacement_1): Add debug dump.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
|
|
This patch would like to implement the ssadd for vector integer. Aka
form 1 of ssadd vector.
Form 1:
#define DEF_VEC_SAT_S_ADD_FMT_1(T, UT, MIN, MAX) \
void __attribute__((noinline)) \
vec_sat_s_add_##T##_fmt_1 (T *out, T *op_1, T *op_2, unsigned limit) \
{ \
unsigned i; \
for (i = 0; i < limit; i++) \
{ \
T x = op_1[i]; \
T y = op_2[i]; \
T sum = (UT)x + (UT)y; \
out[i] = (x ^ y) < 0 \
? sum \
: (sum ^ x) >= 0 \
? sum \
: x < 0 ? MIN : MAX; \
} \
}
DEF_VEC_SAT_S_ADD_FMT_1(int64_t, uint64_t, INT64_MIN, INT64_MAX)
Before this patch:
vec_sat_s_add_int64_t_fmt_1:
...
vsetvli t1,zero,e64,m1,ta,mu
vadd.vv v3,v1,v2
vxor.vv v0,v1,v3
vmslt.vi v0,v0,0
vxor.vv v2,v1,v2
vmsge.vi v2,v2,0
vmand.mm v0,v0,v2
vsra.vx v1,v1,t3
vxor.vv v3,v1,v4,v0.t
...
After this patch:
vec_sat_s_add_int64_t_fmt_1:
...
vsetvli a6,zero,e64,m1,ta,ma
vsadd.vv v1,v1,v2
...
The below test suites are passed for this patch.
* The rv64gcv fully regression test.
gcc/ChangeLog:
* config/riscv/autovec.md (ssadd<mode>3): Add new pattern for
signed integer vector SAT_ADD.
* config/riscv/riscv-protos.h (expand_vec_ssadd): Add new func
decl for vector ssadd expanding.
* config/riscv/riscv-v.cc (expand_vec_ssadd): Add new func impl
to expand vector ssadd pattern.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/binop/vec_sat_data.h: Add test
data for vector ssadd.
* gcc.target/riscv/rvv/autovec/vec_sat_arith.h: Add test helper
macros.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_add-1.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_add-2.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_add-3.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_add-4.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_add-run-1.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_add-run-2.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_add-run-3.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vec_sat_s_add-run-4.c: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
|
|
This patch fixes PR target/89213 to allow better code to be generated to do
constant shifts of V2DI/V2DF vectors. Previously GCC would do constant shifts
of vectors with 64-bit elements by using:
XXSPLTIB 32,4
VEXTSB2D 0,0
VSRAD 2,2,0
I.e., the PowerPC does not have a VSPLTISD instruction to load -15..14 for the
64-bit shift count in one instruction. Instead, it would need to load a byte
and then convert it to 64-bit.
With this patch, GCC now realizes that the vector shift instructions will look
at the bottom 6 bits for the shift count, and it can use either a VSPLTISW or
XXSPLTIB instruction to load the shift count.
2024-09-17 Michael Meissner <meissner@linux.ibm.com>
gcc/
PR target/89213
* config/rs6000/altivec.md (UNSPEC_VECTOR_SHIFT): New unspec.
(VSHIFT_MODE): New mode iterator.
(vshift_code): New code iterator.
(vshift_attr): New code attribute.
(altivec_<mode>_<vshift_attr>_const): New pattern to optimize
vector long long/int shifts by a constant.
(altivec_<mode>_shift_const): New helper insn to load up a
constant used by the shift operation.
* config/rs6000/predicates.md (vector_shift_constant): New
predicate.
gcc/testsuite/
PR target/89213
* gcc.target/powerpc/pr89213.c: New test.
* gcc.target/powerpc/vec-rlmi-rlnm.c: Update instruction count.
|
|
|
|
The result of build_fold_indirect_ref can be a COMPONENT_REF in
which case using DECL_SOURCE_LOCATION will crash. Look at its op1
instead.
PR c++/116741
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_constant_expression) <case CONVERT_EXPR>: If
the result of build_fold_indirect_ref is a COMPONENT_REF, use its op1.
Check DECL_P before calling inform.
gcc/testsuite/ChangeLog:
* g++.dg/cpp26/constexpr-voidptr4.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
|
|
Pre r14-4793, we'd call warn_tautological_cmp -> operand_equal_p
with operands wrapped in NON_DEPENDENT_EXPR, which works, since
o_e_p bails for codes it doesn't know. But now we pass operands
not encapsulated in NON_DEPENDENT_EXPR, and crash, because the
template tree for &a[x] has null DECL_FIELD_OFFSET.
This patch extends r12-7797 to cover the case when DECL_FIELD_OFFSET
is null.
PR c++/116534
gcc/ChangeLog:
* fold-const.cc (operand_compare::operand_equal_p): If either
field's DECL_FIELD_OFFSET is null, compare the fields with ==.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wtautological-compare4.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
|
|
r12-3495 added maybe_warn_about_constant_value which will crash if
it gets a nameless VAR_DECL, which is what happens in this PR.
We created this VAR_DECL in cp_parser_decomposition_declaration.
PR c++/116676
gcc/cp/ChangeLog:
* constexpr.cc (maybe_warn_about_constant_value): Check DECL_NAME.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1z/constexpr-116676.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
|
|
This patch folds svdiv where one of the operands is all-zeros to a zero
vector, if one of the following conditions holds:
- the dividend is all zeros or
- the divisor is all zeros, and the predicate is ptrue or the predication
is _x or _z.
This case was not covered by the recent patch that implemented constant
folding, because that covered only cases where both operands are
constant vectors. Here, the operation is folded as soon as one of the operands
is a constant zero vector.
Folding of divison by 0 to return 0 is in accordance with
the semantics of sdiv and udiv.
The patch was bootstrapped and regtested on aarch64-linux-gnu, no regression.
OK for mainline?
Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
gcc/
* config/aarch64/aarch64-sve-builtins-base.cc (svdiv_impl::fold):
Add folding of all-zero operands to zero vector.
gcc/testsuite/
* gcc.target/aarch64/sve/fold_div_zero.c: New test.
* gcc.target/aarch64/sve/const_fold_div_1.c: Adjust expected
outcome.
|
|
|
|
[PR113328]
SVE's INDEX instruction can be used to populate vectors by values starting from
"base" and incremented by "step" for each subsequent value. We can take
advantage of it to generate vector constants if TARGET_SVE is available and the
base and step values are within [-16, 15].
For example, with the following function:
typedef int v4si __attribute__ ((vector_size (16)));
v4si
f_v4si (void)
{
return (v4si){ 0, 1, 2, 3 };
}
GCC currently generates:
f_v4si:
adrp x0, .LC4
ldr q0, [x0, #:lo12:.LC4]
ret
.LC4:
.word 0
.word 1
.word 2
.word 3
With this patch, we generate an INDEX instruction instead if TARGET_SVE is
available.
f_v4si:
index z0.s, #0, #1
ret
PR target/113328
gcc/ChangeLog:
* config/aarch64/aarch64.cc (aarch64_simd_valid_immediate): Improve
handling of some ADVSIMD vectors by using SVE's INDEX if TARGET_SVE is
available.
(aarch64_output_simd_mov_immediate): Likewise.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/sve/acle/general/dupq_1.c: Update test to use
SVE's INDEX instruction.
* gcc.target/aarch64/sve/acle/general/dupq_2.c: Likewise.
* gcc.target/aarch64/sve/acle/general/dupq_3.c: Likewise.
* gcc.target/aarch64/sve/acle/general/dupq_4.c: Likewise.
* gcc.target/aarch64/sve/vec_init_3.c: New test.
Signed-off-by: Pengxuan Zheng <quic_pzheng@quicinc.com>
|
|
This patch fixes the include directories used when building objects in
gm2-compiler-boot. It adds the missing gm2-gcc directory and uses a
new variable GM2_BOOT_INCLUDES for all gm2-compiler-boot rules.
gcc/m2/ChangeLog:
* Make-lang.in (GM2_BOOT_INCLUDES): New variable.
(m2/gm2-compiler-boot/M2GCCDeclare.o): Rewrite to use
GM2_BOOT_INCLUDES.
(m2/gm2-compiler-boot/M2Error.o): Ditto.
(m2/gm2-compiler-boot/%.o): Ditto.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
|
|
AVR-LibC has moved to GitHub, adjust web links:
https://github.com/avrdudes/avr-libc (project)
https://avrdudes.github.io/avr-libc/avr-libc-user-manual (wwwdocs)
gcc/
* doc/invoke.texi (AVR Options): Update AVR-LibC weblink from
nongnu.org to https://github.com/avrdudes/avr-libc
* doc/extend.texi (AVR Named Address Spaces): Same.
(AVR Function Attributes): Same.
* doc/install.texi (Cross-Compiler-Specific Options, AVR): Same.
|
|
On Neoverse V2, SVE ADD instructions have a throughput of 4, while shift
instructions like SHL have a throughput of 2. We can lean on that to emit code
like:
add z31.b, z31.b, z31.b
instead of:
lsl z31.b, z31.b, #1
The implementation of this change for SVE vectors is similar to a prior patch
<https://gcc.gnu.org/pipermail/gcc-patches/2024-August/659958.html> that adds
the above functionality for Neon vectors.
Here, the machine descriptor pattern is split up to separately accommodate left
and right shifts, so we can specifically emit an add for all left shifts by 1.
The patch was bootstrapped and regtested on aarch64-linux-gnu, no regression.
OK for mainline?
Signed-off-by: Soumya AR <soumyaa@nvidia.com>
gcc/ChangeLog:
* config/aarch64/aarch64-sve.md (*post_ra_v<optab><mode>3): Split pattern
to accomodate left and right shifts separately.
(*post_ra_v_ashl<mode>3): Matches left shifts with additional
constraint to check for shifts by 1.
(*post_ra_v_<optab><mode>3): Matches right shifts.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/sve/acle/asm/lsl_s16.c: Updated instances of lsl-1
with corresponding add.
* gcc.target/aarch64/sve/acle/asm/lsl_s32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_s64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_s8.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_u16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_u32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_u64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_u8.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_wide_s16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_wide_s32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_wide_s8.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_wide_u16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_wide_u32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/lsl_wide_u8.c: Likewise.
* gcc.target/aarch64/sve/adr_1.c: Likewise.
* gcc.target/aarch64/sve/adr_6.c: Likewise.
* gcc.target/aarch64/sve/cond_mla_7.c: Likewise.
* gcc.target/aarch64/sve/cond_mla_8.c: Likewise.
* gcc.target/aarch64/sve/shift_2.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sh_gather_s64.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sh_gather_u64.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/ldnt1uh_gather_s64.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/ldnt1uh_gather_u64.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/rshl_s16.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/rshl_s32.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/rshl_s64.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/rshl_s8.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/rshl_u16.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/rshl_u32.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/rshl_u64.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/rshl_u8.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/stnt1h_scatter_s64.c: Likewise.
* gcc.target/aarch64/sve2/acle/asm/stnt1h_scatter_u64.c: Likewise.
* gcc.target/aarch64/sve/sve_shl_add.c: New test.
|
|
This patch fixes all remaining -Wodr warnings in the modula-2 front end.
It removes the m2 Tree and m2 Location definitions and uses tree and
location_t throughout. This allows the bootstrap tool mc to pick up the
GCC definitions for these data types (for the C translation of m2 sources).
The patch introduces a new module CDataTypes which contain two pointer
types: CharStar and ConstCharStar. These map onto their C counterparts
when processed by mc however currently gm2 treats them as ADDRESS.
It might be sensible to have the gm2 versions of these data types
implemented though a builtin module in the future.
gcc/m2/ChangeLog:
PR modula2/116181
* Make-lang.in (GM2-GCC-DEFS): Add gcctypes.def and
CDataTypes.def.
(MC-LIB-DEFS): Add CDataTypes.def.
* Make-maintainer.in (m2/gm2-pge-boot/$(SRC_PREFIX)M2RTS.o):
Change include path to pge-boot.
(m2/gm2-pge-boot/$(SRC_PREFIX)SymbolKey.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)NameKey.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)Lists.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)Output.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)bnflex.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)RTentity.h): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)RTentity.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)%.o): Ditto.
(GM2PATH): Add -I$(srcdir)/m2/gm2-gcc.
(m2/mc-boot-gen/$(SRC_PREFIX)%.h): Add -I$(srcdir)/m2/gm2-gcc.
(m2/mc-boot-gen/$(SRC_PREFIX)%.cc): Ditto.
* gm2-compiler/M2ALU.def (PushIntegerTree): Replace Tree with tree.
(PopIntegerTree): Ditto.
(PushRealTree): Ditto.
(PopRealTree): Ditto.
(PushComplexTree): Ditto.
(PopComplexTree): Ditto.
(PushSetTree): Ditto.
(PopSetTree): Ditto.
(PopConstructorTree): Ditto.
(ConstructSetConstant): Ditto.
(BuildRange): Ditto.
(CheckOrResetOverflow): Ditto.
(PushTypeOfTree): Ditto.
* gm2-compiler/M2ALU.mod (Tree): Replace with ...
(tree): ... this.
(gcctypes): Import location_t and tree.
(m2linemap): Remove import of location_t.
* gm2-compiler/M2Base.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Base.mod (gcctypes): Import of location_t.
(m2linemap): Remove import of location_t.
* gm2-compiler/M2Bitset.mod (m2tree): Remove import of Tree.
* gm2-compiler/M2CaseList.mod (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2Emit.def (gcctypes): Import location_t.
* gm2-compiler/M2GCCDeclare.def (gcctypes): Import tree.
(PromoteToString): Replace Tree with tree.
(PromoteToCString): Ditto.
(ConstantKnownAndUsed): Ditto.
* gm2-compiler/M2GCCDeclare.mod (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2GenGCC.def (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
(GetHighFromUnbounded): Replace Tree with tree.
(StringToChar): Ditto.
(LValueToGenericPtr): Ditto.
(ZConstToTypedConst): Ditto.
(PrepareCopyString): Ditto.
* gm2-compiler/M2GenGCC.mod (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2LangDump.def (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2LangDump.mod (Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2LexBuf.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2LexBuf.mod (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Options.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Options.mod (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Range.def (m2linemap): Replace with ...
(gcctypes): ... this.
(CDataTypes): Import ConstCharStar.
(CodeErrorCheck): Replace Tree with tree.
(OverlapsRange): Ditto.
(IsEqual): Ditto.
(IsGreaterOrEqual): Ditto.
(IsGreater): Ditto.
(BuildIfCallWholeHandlerLoc): Replace Tree with tree.
Replace ADDRESS with ConstCharStar.
(BuildIfCallRealHandlerLoc): Ditto.
(GetMinMax): Ditto.
* gm2-compiler/M2Range.mod (m2tree): Remove Tree.
(CodeErrorCheck): Replace Tree with tree.
(OverlapsRange): Ditto.
(IsEqual): Ditto.
(IsGreaterOrEqual): Ditto.
(IsGreater): Ditto.
(GetMinMax): Ditto.
(BuildIfCallWholeHandlerLoc): Replace Tree with tree.
Replace ADDRESS with ConstCharStar.
(BuildIfCallRealHandlerLoc): Ditto.
* gm2-compiler/M2System.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2System.mod (m2linemap): Replace with ...
(gcctypes): ... this.
(CreateMinMaxFor): Replace Tree with tree.
(CreateType): Ditto.
(AttemptToCreateType): Ditto.
(CreateSetType): Ditto.
(AttemptToCreateSetType): Ditto.
* gm2-compiler/P2SymBuild.mod (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/SymbolConversion.def (m2tree): Replace with ...
(gcctypes): ... this.
(Mod2Gcc): Replace Tree with tree.
(Gcc2Mod): Ditto.
(AddModGcc): Ditto.
* gm2-compiler/SymbolConversion.mod (m2tree): Replace with ...
(gcctypes): ... this.
(Mod2Gcc): Replace Tree with tree.
(Gcc2Mod): Ditto.
(AddModGcc): Ditto.
(Mod2GccWithoutGCCPoison): Ditto.
* gm2-compiler/SymbolTable.def (m2tree): Replace with ...
(gcctypes): ... this.
(PutModuleFinallyFunction): Replace Tree with tree.
(GetModuleFinallyFunction): Ditto.
* gm2-compiler/SymbolTable.mod (m2tree): Replace with ...
(gcctypes): ... this.
(PutModuleFinallyFunction): Replace Tree with tree.
(GetModuleFinallyFunction): Ditto.
* gm2-compiler/m2flex.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-gcc/init.def (PerCompilationInit): Replace ADDRESS with ConstCharStar.
(CDataTypes): Import ConstCharStar.
* gm2-gcc/m2block.def (SYSTEM): Remove import.
(CDataTypes): Import ConstCharStar.
(m2linemap): Remove import.
(m2tree): Remove import.
(gcctypes): Import tree.
(global_constant): Replace Tree with tree.
(RememberInitModuleFunction): Ditto.
(DumpGlobalConstants): Ditto.
(RememberConstant): Ditto.
(RememberType): Ditto.
(pushDecl): Ditto.
(popFunctionScope): Ditto.
(pushFunctionScope): Ditto.
(finishFunctionCode): Ditto.
(finishFunctionDecl): Ditto.
(GetErrorNode): Ditto.
(includeDecl): Ditto.
(GetGlobals): Ditto.
(GetGlobalContext): Ditto.
(begin_statement_list): Ditto.
(push_statement_list): Ditto.
(pop_statement_list): Ditto.
(getLabel): Replace Tree with tree.
Replace ADDRESS with ConstCharStar.
* gm2-gcc/m2builtins.def (CDataTypes): Import ConstCharStar.
(GetBuiltinConst): Replace Tree with tree.
(GetBuiltinConstType): Ditto.
(GetBuiltinTypeInfoType): Ditto.
(GetBuiltinTypeInfo): Ditto.
(BuiltinExists): Ditto.
(BuildBuiltinTree): Ditto.
(BuiltinMemCopy): Ditto.
(BuiltinMemSet): Ditto.
(BuiltInAlloca): Ditto.
(BuiltInIsfinite): Ditto.
* gm2-gcc/m2convert.def (CDataTypes): Import ConstCharStar.
(ToWord): Ditto.
(ToCardinal): Ditto.
(ToInteger): Ditto.
(ToBitset): Ditto.
(ConvertToPtr): Ditto.
(BuildConvert): Ditto.
(ConvertConstantAndCheck): Ditto.
(ConvertString): Ditto.
(GenericToType): Ditto.
* gm2-gcc/m2decl.cc (m2decl_BuildParameterDeclaration): Add
const attribute.
* gm2-gcc/m2decl.def (CDataTypes): Import ConstCharStar.
(BuildModuleCtor): Ditto.
(DeclareModuleCtor): Ditto.
(DeclareM2linkForcedModuleInitOrder): Ditto.
(DeclareM2linkStaticInitialization): Ditto.
(BuildPtrToTypeString): Ditto.
(BuildIntegerConstant): Ditto.
(BuildStringConstantType): Ditto.
(DeclareKnownVariable): Ditto.
(DeclareKnownConstant): Ditto.
(BuildParameterDeclaration): Ditto.
(BuildEndFunctionDeclaration): Ditto.
(RememberVariables): Ditto.
(BuildConstLiteralNumber): Ditto.
(BuildStringConstant): Ditto.
(BuildCStringConstant): Ditto.
(GetDeclContext): Ditto.
* gm2-gcc/m2decl.h (m2decl_BuildParameterDeclaration): Add
const attribute.
* gm2-gcc/m2except.def (CDataTypes): Import ConstCharStar.
(BuildThrow): Ditto.
(BuildTryBegin): Ditto.
(BuildTryEnd): Ditto.
(BuildCatchBegin): Ditto.
(BuildCatchEnd): Ditto.
* gm2-gcc/m2expr.def (CDataTypes): Import ConstCharStar.
(CSTIntToString): Ditto.
(CSTIntToChar): Ditto.
(CheckConstStrZtypeRange): Ditto.
(CompareTrees): Ditto.
(GetPointerOne): Ditto.
(GetPointerZero): Ditto.
(GetWordOne): Ditto.
(GetWordZero): Ditto.
(GetIntegerOne): Ditto.
(GetIntegerZero): Ditto.
(GetCardinalOne): Ditto.
(GetCardinalZero): Ditto.
(GetSizeOfInBits): Ditto.
(GetSizeOf): Ditto.
(BuildLogicalRotate): Ditto.
(BuildLRRn): Ditto.
(BuildLRLn): Ditto.
(BuildMask): Ditto.
(BuildMult): Ditto.
(BuildMultCheck): Ditto.
(BuildLRR): Ditto.
(BuildLRL): Ditto.
(BuildLogicalShift): Ditto.
(BuildLSR): Ditto.
(BuildLSL): Ditto.
(BuildDivM2): Ditto.
(BuildDivM2Check): Ditto.
(BuildModM2): Ditto.
(BuildModM2Check): Ditto.
(BuildModFloor): Ditto.
(BuildDivCeil): Ditto.
(BuildModCeil): Ditto.
(BuildDivFloor): Ditto.
(BuildModTrunc): Ditto.
(BuildDivTrunc): Ditto.
(BuildDivTruncCheck): Ditto.
(BuildRDiv): Ditto.
(BuildSubCheck): Ditto.
(BuildAddCheck): Ditto.
(BuildSub): Ditto.
(BuildAdd): Ditto.
(FoldAndStrip): Ditto.
(StringLength): Ditto.
(TreeOverflow): Ditto.
(RemoveOverflow): Ditto.
(BuildCoerce): Ditto.
(BuildTrunc): Ditto.
(BuildNegate): Ditto.
(BuildNegateCheck): Ditto.
(BuildSetNegate): Ditto.
(BuildTBitSize): Ditto.
(BuildSize): Ditto.
(BuildAddr): Ditto.
(BuildOffset1): Ditto.
(BuildOffset): Ditto.
(BuildLogicalOrAddress): Ditto.
(BuildLogicalOr): Ditto.
(BuildLogicalAnd): Ditto.
(BuildSymmetricDifference): Ditto.
(BuildLogicalDifference): Ditto.
(BuildLessThan): Ditto.
(BuildGreaterThan): Ditto.
(BuildLessThanOrEqual): Ditto.
(BuildGreaterThanOrEqual): Ditto.
(BuildEqualTo): Ditto.
(BuildNotEqualTo): Ditto.
(BuildIsSuperset): Ditto.
(BuildIsNotSuperset): Ditto.
(BuildIsSubset): Ditto.
(BuildIsNotSubset): Ditto.
(BuildIfConstInVar): Ditto.
(BuildIfNotConstInVar): Ditto.
(BuildIfVarInVar): Ditto.
(BuildIfNotVarInVar): Ditto.
(BuildForeachWordInSetDoIfExpr): Ditto.
(BuildIfInRangeGoto): Ditto.
(BuildIfNotInRangeGoto): Ditto.
(BuildArray): Ditto.
(BuildComponentRef): Ditto.
(BuildIndirect): Ditto.
(IsTrue): Ditto.
(IsFalse): Ditto.
(GetCstInteger): Ditto.
(AreConstantsEqual): Ditto.
(AreRealOrComplexConstantsEqual): Ditto.
(DetermineSign): Ditto.
(BuildCap): Ditto.
(BuildAbs): Ditto.
(BuildRe): Ditto.
(BuildIm): Ditto.
(BuildCmplx): Ditto.
(BuildBinaryForeachWordDo): Ditto.
(BuildBinarySetDo): Ditto.
(ConstantExpressionWarning): Ditto.
(BuildAddAddress): Ditto.
(calcNbits): Ditto.
(OverflowZType): Ditto.
(BuildCondIfExpression): Ditto.
* gm2-gcc/m2linemap.def (CDataTypes): Import ConstCharStar.
* gm2-gcc/m2misc.def (m2tree): Replace with ...
(gcctypes): ... this.
(DebugTree): Replace Tree with tree.
* gm2-gcc/m2pp.def (m2tree): Replace with ...
(gcctypes): ... this.
(DumpGimpleFd): Replace Tree with tree.
* gm2-gcc/m2statement.cc (m2statement_BuildBuiltinCallTree):
Remove unused location parameter.
* gm2-gcc/m2statement.def (m2linemap): Replace with ...
(gcctypes): ... this.
(CDataTypes): Import CharStar.
(DoJump): Replace Tree with tree.
Replace ADDRESS with CharStar.
(BuildStartFunctionCode): Replace Tree with tree.
(BuildEndFunctionCode): Ditto.
(BuildReturnValueCode): Ditto.
(BuildAssignmentTree): Ditto.
(BuildAssignmentStatement): Ditto.
(BuildGoto): Ditto.
(DeclareLabel): Ditto.
(BuildIfThenDoEnd): Ditto.
(BuildIfThenElseEnd): Ditto.
(BuildParam): Ditto.
(BuildFunctionCallTree): Ditto.
(BuildProcedureCallTree): Ditto.
(BuildIndirectProcedureCallTree): Ditto.
(BuildFunctValue): Ditto.
(BuildCall2): Ditto.
(BuildCall3): Ditto.
(SetLastFunction): Ditto.
(GetLastFunction): Ditto.
(GetParamTree): Ditto.
(BuildTryFinally): Ditto.
(BuildCleanUp): Ditto.
(BuildAsm): Ditto.
(BuildUnaryForeachWordDo): Ditto.
(BuildExcludeVarConst): Ditto.
(BuildExcludeVarVar): Ditto.
(BuildIncludeVarConst): Ditto.
(BuildIncludeVarVar): Ditto.
(BuildStart): Ditto.
(BuildEnd): Ditto.
(BuildCallInner): Ditto.
(BuildBuiltinCallTree): Remove unused location parameter.
* gm2-gcc/m2statement.h (m2statement_BuildBuiltinCallTree): Remove
unused location parameter.
* gm2-gcc/m2tree.def (gcctypes): Import tree.
(IsAConstant): Replace Tree with tree.
(IsOrdinal): Ditto.
(IsTreeOverflow): Ditto.
(skip_const_decl): Ditto.
(skip_type_decl): Ditto.
(is_type): Ditto.
(is_array): Ditto.
(is_var): Ditto.
(debug_tree): Ditto.
(IstreeOverflow): Ditto.
* gm2-gcc/m2treelib.def (m2linemap): Replace with ...
(gcctypes): ... this.
(get_set_address_if_var): Ditto.
(get_set_field_rhs): Ditto.
(get_set_field_lhs): Ditto.
(get_set_address): Ditto.
(get_set_value): Ditto.
(get_field_no): Ditto.
(get_rvalue): Ditto.
(DoCall): Ditto.
(build_modify_expr): Ditto.
(do_jump_if_bit): Ditto.
* gm2-gcc/m2type.def (m2linemap): Replace with ...
(gcctypes): ... this.
(m2tree): Remove.
(CDataTypes): Import ConstCharStar and charStar.
(ValueInTypeRange): Replace Tree with tree.
(ValueOutOfTypeRange): Ditto.
(ExceedsTypeRange): Ditto.
(WithinTypeRange): Ditto.
(BuildSubrangeType): Ditto.
(BuildCharConstant): Ditto.
(BuildCharConstantChar): Ditto.
(BuildArrayConstructorElement): Ditto.
(BuildEndArrayConstructor): Ditto.
(BuildStartArrayConstructor): Ditto.
(BuildRecordConstructorElement): Ditto.
(BuildEndRecordConstructor): Ditto.
(BuildStartRecordConstructor): Ditto.
(BuildEndSetConstructor): Ditto.
(BuildSetConstructorElement): Ditto.
(BuildStartSetConstructor): Ditto.
(BuildSetType): Ditto.
(BuildConstPointerType): Ditto.
(BuildPointerType): Ditto.
(BuildEnumerator): Ditto.
(BuildEndEnumeration): Ditto.
(BuildStartEnumeration): Ditto.
(BuildTypeDeclaration): Ditto.
(GetMaxFrom): Ditto.
(GetMinFrom): Ditto.
(GetDefaultType): Ditto.
(BuildEndType): Ditto.
(BuildStartType): Ditto.
(BuildVariableArrayAndDeclare): Ditto.
(BuildProcTypeParameterDeclaration): Ditto.
(BuildStartFunctionType): Ditto.
(BuildEndFunctionType): Ditto.
(GetTreeType): Ditto.
(DeclareKnownType): Ditto.
(GetM2ZType): Ditto.
(GetM2RType): Ditto.
(BuildSetTypeFromSubrange): Ditto.
(BuildSmallestTypeRange): Ditto.
(GetBooleanType): Ditto.
(GetBooleanFalse): Ditto.
(GetBooleanTrue): Ditto.
(GetPackedBooleanType): Ditto.
(GetCharType): Ditto.
(GetByteType): Ditto.
(GetVoidType): Ditto.
(GetBitnumType): Ditto.
(GetRealType): Ditto.
(GetLongRealType): Ditto.
(GetShortRealType): Ditto.
(GetLongIntType): Ditto.
(GetPointerType): Ditto.
(GetCardinalType): Ditto.
(GetIntegerType): Ditto.
(GetWordType): Ditto.
(GetM2CardinalType): Ditto.
(GetBitsetType): Ditto.
(GetM2CType): Ditto.
(GetProcType): Ditto.
(GetM2ComplexType): Ditto.
(GetM2LongComplexType): Ditto.
(GetM2ShortComplexType): Ditto.
(GetM2Complex128): Ditto.
(GetM2Complex96): Ditto.
(GetM2Complex64): Ditto.
(GetM2Complex32): Ditto.
(GetM2Real128): Ditto.
(GetM2Real96): Ditto.
(GetM2Real64): Ditto.
(GetM2Real32): Ditto.
(GetM2Bitset32): Ditto.
(GetM2Bitset16): Ditto.
(GetM2Bitset8): Ditto.
(GetM2Word64): Ditto.
(GetM2Word32): Ditto.
(GetM2Word16): Ditto.
(GetM2Cardinal64): Ditto.
(GetM2Cardinal32): Ditto.
(GetM2Cardinal16): Ditto.
(GetM2Cardinal8): Ditto.
(GetM2Integer64): Ditto.
(GetM2Integer32): Ditto.
(GetM2Integer16): Ditto.
(GetM2Integer8): Ditto.
(GetISOLocType): Ditto.
(GetISOByteType): Ditto.
(GetISOWordType): Ditto.
(GetShortCardType): Ditto.
(GetM2ShortCardType): Ditto.
(GetShortIntType): Ditto.
(GetM2ShortIntType): Ditto.
(GetM2LongCardType): Ditto.
(GetM2LongIntType): Ditto.
(GetM2LongRealType): Ditto.
(GetM2RealType): Ditto.
(GetM2ShortRealType): Ditto.
(GetM2IntegerType): Ditto.
(GetM2CharType): Ditto.
(GetCSizeTType): Ditto.
(GetCSSizeTType): Ditto.
(BuildArrayStringConstructor): Ditto.
(RealToTree): Ditto.
(BuildStartRecord): Ditto.
(BuildStartUnion): Ditto.
(BuildStartVarient): Ditto.
(BuildEndVarient): Ditto.
(BuildStartFieldVarient): Ditto.
(BuildEndFieldVarient): Ditto.
(BuildStartFieldRecord): Ditto.
(BuildFieldRecord): Ditto.
(ChainOn): Ditto.
(ChainOnParamValue): Ditto.
(AddStringToTreeList): Ditto.
(BuildEndRecord): Ditto.
(SetAlignment): Ditto.
(SetDeclPacked): Ditto.
(SetTypePacked): Ditto.
(SetRecordFieldOffset): Ditto.
(BuildPackedFieldRecord): Ditto.
(BuildNumberOfArrayElements): Ditto.
(AddStatement): Ditto.
(MarkFunctionReferenced): Ditto.
(BuildArrayIndexType): Ditto.
(GetArrayNoOfElements): Ditto.
(BuildEndArrayType): Ditto.
(PutArrayType): Ditto.
(BuildStartArrayType): Ditto.
(IsAddress): Ditto.
(SameRealType): Ditto.
* m2.flex (Gm2linemap.h): Include.
* mc-boot/GDynamicStrings.cc: Rebuild.
* mc-boot/GFIO.cc: Ditto.
* mc-boot/GIndexing.cc: Ditto.
* mc-boot/GM2Dependent.cc: Ditto.
* mc-boot/GSArgs.cc: Ditto.
* mc-boot/GStringConvert.cc: Ditto.
* mc-boot/Gdecl.cc: Ditto.
* mc-boot/Gdecl.h: Ditto.
* mc-boot/Gdtoa.h: Ditto.
* mc-boot/Gkeyc.cc: Ditto.
* mc-boot/Gkeyc.h: Ditto.
* mc-boot/Glibc.h: Ditto.
* mc-boot/GmcComp.cc: Ditto.
* mc-boot/GmcLexBuf.cc: Ditto.
* mc-boot/GmcPreprocess.cc: Ditto.
* mc-boot/GmcStream.cc: Ditto.
* mc-boot/Gmcp1.cc: Ditto.
* mc-boot/Gmcp3.cc: Ditto.
* mc-boot/Gmcp4.cc: Ditto.
* mc-boot/Gmcp5.cc: Ditto.
* mc-boot/GnameKey.cc: Ditto.
* mc-boot/Gvarargs.cc: Ditto.
* mc/decl.def (putDefUnqualified): New procedure function.
(isDefUnqualified): Ditto.
* mc/decl.mod (defT): Add unqualified field.
(charStarN): New variable.
(constCharStarN): Ditto.
(checkGccType): New procedure.
(checkCDataTypes): Ditto.
(import): Call checkGccType and checkCDataTypes.
(putDefUnqualified): New procedure function.
(isDefUnqualified): Ditto.
* mc/keyc.def (useGccTree): New procedure.
(useGccLocation): Ditto.
* mc/keyc.mod (checkGccConfigSystem): Call checkGccConfigSystem.
(useGccTree): New procedure.
(useGccLocation): Ditto.
* mc/mcp1.bnf (decl): Import putDefUnqualified.
(Export): Call putDefUnqualified.
* gm2-gcc/CDataTypes.def: New file.
* gm2-gcc/gcctypes.def: New file.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
|
|
The >= and < comparisons may skip comparing the lower bytes when
the according bytes of the constant are all zeros. For example,
uint16 >= 0x1200
is true iff
hi8 (uint16) >= hi8 (0x1200)
and similar for uint16 < 0x1200. Some comparisons against constants
that are an integral power of 256 where already handled in the split
preparation. That code has been outsourced to new avr_maybe_cmp_lsr()
which may change the operands such that the resulting insns become
a comparison of the high bytes against 0 plus a EQ / NE branch.
For example,
uint32 >= 0x10000
can be rewritten as
(uint32 >> 16) != 0.
The according asm output is performed by new avr_out_cmp_lsr().
gcc/
* config/avr/avr-protos.h (avr_out_cmp_lsr, avr_maybe_cmp_lsr): New.
* config/avr/avr.cc (avr_maybe_cmp_lsr, avr_out_cmp_lsr): New functions.
(avr_out_compare) [GEU, LTU]: Start output at byte CTZ(xval) / 8.
(avr_adjust_insn_length) [ADJUST_LEN_CMP_LSR]: Handle case.
* config/avr/avr.md (adjust_len) <cmp_lsr>: New attr value.
(*cmp<mode>_lsr): New define_insn_and_split.
(cbranch<mode>4_insn): When splitting, run avr_maybe_cmp_lsr()
which may map the operands to *cmp<mode>_lsr.
gcc/testsuite/
* gcc.target/avr/torture/cmp-lsr-i32.c: New test.
* gcc.target/avr/torture/cmp-lsr-u16.c: New test.
* gcc.target/avr/torture/cmp-lsr-u24.c: New test.
* gcc.target/avr/torture/cmp-lsr-u32.c: New test.
* gcc.target/avr/torture/cmp-lsr-u64.c: New test.
|
|
Use %= instead of maintaining a sequence number manually, so that it
doesn't result in a duplicate assembler label when the insn is duplicated.
PR target/116693
* config/riscv/riscv.cc (riscv_legitimize_tls_address): Don't pass
seqno to gen_tlsdesc and remove it.
* config/riscv/riscv.md (@tlsdesc<mode>): Remove operand 1. Use
%= instead of %1 in template.
|
|
These config files set default formatting behaviour for a large number
of common editors, see https://editorconfig.org
The root=true setting in libstdc++-v3/.editorconfig prevents looking in
parent directories for additional settings. If we add a .editorconfig at
the top-level we might want to use root=true there instead, and allow
libstdc++-v3/.editorconfig to inherit some some settings from there (and
only override things we want to do differently).
libstdc++-v3/ChangeLog:
* .editorconfig: New file.
* include/std/.editorconfig: New file.
|
|
While adding simple_dce_worklist to the vectorizer, there was a regression
due to the slp patterns would create a SSA name but never free it even if it
never existed in the IR (this case as addsub but complex ones had the same issue).
The reason why it was never freed was the stmt_vec_info was not marked as a pattern stmt,
unlike the other pattern stmts that use vect_init_pattern_stmt instead of vec_info::add_pattern_stmt
(which is used for SLP patterns).
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* tree-vectorizer.cc (vec_info::add_pattern_stmt): Set pattern_stmt_p.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
|
|
Use "rtx_code" for RTX codes, not "enum rtx_code" and not "RTX_CODE".
Drop enum and struct tags if possible.
gcc/
* config/avr/avr.cc: Use rtx_code for RTX codes.
Drop enum and struct tags.
* config/avr/avr.md: Same.
* config/avr/avr-c.cc: Same.
* config/avr/avr-dimode.md: Same.
* config/avr/avr-passes.cc: Same.
* config/avr/avr-protos.h: Same.
|
|
ADIW doesn't mix with CPC / SBIC because it's not only about
propagating the Z flag but also about carry.
gcc/
* config/avr/avr.cc (avr_out_compare): Don't mix ADIW with SBCI / CPC.
|
|
libstdc++-v3:
* doc/xml/manual/intro.xml: Update link to installation docs.
* doc/html/manual/make.html: Regenerate.
|
|
|
|
Remove the special handling of end of nested scalarization chains, which
advanced the chain to an element of a parent chain when the current one
was reaching its end.
That handling was superfluous as nested chains correspond to nested
scalarizations of subexpressions and the scalarizations don't extend beyond
their associated subexpression and don't use any scalarisation element from
the parent expression.
No change of behaviour, as the GFC_SE struct is supposed to be in its final
state anyway when the last element from the chain has been consumed.
gcc/fortran/ChangeLog:
* trans-expr.cc (gfc_advance_se_ss_chain): Don't use an element
from the parent scalarization chain when the current chain reaches
its end.
|
|
When we're explicitly choosing GCC extensions, we similarly shouldn't
complain about optional features that GCC provides. This particular pattern
of cast between function and object pointer is used by gthr-posix.h on some
targets, including linux-gnu before glibc 2.34.
gcc/cp/ChangeLog:
* parser.cc (cp_parser_unary_expression) [RID_EXTENSION]: Also
suppress -Wconditionally-supported.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wconditionally-supported-1.C: Add __extension__ cases.
|
|
It seems more useful for a conversion to have the location of the source
expression rather than the enclosing expression, such as a call that might
convert multiple arguments in different ways.
As a result, in srcloc17.C the recorded location of 'e' when
copy-initialized became that of the initializer rather than the variable,
since the semantic was to convert the initializer (at its location) and then
initialize the variable from the resulting prvalue. If we instead
direct-initialize the variable, the location of the constructor call is that
of the variable.
gcc/cp/ChangeLog:
* call.cc (convert_like_internal) [ck_user]: Use iloc_sentinel.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/srcloc17.C: Adjust initialization.
|
|
Because std::span<Incomplete> can be useful, it makes sense to define
std::span<Incomplete>::iterator such that Incomplete is not an
associated class, and so the compiler won't attempt to complete it when
doing ADL for span iterators (including during the definition of
std::span<Incomplete>::const_iterator which checks that iterator
satisfies std::input_or_output_iterator).
We can't make this change for std::vector<Incomplete> because it would
change the mangled name of std::vector<Incomplete>::iterator which would
affect the mangled names of templates and functions written by users.
We can do the same thing for std::basic_stacktrace<Alloc> just so that
Alloc is not an associated class. This is probably less beneficial, as
Alloc can't be incomplete, and using SomeAllocator<Incomplete> as the
allocator parameter doesn't seem useful. But simply making the
stacktrace iterator not use Alloc for ADL lookup seems worthwhile. This
is doable because std::stacktrace is part of C++23 so its ABI isn't
considered stable yet.
libstdc++-v3/ChangeLog:
* include/std/span (span::__iter_tag): Declare nested type.
(span::iterator): Use __iter_tag as second template argument.
* include/std/stacktrace (basic_stacktrace::iterator): Use _Impl
as second template argument.
|
|
This makes durations, time points and calendrical types available for
freestanding. The clocks and time zone utilities are disabled for
freestanding, as they require functions in the hosted lib.
Add support for a new macro _GLIBCXX_NO_FREESTANDING_CHRONO which can be
used to explicitly disable <chrono> for freestanding.
libstdc++-v3/ChangeLog:
* doc/xml/manual/using.xml (_GLIBCXX_NO_FREESTANDING_CHRONO):
Document macro.
* doc/html/*: Regenerate.
* include/bits/chrono.h [_GLIBCXX_NO_FREESTANDING_CHRONO]:
Only include <bits/require_hosted.h> when this macro is defined.
[_GLIBCXX_HOSTED]: Only define clocks for hosted.
* include/bits/version.def (chrono_udls): Remove hosted=yes.
* include/bits/version.h: Regenerate.
* include/std/chrono [_GLIBCXX_HOSTED]: Only define clocks and
time zone utilities for hosted.
* testsuite/std/time/freestanding.cc: New test.
|
|
LWG 436 confirmed that const-qualified types are valid arguments for
Facet template parameters, but volatile-qualified types are not. Add an
assertion to locale::combine to check for valid types.
libstdc++-v3/ChangeLog:
* include/bits/locale_classes.h (__is_facet): New helper.
* include/bits/locale_classes.tcc (locale::combine): Check that
_Facet type is valid.
|
|
This is a step towards implementing the C++23 change P2408R5, "Ranges
iterators as inputs to non-Ranges algorithms". C++20 random access
iterators which do not meet the Cpp17RandomAccessIterator requirements
will now be recognized by the PSTL algorithms.
As noted by Patrick, P2408R5 only relaxes the requirements for
non-mutating algorithms, but this relaxes them for all parallel
algorithms. I believe that's OK. A call with a type which previously
didn't compile at all was undefined, so we're allowed to start accepting
those calls if the type satisfies std::random_access_iterator. However,
this also causes a change in behaviour for calls with arguments which
satisfy std::random_access_iterator and meet the Cpp17ForwardIterator
requirements but not the Cpp17RandomAccessIterator requirements. The
algorithms will dispatch to a different implementation now. I believe
that's also OK. The algorithms should give the same results whether
acting on forward iterators or random access iterators, just more
efficiently for the latter.
Additionally, we can optimize the C++17 implementation by using
std::__and_, and use std::__remove_cvref_t and std::__iter_category_t
for readability. This diverges from the upstream PSTL, but since libc++
is no longer using that upstream (so we're the only consumer of this
code) I think it's reasonable to use libstdc++ extensions in localized
places like this. Rebasing this small header on upstream should not be
difficult.
libstdc++-v3/ChangeLog:
PR libstdc++/110512
* include/pstl/execution_impl.h (__are_random_access_iterators):
Recognize C++20 random access iterators, and use more efficient
implementations.
* testsuite/25_algorithms/pstl/110512.cc: New test.
|
|
As noted in the PR the action of the existing implementation was to
treat a false value from await_suspend () as equivalent to "do not
suspend". Actually it needs to be the equivalent of "resume" - and
we need to restart the dispatcher - since the await_suspend() body
could have already resumed the coroutine.
See also https://github.com/cplusplus/CWG/issues/601 (NAD) for more
discussion.
Since we need to amend the await expansion and the actor build, take
the opportunity to clean up and modernise the code there. Note that
we need to make the jump back to the dispatcher without any scope
exit cleanups (so we have to use the .CO_SUSPN IFN to do this).
PR c++/115905
gcc/cp/ChangeLog:
* coroutines.cc (struct coro_aw_data): Add a member for the
restart dispatch label.
(expand_one_await_expression): Rework to modernise and to
handle the boolean await_suspend() case.
(build_actor_fn): Rework the dispatcher and allow for a jump
back to the dispatcher.
gcc/testsuite/ChangeLog:
* g++.dg/coroutines/torture/pr115905.C: New test.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
|
|
The heuristics for factoring out with a constant checks that the assignment statement
is the last statement of the basic block but sometimes there is a predicate or a nop statement
after the assignment. Rejecting this case does not make sense since both predicates and nop
statements are removed and don't contribute any instructions. So we should skip over them
when checking if the assignment statement was the last statement in the basic block.
phi-opt-factor-1.c's f0 is such an example where it should catch it at phiopt1 (before predicates are removed)
and should happen in a similar way as f1 (which uses a temporary variable rather than return).
Bootstrapped and tested on x86_64-linux-gnu.
PR tree-optimization/116699
gcc/ChangeLog:
* tree-ssa-phiopt.cc (factor_out_conditional_operation): Skip over nop/predicates
for seeing the assignment is the last statement.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/phi-opt-factor-1.c: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
|
|
While trying to add use of simple_dce_from_worklist
to the vectorizer so we don't need to run a full blown
DCE pass after the vectorizer, there was a crash noticed
due to a ssa name which has a stmt without a bb. This was
due to not calling release_defs after the call to gsi_remove.
Note the code to remove zero use statements should be able to
remove once the use of simple_dce_from_worklist has been added.
But in the meantime, fixing this bug will also improve memory
usage and a few other things which look through all ssa names.
gcc/ChangeLog:
* tree-vect-loop.cc (optimize_mask_stores): Call release_defs
after the call to gsi_remove with last argument of true.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
|
|
Since we are written in C++11, these should be marked as delete rather
than just private.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* bitmap.h (class auto_bitmap): Mark copy/move constructor/operator=
as deleted.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
|
|
|
|
The code path which was added for 16bit had a broken inline-asm which would
only assign maybe half of the registers for the `long` type to 0.
Adding L to the input operand of the inline-asm fixes the issue by now assigning
the full 32bit value of the input register that would match up with the output register.
Fixes r0-115223-gb0408f13d4b317 which added the 16bit code path to fix the testcase for 16bit.
Pushed as obvious.
PR testsuite/116716
gcc/testsuite/ChangeLog:
* gcc.c-torture/execute/pr52286.c: Fix inline-asm for 16bit case.
|
|
We don't want a warning about a reserved init_priority in a system header
even with -Wsystem-headers.
gcc/cp/ChangeLog:
* tree.cc (handle_init_priority_attribute): Check
in_system_header_at.
|
|
We currently ICE upon the following testcase when using -ftime-report
=== cut here ===
template < int> using __conditional_t = int;
template < typename _Iter >
concept random_access_iterator = requires { new _Iter; };
template < typename _Iterator >
struct reverse_iterator {
using iterator_concept =
__conditional_t< random_access_iterator< _Iterator>>;
};
void RemoveBottom() {
int iter;
for (reverse_iterator< int > iter;;)
;
}
=== cut here ===
The problem is that qualified_namespace_lookup does a plain start() of
the TV_NAME_LOOKUP timer (that asserts that the timer is not already
started). However this timer has already been cond_start()'d in the call
stack - by pushdecl - so the assert fails.
This patch simply ensures that we always conditionally start this timer
(which is done in all other places that use it).
PR c++/116681
gcc/cp/ChangeLog:
* name-lookup.cc (qualified_namespace_lookup): Use an
auto_cond_timer instead of using timevar_start and timevar_stop.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-pr116681.C: New test.
|
|
gcc/
* config/avr/avr.md (UNSPEC_COPYSIGN): Remove define_enum.
(copysignsf3): Use copysign instead of UNSPEC_COPYSIGN.
Allow const_double for operand 2.
|
|
libstdc++-v3/ChangeLog:
* include/std/format (__formatter_fp::_M_localize): Add comments
and micro-optimize string copy.
|
|
Refactor the loops to all use the same form, and to not need explicit
'break' or 'continue' jumps. This also avoids a -Wunused-variable
warning with -Wsystem-headers.
Also fix a bug for absolute timeouts specified with a time that isn't
implicitly convertible to __clock_t::time_point, e.g. one with a higher
resolution such as picoseconds. Use chrono::ceil to round up to the next
time point representable by the clock.
libstdc++-v3/ChangeLog:
* include/bits/semaphore_base.h (__platform_semaphore): Refactor
loops to all use similar forms.
(__platform_semaphore::_M_try_acquire_until): Use chrono::ceil
to explicitly convert to __clock_t::time_point.
* testsuite/30_threads/semaphore/try_acquire_for.cc: Check that
using a very high resolution timeout compiles.
* testsuite/30_threads/semaphore/platform_try_acquire_for.cc:
New test.
|
|
The Linaro CI runs of this testcase pointed out that I need to check for DFP
support, as well.
gcc/testsuite/ChangeLog:
* c-c++-common/pragma-diag-17.c: Handle !dfp targets.
|
|
This aarch64-*-* test needs an update for the diagnostic I changed in
r15-3614-g9fe57e4879de93.
gcc/testsuite/ChangeLog:
* g++.dg/ext/sve-sizeless-1.C: Adjust dg-error string.
|
|
This adjusts some recently-added tests that won't compile without a
hostedlib libstdc++, missed in the patch that just went in, and also
an old test that I'd missed because it also failed in my baseline.
for gcc/testsuite/ChangeLog
* g++.dg/coroutines/pr108620.C: Skip if !hostedlib because of
unavailable headers.
* g++.dg/other/profile1.C: Likewise.
* g++.dg/ext/pragma-unroll-lambda-lto.C: Skip if !hostedlib
because of unavailable declarations.
|
|
|
|
The transparent call insns like "*parityhi2.libgcc" output a single
[R]CALL instruction that can be skipped by the skip instructions.
Such insns have attribute "type" of "xcall" and can therefore
be easily recognized. Same applies when "adjust_len" is "call".
gcc/
* config/avr/avr.cc (avr_2word_insn_p): Return true for
transparent calls: When insn attribute "type" is "xcall"
or when "adjust_len" is "call".
|