- Aug 07, 2024
-
-
GCC Administrator authored
-
- Aug 06, 2024
-
-
Jerry DeLisle authored
PR fortran/109105 gcc/fortran/ChangeLog: * resolve.cc (CHECK_INTERFACES): New helper macro. (resolve_operator): Replace use of snprintf with gfc_error.
-
Andrew Pinski authored
After r15-2414-g2d105efd6f60 which fixed the dg-do directive, the testcase stopped working because there was a missing -save-temps. This adds that and now the testcase passes again. Pushed as obvious. gcc/testsuite/ChangeLog: PR testsuite/116207 * gcc.target/aarch64/simd/vmmla.c: Add -save-temps to the options. Signed-off-by:
Andrew Pinski <quic_apinski@quicinc.com>
-
Jonathan Wakely authored
libstdc++-v3/ChangeLog: PR libstdc++/116247 * include/bits/fs_path.h: Use __UINTPTR_TYPE__ instead of uintptr_t. * include/bits/shared_ptr_atomic.h: Likewise. * include/ext/pointer.h: Include <stdint.h>.
-
David Malcolm authored
Previously the invocation's "executionSuccessful" property (§3.20.14) was only false if there was an ICE. Update it so that it will also be false if we will exit with a non-zero exit code (due to errors, Werror, and "sorry"). gcc/ChangeLog: PR other/116177 * diagnostic-format-sarif.cc (sarif_invocation::prepare_to_flush): If the diagnostics would lead to us exiting with a failure code, then emit "executionSuccessful": False (SARIF v2.1.0 section §3.20.14). * diagnostic.cc (diagnostic_context::execution_failed_p): New. * diagnostic.h (diagnostic_context::execution_failed_p): New decl. * toplev.cc (toplev::main): Use it for determining returned value. gcc/testsuite/ChangeLog: PR other/116177 * gcc.dg/sarif-output/include-chain-2.c: Remove pruning of "exit status is 1", as we expect this to exit with 0. * gcc.dg/sarif-output/no-diagnostics.c: New test. * gcc.dg/sarif-output/test-include-chain-1.py (test_execution_unsuccessful): Add. * gcc.dg/sarif-output/test-include-chain-2.py (test_execution_successful): Add. * gcc.dg/sarif-output/test-missing-semicolon.py (test_execution_unsuccessful): Add. * gcc.dg/sarif-output/test-no-diagnostics.py: New test. * gcc.dg/sarif-output/test-werror.py: New test. * gcc.dg/sarif-output/werror.c: New test. Signed-off-by:
David Malcolm <dmalcolm@redhat.com>
-
Tamar Christina authored
Gather and scatters are not usually beneficial when the loop count is small. This is because there's not only a cost to their execution within the loop but there is also some cost to enter loops with them. As such this patch models this overhead. For generic tuning we however still prefer gathers/scatters when the loop costs work out. gcc/ChangeLog: * config/aarch64/aarch64-protos.h (struct sve_vec_cost): Add gather_load_x32_init_cost and gather_load_x64_init_cost. * config/aarch64/aarch64.cc (aarch64_vector_costs): Add m_sve_gather_scatter_init_cost. (aarch64_vector_costs::add_stmt_cost): Use them. (aarch64_vector_costs::finish_cost): Likewise. * config/aarch64/tuning_models/a64fx.h: Update. * config/aarch64/tuning_models/cortexx925.h: Update. * config/aarch64/tuning_models/generic.h: Update. * config/aarch64/tuning_models/generic_armv8_a.h: Update. * config/aarch64/tuning_models/generic_armv9_a.h: Update. * config/aarch64/tuning_models/neoverse512tvb.h: Update. * config/aarch64/tuning_models/neoversen2.h: Update. * config/aarch64/tuning_models/neoversen3.h: Update. * config/aarch64/tuning_models/neoversev1.h: Update. * config/aarch64/tuning_models/neoversev2.h: Update. * config/aarch64/tuning_models/neoversev3.h: Update. * config/aarch64/tuning_models/neoversev3ae.h: Update.
-
Gerald Pfeifer authored
gcc: * doc/gm2.texi (Limitations): Rephrase. Remove invalid link.
-
Andi Kleen authored
Host systems with only MMX and no SSE2 should be really rare now. Let's remove the MMX code path to keep the number of custom implementations the same. The SSE2 code path is also somewhat dubious now (nearly everything should have SSE4 4.2 which is >15 years old now), but the SSE2 code path is used as fallback for others and also apparently Solaris uses it due to tool chain deficiencies. libcpp/ChangeLog: * lex.cc (search_line_mmx): Remove function. (init_vectorized_lexer): Remove search_line_mmx.
-
John David Anglin authored
The constant C must be an integral multiple of the shift value in the above optimization. Non integral values can occur evaluating IMAGPART_EXPR when the shadd constant is 8 and we have SFmode. 2024-08-06 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: PR target/113384 * config/pa/pa.cc (hppa_legitimize_address): Add check to ensure constant is an integral multiple of shift the value.
-
Patrick O'Neill authored
This fixes typos in function names and executed code. gcc/ChangeLog: * config/riscv/riscv-target-attr.cc (num_occurences_in_str): Rename... (num_occurrences_in_str): here. (riscv_process_target_attr): Update num_occurences_in_str callsite. * config/riscv/riscv-v.cc (emit_vec_widden_cvt_x_f): widden -> widen. (emit_vec_widen_cvt_x_f): Ditto. (emit_vec_widden_cvt_f_f): Ditto. (emit_vec_widen_cvt_f_f): Ditto. (emit_vec_rounding_to_integer): Update *widden* callsites. * config/riscv/riscv-vector-builtins.cc (expand_builtin): Update required_ext_to_isa_name callsite and fix xtheadvector typo. * config/riscv/riscv-vector-builtins.h (reqired_ext_to_isa_name): Rename... (required_ext_to_isa_name): here. * config/riscv/riscv_th_vector.h: Fix endif label. * config/riscv/vector-crypto.md: boardcast_scalar -> broadcast_scalar. * config/riscv/vector.md: Ditto. Signed-off-by:
Patrick O'Neill <patrick@rivosinc.com>
-
Patrick O'Neill authored
This fixes most of the typos I found when reading various parts of the RISC-V backend. gcc/ChangeLog: * config/riscv/arch-canonicalize: Fix typos in comments. * config/riscv/autovec.md: Ditto. * config/riscv/riscv-avlprop.cc (avl_can_be_propagated_p): Ditto. (pass_avlprop::get_vlmax_ta_preferred_avl): Ditto. * config/riscv/riscv-modes.def (ADJUST_FLOAT_FORMAT): Ditto. (VLS_MODES): Ditto. * config/riscv/riscv-opts.h (TARGET_ZICOND_LIKE): Ditto. (enum rvv_vector_bits_enum): Ditto. * config/riscv/riscv-protos.h (enum insn_flags): Ditto. (enum insn_type): Ditto. * config/riscv/riscv-sr.cc (riscv_sr_match_epilogue): Ditto. * config/riscv/riscv-string.cc (expand_block_move): Ditto. * config/riscv/riscv-v.cc (rvv_builder::is_repeating_sequence): Ditto. (rvv_builder::single_step_npatterns_p): Ditto. (calculate_ratio): Ditto. (expand_const_vector): Ditto. (shuffle_merge_patterns): Ditto. (shuffle_compress_patterns): Ditto. (expand_select_vl): Ditto. * config/riscv/riscv-vector-builtins-functions.def (REQUIRED_EXTENSIONS): Ditto. * config/riscv/riscv-vector-builtins-shapes.h: Ditto. * config/riscv/riscv-vector-builtins.cc (function_builder::add_function): Ditto. (resolve_overloaded_builtin): Ditto. * config/riscv/riscv-vector-builtins.def (vbool1_t): Ditto. (vuint8m8_t): Ditto. (vuint16m8_t): Ditto. (vfloat16m8_t): Ditto. (unsigned_vector): Ditto. * config/riscv/riscv-vector-builtins.h (enum required_ext): Ditto. * config/riscv/riscv-vector-costs.cc (get_store_value): Ditto. (costs::analyze_loop_vinfo): Ditto. (costs::add_stmt_cost): Ditto. * config/riscv/riscv.cc (riscv_build_integer): Ditto. (riscv_vector_type_p): Ditto. * config/riscv/thead.cc (th_mempair_output_move): Ditto. * config/riscv/thead.md: Ditto. * config/riscv/vector-iterators.md: Ditto. * config/riscv/vector.md: Ditto. * config/riscv/zc.md: Ditto. Signed-off-by:
Patrick O'Neill <patrick@rivosinc.com>
-
Marek Polacek authored
Patrick noticed a few more concept_check_p checks that can be removed now. gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_call_expression): Remove concept_check_p check. (cxx_eval_outermost_constant_expr): Likewise. * cp-gimplify.cc (cp_genericize_r) <case CALL_EXPR>: Likewise. * except.cc (check_noexcept_r): Likewise.
-
Jason Merrill authored
Building on the last patch, deduction should probably look through all IMPLICIT_CONV_EXPR like we do other conversions. One resulting regression turned out to be due to PR94568, fixed separately. The one other regression was for a seeming mismatch between a function and its address, handled here. Before this change we treated the IMPLICIT_CONV_EXPR as dependent because the template parameter has dependent type. PR c++/116223 gcc/cp/ChangeLog: * pt.cc (deducible_expression): Strip all IMPLICIT_CONV_EXPR. (unify): Likewise. Handle resulting function/addr mismatch.
-
Jason Merrill authored
My r14-8291 for PR112632 introduced IMPLICIT_CONV_EXPR_FORCED to express conversions to the type of an alias template parameter. In this example, that broke deduction of X in the call to foo, so let's teach deduction to look through it. PR c++/116223 PR c++/112632 gcc/cp/ChangeLog: * pt.cc (deducible_expression): Also look through IMPLICIT_CONV_EXPR_FORCED. (unify): Likewise. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/nontype-auto25.C: New test.
-
Jason Merrill authored
A zero-initializer should not reflect the constness of what it's initializing, as it does not for initializers with different syntax. This does have mangling implications for rare C++20 code, but it seems infeasable to make the mangling depend on -fabi-version while fixing the semantic bug, and C++20 is still experimental anyway. PR c++/94568 gcc/cp/ChangeLog: * init.cc (build_zero_init_1): Call cv_unqualified. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/nontype-class36.C: Remove xfail. * g++.dg/cpp2a/nontype-class37.C: Remove xfail. * g++.dg/cpp1z/nontype-auto26.C: New test.
-
Roger Sayle authored
This patch refactors ashrv2di RTL expansion into a function so that it may be reused by a pre-reload splitter, such that DImode right shifts may be considered candidates during the Scalar-To-Vector (STV) pass. Currently DImode arithmetic right shifts are not considered potential candidates during STV, so for the following testcase: long long m; typedef long long v2di __attribute__((vector_size (16))); void foo(v2di x) { m = x[0]>>63; } We currently see the following warning/error during STV2 > r101 use in insn 7 isn't convertible And end up generating scalar code with an interunit move: foo: movq %xmm0, %rax sarq $63, %rax movq %rax, m(%rip) ret With this patch, we can reuse the RTL expansion logic and produce: foo: psrad $31, %xmm0 pshufd $245, %xmm0, %xmm0 movq %xmm0, m(%rip) ret Or with the addition of -mavx2, the equivalent: foo: vpxor %xmm1, %xmm1, %xmm1 vpcmpgtq %xmm0, %xmm1, %xmm0 vmovq %xmm0, m(%rip) ret The only design decision of note is the choice to continue lowering V2DI into vector sequences during RTL expansion, to enable combine to optimize things if possible. Using just define_insn_and_split potentially misses optimizations, such as reusing the zero vector produced by vpxor above. It may be necessary to tweak STV's compute gain at some point, but this patch controls what's possible (rather than what's beneficial). 2024-08-06 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * config/i386/i386-expand.cc (ix86_expand_v2di_ashiftrt): New function refactored from define_expand ashrv2di3. * config/i386/i386-features.cc (general_scalar_to_vector_candidate_p) <case ASHIFTRT>: Handle like other shifts and rotates. * config/i386/i386-protos.h (ix86_expand_v2di_ashiftrt): Prototype. * config/i386/sse.md (ashrv2di3): Call ix86_expand_v2di_ashiftrt. (*ashrv2di3): New define_insn_and_split to enable creation by stv2 pass, and splitting during split1 reusing ix86_expand_v2di_ashiftrt. gcc/testsuite/ChangeLog * gcc.target/i386/sse2-stv-2.c: New test case.
-
Patrick O'Neill authored
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>
-
Patrick Palka authored
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>
-
Filip Kastl authored
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>
-
Richard Biener authored
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.
-
Jakub Jelinek authored
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.
-
Jakub Jelinek authored
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.
-
Yannick Moy authored
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.
-
Bob Duff authored
...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.
-
Gary Dismukes authored
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.
-
Javier Miranda authored
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.
-
Viljar Indus authored
gcc/ada/ * libgnarl/s-interr__hwint.adb: Use fully qualified names to avoid ambiguity. * libgnarl/s-taprop__qnx.adb: Likewise.
-
Javier Miranda authored
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.
-
Viljar Indus authored
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.
-
Yannick Moy authored
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.
-
Bob Duff authored
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.
-
Tobias Burnus authored
The run time library loads the offload functions and variable and optionally the ICV variable and returns the number of loaded items, which has to match the host side. The plugin returns "+1" (since GCC 12) for the ICV variable entry, independently whether it was loaded or not, but the var's value (start == end == 0) can be used to detect when this failed. Thus, we can tighten the assert check - which this commit does together with making the output less surprising - and simplify the condition further below. libgomp/ChangeLog: * target.c (gomp_load_image_to_device): Extend fatal-error message; simplify a condition.
-
Richard Biener authored
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.
-
Haochen Gui authored
gcc/ * config/rs6000/predicates.md (any_operand): Add const_vector.
-
Paul Thomas authored
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.
-
Feng Xue authored
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.
-
Feng Xue authored
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.
-
Andrew Pinski authored
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>
-
Marek Polacek authored
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.
-
GCC Administrator authored
-