Age | Commit message (Collapse) | Author | Files | Lines |
|
gcc/ChangeLog:
PR target/116152
* config/riscv/riscv.cc (riscv_option_override): Fix url
formatting.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/predef-9.c: Update testcase.
Co-authored-by: Jakub Jelinek <jakub@redhat.com>
Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
|
|
This extends our folding of cast-like standard library functions
to also include C++23's std::forward_like.
PR c++/96780
gcc/cp/ChangeLog:
* cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls
to std::forward_like as well.
gcc/testsuite/ChangeLog:
* g++.dg/opt/pr96780.C: Also test std::forward_like folding.
Reviewed-by: Marek Polacek <mpolacek@redhat.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
|
|
Currently the main logic of the sccopy pass is implemented as static
functions. This patch instead puts the code into a class. This also
gets rid of a global variable (dead_stmts).
gcc/ChangeLog:
* gimple-ssa-sccopy.cc (class scc_copy_prop): New class.
(replace_scc_by_value): Put into...
(scc_copy_prop::replace_scc_by_value): ...scc_copy_prop.
(sccopy_visit_op): Put into...
(scc_copy_prop::visit_op): ...scc_copy_prop.
(sccopy_propagate): Put into...
(scc_copy_prop::propagate): ...scc_copy_prop.
(init_sccopy): Replace by...
(scc_copy_prop::scc_copy_prop): ...the construtor.
(finalize_sccopy): Replace by...
(scc_copy_prop::~scc_copy_prop): ...the destructor.
(pass_sccopy::execute): Use scc_copy_prop.
Signed-off-by: Filip Kastl <fkastl@suse.cz>
|
|
When there's a conversion in front of a SLP condition reduction the
code following the reduc-idx SLP chain fails because it assumes
there's only COND_EXPRs.
PR tree-optimization/116241
* tree-vect-loop.cc (vect_create_epilog_for_reduction): Handle
non-COND_EXPR nodes in SLP reduction chain following.
* g++.dg/vect/pr116241.cc: New testcase.
|
|
The test FAILs on big endian targets, because VV is a vector of unsigned __int128
and VC vector of unsigned char and so ((VC) vv)[0] is 0x01 on little endian
but 0xff on big endian and PDP endian.
As I believe it is intentional to test it as it is written on little endian,
the following patch just adds another case for big endian and for other
endians instead of figuring out what exactly to fetch it fetches the whole
unsigned __int128 and casts it to unsigned char. Not that pdp11 has
__int128 support...
2024-08-06 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/116037
PR testsuite/116245
* gcc.dg/torture/pr116037.c (foo): Fix up for big end middle endian.
|
|
The following testcase is miscompiled, because wi::mul for (_BitInt(65))-15
times (_BitInt(65))-15 computes the right value (_BitInt(65))225, but
sets *overflow to wi::OVF_UNKNOWN as that it overflowed when it didn't.
Even signed operands are unpacked as unsigned but because they are
implicitly sign-extended from the represented value (the operands
obviously have len==1), we get
0xfffffff1, 0xffffffff, 0x1, 0x0
in both u and v (0x1 because that is exactly 65 bits).
We then multiply these. Next step is because both the high and
overflow handling expects the high half to start at a limb boundary
the bits of the result starting with bit 65 are shifted up by 63 such
that the bits relevant for high/need_overflow start at the half of the
4th half wide int limb.
Because both operands are negative that part is then adjusted.
The reason mul_internal says there is overflow is because of the unspecified
garbage in the most significant bits of the result which the adjusting
doesn't clean up. 65 bit multiplication needs 65 bits of result and 65 bits
of the high part, can't produce more, so the following patch fixes it by
checking for the overflow only in those first 65 bits of the high part, not
anything beyond that. If it was a highpart multiply, we'd have ignored that
as well (canonicalized).
2024-08-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/116224
* wide-int.cc (wi::mul_internal): If prec isn't multiple of
HOST_BITS_PER_WIDE_INT, for need_overflow checking only look at
the least significant prec bits starting with r[half_blocks_needed].
* gcc.dg/torture/bitint-72.c: New test.
|
|
Wrong interpretation of the type of the concatenation can lead to a
spurious error in GNATprove when inlining code. Now fixed.
gcc/ada/
* sem_ch4.adb (Analyze_Concatenation_Rest): Do not add a wrong
interpretation of the concatenation, using the type of the operand
already recognized as of the element type.
|
|
...based on previous work that added Gen_Assocs_Rec.
Minor cleanup of that previous work.
gcc/ada/
* sem_ch12.adb: Implement type inference for generic parameters.
(Maybe_Infer_One): Forbid inference of anonymous subtypes and
types.
(Inference_Reason): Fix comment.
* debug.adb: Document -gnatd_I switch.
* errout.ads: Document that Empty is not allowed for "&".
* errout.adb (Set_Msg_Insertion_Node): Minor: Do not allow
Error_Msg_Node_1 = Empty for "&". Use "in" instead of multiple
"=". Improve comment.
|
|
Recent fixes for container aggregates with iterated element associations
exposed a latent bug with loops that are wrapped in blocks, where the loop
entity's scope was not adjusted to reflect the new enclosing block scope.
gcc/ada/
* sem_ch5.adb (Analyze_Loop_Statement.Wrap_Loop_Statement): Remove
the loop Entity_Id from its old scope and insert it in the new
block scope that wraps it.
|
|
When the aspect Default_Value is inherited by a derived scalar
type, and both the parent type T and the derived type DT are
declared in the same scope, a spurious error may be reported.
This occurs if a subprogram declared in the same scope has a
parameter of type DT with a default value, leading the compiler
to incorrectly flag the default value specified in the aspect
of type T as having the wrong type.
gcc/ada/
* freeze.adb (Freeze_Entity): For scalar derived types that
inherit the aspect Default_Value, do not analyze and resolve the
inherited aspect, as the type of the aspect remains the parent
type.
|
|
gcc/ada/
* libgnarl/s-interr__hwint.adb: Use fully qualified names to avoid
ambiguity.
* libgnarl/s-taprop__qnx.adb: Likewise.
|
|
Using switch gnatR4, the frontend crashes when generating information
for a private record type.
gcc/ada/
* repinfo.adb (List_Record_Info): Handle private record types.
|
|
gcc/ada/
* libgnarl/s-taprop__mingw.adb: Use fully qualified names
to avoid ambiguity.
* libgnarl/s-taprop__posix.adb: Likewise.
* libgnarl/s-taprop__qnx.adb: Likewise.
* libgnarl/s-taprop__rtems.adb: Likewise.
|
|
The value of SPARK_Mode associated with a renaming-as-body might
not be the correct one, when the private part of the package containing
the declaration has SPARK_Mode Off while the public part has SPARK_Mode
On. This may lead to analysis of code by GNATprove that should not be
analyzed.
gcc/ada/
* freeze.adb (Build_Renamed_Body): Propagate SPARK_Pragma to body
build from renaming, so that locally relevant value is taken into
account.
* sem_ch6.adb (Analyze_Expression_Function): Propagate
SPARK_Pragma to body built from expression function, so that
locally relevant value is taken into account.
|
|
This patch fixes a bug where GNAT would fail to detect certain
errors when compiling the run-time library. In particular, if
two overloaded homographs are both directly visible, it would
pick one, rather than complaining about the ambiguity.
The problem was that some special-purpose code in Sem_Ch8 was trying
to make a user name take precedence over some run-time library
declaration that (incorrectly) appears to be visible because of
rtsfind. The solution is to disable that code while compiling
the run-time library itself.
In addition, we fix the newly-found errors in the run-time library.
gcc/ada/
* sem_ch8.adb (Find_Direct_Name): Disable the special-purpose code
when we are actually compiling the run-time library itself.
* libgnarl/a-exetim__posix.adb: Fix newly-found use-clause
conflicts.
* libgnat/a-direct.adb: Likewise.
* libgnat/a-nbnbin.adb: Likewise.
* libgnat/a-timoio__128.adb: Likewise.
* libgnat/a-timoio.adb: Likewise.
* libgnat/a-wtmoio__128.adb: Likewise.
* libgnat/a-wtmoio.adb: Likewise.
* libgnat/a-ztmoio__128.adb: Likewise.
* libgnat/a-ztmoio.adb: Likewise.
|
|
The following fixes a compile-time/memory-hog when performing a
large aggregate copy to a small object allocated to a register.
While store_bit_field_1 called by store_integral_bit_field will
do nothign for accesses outside of the target the loop over the
source in store_integral_bit_field will still code-generate
the read parts for all words in the source. The following copies
the noop condition from store_bit_field_1 and terminates the
loop when it runs forward or avoid code-generating the read parts
when not.
PR middle-end/111821
* expmed.cc (store_integral_bit_field): Terminate the
word-wise copy loop when we get out of the destination
and do a forward copy. Skip the word if it would be
outside of the destination in case of a backward copy.
* gcc.dg/torture/pr111821.c: New testcase.
|
|
gcc/
* config/rs6000/predicates.md (any_operand): Add const_vector.
|
|
2024-08-06 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/102689
* trans-array.cc (get_array_ref_dim_for_loop_dim): Use the arg1
class container carried in ss->info as the seed for a lhs in
class valued transformational intrinsic calls that are not the
rhs of an assignment. Otherwise, the lhs variable expression is
taken from the loop chain. For this latter case, the _vptr and
_len fields are set.
(gfc_trans_create_temp_array): Use either the lhs expression
seeds to build a class variable that will take the returned
descriptor as its _data field. In the case that the arg1 expr.
is used, a class typespec must be built with the correct rank
and the _vptr and _len fields set. The element size is provided
for the temporary allocation and to set the descriptor span.
(gfc_array_init_size): When an intrinsic type scalar expr3 is
used in allocation of a class array, use its element size in
the descriptor dtype.
* trans-expr.cc (gfc_conv_class_to_class): Class valued
transformational intrinsics return the pointer to the array
descriptor as the _data field of a class temporary. Extract
directly and return the address of the class temporary.
(gfc_conv_procedure_call): store the expression for the first
argument of a class valued transformational intrinsic function
in the ss info class_container field. Later, use its type as
the element type in the call to gfc_trans_create_temp_array.
(fcncall_realloc_result): Add a dtype argument and use it in
the descriptor, when available.
(gfc_trans_arrayfunc_assign): For class lhs, build a dtype with
the lhs rank and the rhs element size and use it in the call to
fcncall_realloc_result.
gcc/testsuite/
PR fortran/102689
* gfortran.dg/class_transformational_1.f90: New test for class-
valued reshape.
* gfortran.dg/class_transformational_2.f90: New test for other
class_valued transformational intrinsics.
|
|
Some opcodes are missed when determining the smallest scalar type for a
vectorizable statement. Currently, this bug does not cause any problem,
because vect_get_smallest_scalar_type is only used to compute max nunits
vectype, and even statement with missed opcode is incorrectly bypassed,
the max nunits vectype could also be rightly deduced from def statements
for operands of the statement.
In the future, if this function will be called to do other thing, we may
get something wrong. So fix it in this patch.
2024-08-05 Feng Xue <fxue@os.amperecomputing.com>
gcc/
PR tree-optimization/115228
* tree-vect-data-refs.cc (vect_get_smallest_scalar_type): Add
missed opcodes that involve widening operation.
|
|
vect_look_through_possible_promotion [PR115707]
The function fails to figure out root definition if casts involves more than
two promotions with sign change as:
long a = (long)b; // promotion cast
-> int b = (int)c; // promotion cast, sign change
-> unsigned short c = ...;
For this case, the function thinks the 2nd cast has different sign as the 1st,
so stop looking through, while "unsigned short -> integer" is a nature sign
extension.
2024-08-05 Feng Xue <fxue@os.amperecomputing.com>
gcc/
PR tree-optimization/115707
* tree-vect-patterns.cc (vect_look_through_possible_promotion): Allow
unsigned-to-signed promotion.
|
|
This was an interesting compare debug failure to debug. The first symptom
was in gcse which would produce different order of creating psedu-registers. This
was caused by a different order of a hashtable walk, due to the hash table having different
number of entries. Which in turn was due to the number of max insn being different between
the 2 runs. The place max insn uid comes from was in sh_recog_treg_set_expr which is called
via rtx_costs and fwprop would cause rtx_costs in some cases for debug insn related stuff.
Build and tested for sh4-linux-gnu.
PR target/116189
gcc/ChangeLog:
* config/sh/sh.cc (sh_recog_treg_set_expr): Don't call make_insn_raw,
make the insn with a fake uid.
gcc/testsuite/ChangeLog:
* c-c++-common/torture/pr116189-1.c: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
|
|
This patch removes vestigial Concepts TS code as discussed in
<https://gcc.gnu.org/pipermail/gcc-patches/2024-July/657937.html>.
In particular, it removes code related to function/variable concepts.
That includes variable_concept_p and function_concept_p, which then
cascades into removing DECL_DECLARED_CONCEPT_P etc. So I think we
no longer need to say "standard concept" since there are no non-standard
ones anymore.
I've added two new errors saying that "variable/function concepts are
no longer supported".
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_constant_expression): Don't call
unpack_concept_check. Add a concept_check_p assert. Remove
function_concept_p code.
* constraint.cc (check_constraint_atom): Remove function concepts code.
(unpack_concept_check): Remove.
(get_concept_check_template): Remove Concepts TS code.
(resolve_function_concept_overload): Remove.
(resolve_function_concept_check): Remove.
(resolve_concept_check): Remove Concepts TS code.
(get_returned_expression): Remove.
(get_variable_initializer): Remove.
(get_concept_definition): Remove Concepts TS code.
(normalize_concept_check): Likewise.
(build_function_check): Remove.
(build_variable_check): Remove.
(build_standard_check): Use concept_definition_p instead of
standard_concept_p.
(build_concept_check): Remove variable_concept_p/function_concept_p
code.
(build_concept_id): Simplify.
(build_type_constraint): Likewise.
(placeholder_extract_concept_and_args): Likewise.
(satisfy_nondeclaration_constraints): Likewise.
(check_function_concept): Remove.
(get_constraint_error_location): Remove Concepts TS code.
* cp-tree.h (DECL_DECLARED_CONCEPT_P): Remove.
(check_function_concept): Remove.
(unpack_concept_check): Remove.
(standard_concept_p): Remove.
(variable_concept_p): Remove.
(function_concept_p): Remove.
(concept_definition_p): Simplify.
(concept_check_p): Don't check for CALL_EXPR.
* decl.cc (check_concept_refinement): Remove.
(duplicate_decls): Remove check_concept_refinement code.
(is_concept_var): Remove.
(cp_finish_decl): Remove is_concept_var.
(check_concept_fn): Remove.
(grokfndecl): Give an error about function concepts not being supported
anymore. Remove unused code.
(grokvardecl): Give an error about variable concepts not being
supported anymore.
(finish_function): Remove DECL_DECLARED_CONCEPT_P code.
* decl2.cc (min_vis_expr_r): Use concept_definition_p instead of
standard_concept_p.
(maybe_instantiate_decl): Remove DECL_DECLARED_CONCEPT_P check.
(mark_used): Likewise.
* error.cc (dump_simple_decl): Use concept_definition_p instead of
standard_concept_p.
(dump_function_decl): Remove DECL_DECLARED_CONCEPT_P code.
(print_concept_check_info): Don't call unpack_concept_check. Simplify.
* mangle.cc (write_type_constraint): Likewise.
* parser.cc (cp_parser_nested_name_specifier_opt): Remove
function_concept_p code. Only check concept_definition_p, not
variable_concept_p/standard_concept_p.
(add_debug_begin_stmt): Remove DECL_DECLARED_CONCEPT_P code.
(cp_parser_template_declaration_after_parameters): Remove a stale
comment.
* pt.cc (check_explicit_specialization): Remove
DECL_DECLARED_CONCEPT_P code.
(process_partial_specialization): Remove variable_concept_p code.
(lookup_template_variable): Likewise.
(tsubst_expr) <case CALL_EXPR>: Remove Concepts TS code and simplify.
(do_decl_instantiation): Remove DECL_DECLARED_CONCEPT_P code.
(instantiate_decl): Likewise.
(placeholder_type_constraint_dependent_p): Don't call
unpack_concept_check. Add a concept_check_p assert.
(convert_generic_types_to_packs): Likewise.
* semantics.cc (finish_call_expr): Remove Concepts TS code and simplify.
gcc/testsuite/ChangeLog:
* g++.dg/concepts/decl-diagnose.C: Adjust dg-error.
* g++.dg/concepts/fn-concept2.C: Likewise.
* g++.dg/concepts/pr71128.C: Likewise.
* g++.dg/concepts/var-concept6.C: Likewise.
* g++.dg/cpp2a/concepts.C: Likewise.
|
|
|
|
After CL 536643 passing NULL as the expected type permitted an untyped
constant expression to remain untyped. Change to passing the empty
interface type.
The panic and print/println functions are the only builtin functions
that turn an untyped constant expression into a regular function call,
and we already handled print/println specially.
The test case is https://go.dev/cl/603096.
Fixes golang/go#68734
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/603215
|
|
gcc/ChangeLog:
PR target/116152
* config/riscv/riscv.cc (riscv_option_override): Add deprecation
warning.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/predef-9.c: Add check for warning.
Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
|
|
We need to separate the original user-authored function body from the
definition of the ramp function (which is what is called instead).
The function body tree is either in DECL_SAVED_TREE or the first operand
of current_eh_spec_block (for functions with an EH spec).
This version simplifies the process by extracting the second case directly
instead of inspecting the DECL_SAVED_TREE trees to discover it.
gcc/cp/ChangeLog:
* coroutines.cc (split_coroutine_body_from_ramp): New.
(morph_fn_to_coro): Use split_coroutine_body_from_ramp().
* cp-tree.h (use_eh_spec_block): New.
* decl.cc (use_eh_spec_block): Make non-static.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
|
|
DWARF represents voids in DW_TAG_const_type and DW_TAG_volatile_type
DIEs by the absence of a DW_AT_type attribute, which we weren't handling
correctly.
gcc/
* dwarf2codeview.cc (get_type_num_const_type): Handle missing
DW_AT_type attribute.
(get_type_num_volatile_type): Likewise.
|
|
* fr.po: Update.
|
|
This fixes another false positive. When a function is taking a
temporary of scalar type that couldn't be bound to the return type
of the function, don't warn, such a program would be ill-formed.
Thanks to Jonathan for reporting the problem.
PR c++/115987
gcc/cp/ChangeLog:
* call.cc (do_warn_dangling_reference): Don't consider a
temporary with a scalar type that cannot bind to the return type.
gcc/testsuite/ChangeLog:
* g++.dg/ext/attr-no-dangling6.C: Adjust.
* g++.dg/ext/attr-no-dangling7.C: Likewise.
* g++.dg/warn/Wdangling-reference22.C: New test.
|
|
When GCC finds a call to one of the __atomic_OP_fetch built-ins in
which the return value is not used it optimizes it into the
corresponding non-fetching atomic operation. Up to now we had
definitions in gcc/config/bpf/atomic.md to implement both atomic_OP
and atomic_fetch_OP sets of insns:
atomic_add -> aadd (aka xadd)
atomic_and -> aand
atomic_or -> aor
atomic_xor -> axor
atomic_fetch_add -> afadd
atomic_fetch_and -> afand
atomic_fetch_or -> afor
atomic_fetch_xor -> afxor
This was not correct, because as it happens the non-fetching BPF
atomic instructions imply different memory ordering semantics than the
fetching BPF atomic instructions, and they cannot be used
interchangeably, as it would be expected.
This patch modifies config/bpf/atomic.md in order to not define the
atomic_{add,and,or,xor} insns. This makes GCC to implement them in
terms of the corresponding fetching operations; this is less
efficient, but correct. It also updates the expected results in the
corresponding tests, which are also updated to cover cases where the
value resulting from the __atomic_fetch_* operations is actually used.
Tested in bpf-unknown-none target in x86_64-linux-gnu host.
gcc/ChangeLog
* config/bpf/atomic.md ("atomic_add<AMO:mode>"): Remove insn.
("atomic_and<AMO:mode>"): Likewise
("atomic_or<AMO:mode>"): Likewise.
("atomic_xor<AMO:mode>"): Likewise.
gcc/testsuite/ChangeLog
* gcc.target/bpf/atomic-op-1.c (test_used_atomic_add): New
function.
(test_used_atomic_sub): Likewise.
(test_used_atomic_and): Likewise.
(test_used_atomic_nand): Likewise.
(test_used_atomic_or): Likewise.
(test_used_atomic_xor): Likewise.
* gcc.target/bpf/atomic-op-2.c (test_used_atomic_add): Likewise.
(test_used_atomic_sub): Likewise.
(test_used_atomic_and): Likewise.
(test_used_atomic_nand): Likewise.
(test_used_atomic_or): Likewise.
(test_used_atomic_xor): Likewise.
* gcc.target/bpf/sync-fetch-and-add.c: Expected results updated.
|
|
The test has been observed to pass on most architectures including RISC-V:
https://godbolt.org/z/8nYEvW6n1
Origin issue see:
https://gcc.gnu.org/PR79356#c11
Update RISC-V target to the pass list.
gcc/testsuite/ChangeLog:
* gcc.dg/attr-alloc_size-11.c: Add RISC-V to the list
of targets excluding xfail on lines 50 and 51.
|
|
As suggested in
https://gcc.gnu.org/pipermail/gcc-patches/2024-July/658249.html,
this patch changes the instruction attribute of "*and<mode>_compare0" (TST) from
alus_imm to logics_imm.
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.md (*and<mode>_compare0): Change attribute.
|
|
Fixes a misplaced comment in gimple-ssa-sccopy.cc. The comment belongs
to a bitmap definition but was instead placed before the beginning of a
namespace block.
gcc/ChangeLog:
* gimple-ssa-sccopy.cc: Move a misplaced comment.
Signed-off-by: Filip Kastl <fkastl@suse.cz>
|
|
fully-pipelined FMAs on wide MULT targets
The code in get_reassociation_width that forms FMAs aggressively when
they are fully pipelined expects the FMUL reassociation width in the
target to be less than for FMAs. This doesn't hold for all target
tunings.
This code shouldn't ICE, just avoid forming these FMAs here.
This patch does that.
Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
PR tree-optimization/116139
gcc/ChangeLog:
* tree-ssa-reassoc.cc (get_reassociation_width): Move width_mult
<= width comparison to if condition rather than assert.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pr116139.c: New test.
|
|
These testcases were added by the patch of supporting multiple lane-reducing
operations. For target that has no dot-product instrution, we should add
matching condition to skip it.
2024-08-05 Feng Xue <fxue@os.amperecomputing.com>
gcc/testsuite/
PR tree-optimization/116000
* gcc.dg/vect/vect-reduc-chain-dot-slp-1.c: Skip target with no dot-
product instruction.
* gcc.dg/vect/vect-reduc-chain-dot-slp-2.c: Likewise.
* gcc.dg/vect/vect-reduc-chain-dot-slp-3.c: Likewise.
* gcc.dg/vect/vect-reduc-chain-dot-slp-4.c: Likewise.
|
|
[PR116145]" [PR116200]
This reverts commit ba730fd10934e4ca004251aa3748bf9da4d35e62.
|
|
..., also fixing up an apparently mis-merged
commit 2340894554334a310b891a1d9e9d5e3f502357ac
"gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER'", which was adding a bogus
second definition of 'RUST_LIBDEPS'.
gcc/rust/
* Make-lang.in (RUST_LIBDEPS): Inline into all users.
|
|
Recent commit 6fef4d6ffcab0fec8518adcb05458cba5dbeac25
"gccrs: libgrust: Add format_parser library", added a general override of
'LIBS += -ldl -lpthread' if '--enable-languages=rust'. This is wrong
conceptually, and will make the build fail on systems not providing such
libraries. Instead, 'CRAB1_LIBS', added a while ago in
commit 75299e4fe50aa8d9b3ff529e48db4ed246083e64
"rust: Do not link with libdl and libpthread unconditionally", should be used,
and not generally, but for 'crab1' only.
gcc/rust/
* Make-lang.in (LIBS): Don't override.
(crab1$(exeext):): Use 'CRAB1_LIBS'.
|
|
This extends GCC's GDB hooks to attempt invoking the user-defined
command "on-gcc-hooks-load". The idea is that users can define the
command in their .gdbinit to override the default values of parameters
defined by GCC's GDB extensions.
For example, together with the previous patch, I can add the following
fragment to my .gdbinit:
define on-gcc-hooks-load
set gcc-dot-cmd xdot
end
which means, once the GCC extensions get loaded, whenever I invoke
dot-fn then the graph will be rendered using xdot.
The try/except should make this patch a no-op for users that don't
currently define this command. I looked for a way to test explicitly
for whether a GDB command exists but didn't find one.
This is needed because the user's .gdbinit is sourced before GCC's GDB
extensions are loaded, and GCC-specific parameters can't be configured
before they are defined.
gcc/ChangeLog:
* gdbhooks.py: Add attempted call to "on-gcc-hooks-load" once
we've finished loading the hooks.
|
|
This adds a new GDB parameter 'gcc-dot-cmd' which allows the user to
configure the command used to render the CFG within dot-fn.
E.g. with this patch the user can change their dot viewer like so:
(gdb) show gcc-dot-cmd
The current value of 'gcc-dot-cmd' is "dot -Tx11".
(gdb) set gcc-dot-cmd xdot
(gdb) dot-fn # opens in xdot
The second patch in this series adds a hook which users can define in
their .gdbinit in order to be called when the GCC extensions have
finished loading, thus allowing users to automatically configure
gcc-dot-cmd as desired in their .gdbinit.
gcc/ChangeLog:
* gdbhooks.py (GCCDotCmd): New.
(gcc_dot_cmd): New. Use it ...
(DotFn.invoke): ... here.
|
|
[PR116179]
Late_combine exposed this latent bug in split_live_ranges_for_shrink_wrap.
What it did was copy-prop regno 151 from regno 119 from:
```
(insn 2 264 3 2 (set (reg/f:DI 119 [ thisD.3697 ])
(reg:DI 151)) "/app/example.cpp":19:13 70 {*movdi_aarch64}
(expr_list:REG_DEAD (reg:DI 151)
(nil)))
```
into these insns:
```
(debug_insn 147 146 148 5 (var_location:DI thisD.3727 (reg/f:DI 119 [ thisD.3697 ])) "/app/example.cpp":21:5 -1
(nil))
....
(insn 167 166 168 7 (set (reg:DI 1 x1)
(reg/f:DI 119 [ thisD.3697 ])) "/app/example.cpp":14:21 70 {*movdi_aarch64}
(nil))
```
Both are valid things to do. The problem is split_live_ranges_for_shrink_wrap looks at the
uses of reg 151 and with and without debugging reg 151 have a different usage in different BBs.
The function is trying to find a splitting point for reg 151 and they are different. In the end
this causes register allocation difference.
The fix is for split_live_ranges_for_shrink_wrap to ignore uses that were in debug insns.
Bootstrappped and tested on x86_64-linux-gnu with no regressions.
PR rtl-optimization/116179
gcc/ChangeLog:
* ira.cc (split_live_ranges_for_shrink_wrap): For the uses loop,
only look at non-debug insns.
gcc/testsuite/ChangeLog:
* g++.dg/torture/pr116179-1.C: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
|
|
|
|
handling
Building glibc on the m68k has exposed a long standing latent bug in reload.
Basically ext-dce replaced an extension with a subreg expression (good)
resulting in this pair of insns:
> (insn 7 4 8 2 (set (reg:DI 31 [ _1 ])
> (subreg:DI (reg/v:SI 37 [ __major ]) 0)) "j.c":7:32 75 {*m68k.md:1568}
> (nil))
> (insn 8 7 10 2 (set (reg:DI 39 [ _2 ])
> (ashift:DI (reg:DI 31 [ _1 ])
> (const_int 8 [0x8]))) "j.c":7:48 322 {*ashldi3}
> (expr_list:REG_DEAD (reg:DI 31 [ _1 ])
> (nil)))
insn 7 was optimized to the simple copy by ext-dce. That looks fine. Combine
comes along and squashes them together resulting in:
> (insn 8 7 10 2 (set (reg:DI 39 [ _2 ])
> (ashift:DI (subreg:DI (reg/v:SI 37 [ __major ]) 0)
> (const_int 8 [0x8]))) "j.c":7:48 322 {*ashldi3}
> (nil))
Which also looks good.
After IRA's allocation, in the middle of reload we have:
> (insn 8 7 10 2 (set (reg:DI 8 %a0 [orig:39 _2 ] [39])
> (ashift:DI (subreg:DI (reg/v:SI 0 %d0 [orig:37 __major ] [37]) 0)
> (const_int 8 [0x8]))) "j.c":7:48 322 {*ashldi3}
> (nil))
Again, sensible. The pattern requires op0 and op1 to match, so we try to
figure out if d0 & a0 are the same underlying register. So we get into this
code in operands_match_p:
> if (code == SUBREG)
> {
> i = REGNO (SUBREG_REG (x));
> if (i >= FIRST_PSEUDO_REGISTER)
> goto slow;
> i += subreg_regno_offset (REGNO (SUBREG_REG (x)),
> GET_MODE (SUBREG_REG (x)),
> SUBREG_BYTE (x),
> GET_MODE (x));
> }
> else
> i = REGNO (x);
There's a similar fragment for the other operand. The key is that
subreg_regno_offset call. That call assumes the subreg is representable. But
in the case of (subreg:DI (reg:SI d0)) we're going to get -1 (remember, m68k is
a big endian target). That -1 gets passed to hard_regno_regs via this code
(again, just showing one of the two copies of this fragment):
> if (REG_WORDS_BIG_ENDIAN
> && is_a <scalar_int_mode> (GET_MODE (x), &xmode)
> && GET_MODE_SIZE (xmode) > UNITS_PER_WORD
> && i < FIRST_PSEUDO_REGISTER)
> i += hard_regno_nregs (i, xmode) - 1;
That triggers the reported ICE. It appears this has been broken since the
conversion to SUBREG_BYTE way back in 2001, though possibly it could have been
some minor changes around this code circa 2005 as well, it didn't seem worth
putting under the debugger to be sure. Certainly the code from 2001 looks
suspicious to me.
Anyway, the fix here is pretty simple. The routine "simplify_subreg_regno" is
meant to be used to determine if we can simplify the subreg expression and will
explicitly return -1 if it can't be represented for one reason or another. It
checks a variety of conditions that aren't worth listing here.
Bootstrapped and regression tested on x86 (after reverting an unrelated patch
from Richard S that's causing multiple unrelated failures), which of course
doesn't really test the code as x86 is an LRA target. Also built & tested the
crosses, none of which show issues (and some of which are reload targets).
m68k will bootstrap & regression test tomorrow, but I don't think there's any
point in waiting for that.
Pushing to the trunk.
PR rtl-optimization/116199
gcc/
* reload.cc (operands_match_p): Verify subreg is expressable before
trying to simplify and match it to another operand.
gcc/testsuite/
* gcc.dg/torture/pr116199.c: New test.
|
|
|
|
|
|
PR fortran/104626
gcc/fortran/ChangeLog:
* symbol.cc (gfc_add_save): Add checks for SAVE attribute
conflicts and duplicate SAVE attribute.
gcc/testsuite/ChangeLog:
* gfortran.dg/pr104626.f90: New test.
|
|
* be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, hr.po, id.po,
ja.po, nl.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po,
zh_TW.po: Update.
|
|
Despite a number of mitigations (don't warn for std::span-like classes,
lambdas, adding [[gnu::no_dangling]], etc.), the warning still seems to
cause some grief. Let's move the warning to -Wextra, then.
gcc/c-family/ChangeLog:
* c.opt (Wdangling-reference): Move from -Wall to -Wextra.
gcc/ChangeLog:
* doc/invoke.texi: Document that -Wdangling-reference is
enabled by -Wextra.
|
|
Currently, it is possible to ICE GCC by giving it sufficiently broken
code, where sufficiently broken means a std::coroutine_handle missing a
default on the promise_type template argument, and missing members.
As the code generator relies on lookups in the coroutine_handle never
failing (and has no way to signal that error), lets do it ahead of time,
save the result, and use that. This saves us some lookups and allows us
to propagate an error.
PR c++/105475 - coroutines: ICE in coerce_template_parms, at cp/pt.cc:9183
gcc/cp/ChangeLog:
PR c++/105475
* coroutines.cc (struct coroutine_info): Add from_address.
Carries the from_address member we looked up earlier.
(coro_resume_identifier): Remove. Unused.
(coro_init_identifiers): Do not initialize the above.
(void_coro_handle_address): New variable. Contains the baselink
for the std::coroutine_handle<void>::address() instance method.
(get_handle_type_address): New function. Looks up and validates
handle_type::address in a given handle_type.
(get_handle_type_from_address): New function. Looks up and
validates handle_type::from_address in a given handle_type.
(coro_promise_type_found_p): Remove reliance on
coroutine_handle<> defaulting the promise type to void. Store
get_handle_type_* results where appropriate.
(get_coroutine_from_address): New helper. Gets the
handle_type::from_address BASELINK from a coroutine_info.
(build_actor_fn): Use the get_coroutine_from_address helper and
void_coro_handle_address.
gcc/testsuite/ChangeLog:
PR c++/105475
* g++.dg/coroutines/pr103868.C: Add std::coroutine_handle
members we check for now.
* g++.dg/coroutines/pr105287.C: Ditto.
* g++.dg/coroutines/pr105301.C: Ditto.
* g++.dg/coroutines/pr94528.C: Ditto.
* g++.dg/coroutines/pr94879-folly-1.C: Ditto.
* g++.dg/coroutines/pr94883-folly-2.C: Ditto.
* g++.dg/coroutines/pr98118.C: Ditto.
* g++.dg/coroutines/pr105475.C: New test.
* g++.dg/coroutines/pr105475-1.C: New test.
* g++.dg/coroutines/pr105475-2.C: New test.
* g++.dg/coroutines/pr105475-3.C: New test.
* g++.dg/coroutines/pr105475-4.C: New test.
* g++.dg/coroutines/pr105475-5.C: New test.
* g++.dg/coroutines/pr105475-6.C: New test.
* g++.dg/coroutines/pr105475-broken-spec.C: New test.
* g++.dg/coroutines/pr105475-broken-spec-2.C: New test.
|
|
Protect the evaluation of BACK with a check that the reference is non-null
in case the expression is an optional dummy, in the inline code generated
for MINLOC and MAXLOC.
This change contains a revert of the non-testsuite part of commit
r15-1994-ga55d24b3cf7f4d07492bb8e6fcee557175b47ea3, which factored the
evaluation of BACK out of the loop using the scalarizer. It was a bad idea,
because delegating the argument evaluation to the scalarizer makes it
cumbersome to add a null pointer check next to the evaluation.
Instead, evaluate BACK at the beginning, before scalarization, add a check
that the argument is present if necessary, and evaluate the resulting
expression to a variable, before using the variable in the inline code.
gcc/fortran/ChangeLog:
* trans-intrinsic.cc (maybe_absent_optional_variable): New function.
(gfc_conv_intrinsic_minmaxloc): Remove BACK from scalarization and
evaluate it before. Add a check that BACK is not null if the
expression is an optional dummy. Save the resulting expression to a
variable. Use the variable in the generated inline code.
gcc/testsuite/ChangeLog:
* gfortran.dg/maxloc_6.f90: New test.
* gfortran.dg/minloc_7.f90: New test.
|