- Jul 27, 2023
-
-
GCC Administrator authored
-
- Jul 26, 2023
-
-
Patrick Palka authored
The previous fix doesn't work for partially instantiated ttps mainly because most_general_template is a no-op for them. This patch fixes this by giving such ttps a DECL_TEMPLATE_INFO (extending the r11-734-g2fb595f8348e16 fix) with which most_general_template can obtain the original, unlowered ttp. This patch additionally makes coerce_template_template_parms use the correct amount of levels from the scope of a ttp argument. PR c++/110566 PR c++/108179 gcc/cp/ChangeLog: * pt.cc (reduce_template_parm_level): Set DECL_TEMPLATE_INFO on the DECL_TEMPLATE_RESULT of the new ttp. (add_defaults_to_ttp): Make a copy of the original ttp's DECL_TEMPLATE_RESULT, and update this copy's DECL_TEMPLATE_INFO as well. (coerce_template_template_parms): Make sure 'scope_args' has the right amount of levels for the ttp argument. (most_general_template): Handle template template parameters. (rewrite_template_parm): Set DECL_TEMPLATE_RESULT on the DECL_TEMPLATE_RESULT of the new ttp. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/class-deduction115.C: New test. * g++.dg/template/ttp39.C: New test.
-
Patrick Palka authored
Since the template arguments 'pargs' we pass to coerce_template_parms from coerce_template_template_parms are always a full set, we need to make sure we always pass the parameters of the most general template because if the template is partially instantiated then the levels won't match up. In the testcase below during said call to coerce_template_parms the parameters are {X, Y}, both level 1 rather than 2, and the arguments are {{int}, {N, M}}, which results in a crash during auto deduction for parameters' types. PR c++/110566 PR c++/108179 gcc/cp/ChangeLog: * pt.cc (coerce_template_template_parms): Simplify by using DECL_INNERMOST_TEMPLATE_PARMS and removing redundant asserts. Always pass the parameters of the most general template to coerce_template_parms. gcc/testsuite/ChangeLog: * g++.dg/template/ttp38.C: New test.
-
Xiao Zeng authored
This patch completes the recognition of the basic semantics defined in the spec, namely: Conditional zero, if condition is equal to zero rd = (rs2 == 0) ? 0 : rs1 Conditional zero, if condition is non zero rd = (rs2 != 0) ? 0 : rs1 gcc/ChangeLog: * config/riscv/riscv.md: Include zicond.md * config/riscv/zicond.md: New file. gcc/testsuite/ChangeLog: * gcc.target/riscv/zicond-primitiveSemantics.c: New test. Co-authored-by:
Philipp Tomsich <philipp.tomsich@vrull.eu> Co-authored-by:
Raphael Zinsly <rzinsly@ventanamicro.com> Co-authored-by:
Jeff Law <jlaw@ventanamicro.com>
-
Xiao Zeng authored
gcc/ChangeLog: * common/config/riscv/riscv-common.cc: New extension. * config/riscv/riscv-opts.h (MASK_ZICOND): New mask. (TARGET_ZICOND): New target. gcc/testsuite/ChangeLog: * gcc.target/riscv/attribute-20.c: New test. * gcc.target/riscv/attribute-21.c: New test. Co-authored-by:
Philipp Tomsich <philipp.tomsich@vrull.eu>
-
Patrick Palka authored
This teaches unify how to compare two REAL_CSTs. PR c++/110809 gcc/cp/ChangeLog: * pt.cc (unify) <case INTEGER_CST>: Generalize to handle REAL_CST as well. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/nontype-float3.C: New test.
-
Harald Anlauf authored
gcc/fortran/ChangeLog: PR fortran/68569 * resolve.cc (check_data_variable): Do not accept strings with deferred length or non-constant length in a DATA statement. Reject also substrings of string variables of non-constant length. gcc/testsuite/ChangeLog: PR fortran/68569 * gfortran.dg/data_char_4.f90: Adjust expected diagnostic. * gfortran.dg/data_char_5.f90: Likewise. * gfortran.dg/data_char_6.f90: New test.
-
Joseph Myers authored
* uk.po: Update.
-
Joseph Myers authored
* gcc.pot: Regenerate.
-
Jonathan Wakely authored
This new test uses uniform initialization syntax, so requires C++11 or later. libstdc++-v3/ChangeLog: PR libstdc++/110807 * testsuite/23_containers/vector/bool/110807.cc: Require c++11.
-
Carl Love authored
The function find_instance assumes it is called to check a built-in with only two arguments. This patch extends the function by adding a parameter specifying the number of built-in arguments to check. Note, this patch was supposed to have been applied before commit: commit b51795c8 Author: Carl Love <cel@us.ibm.com> Date: Wed Jul 26 11:31:53 2023 -0400 rs6000, fix vec_replace_unaligned built-in arguments ... gcc/ChangeLog: * config/rs6000/rs6000-c.cc (find_instance): Add new parameter that specifies the number of built-in arguments to check. (altivec_resolve_overloaded_builtin): Update calls to find_instance to pass the number of built-in arguments to be checked.
-
Marek Polacek authored
It's pointless to call *_rvalue_constant_expression when we're not using the result. Also apply some drive-by cleanups. gcc/cp/ChangeLog: * parser.cc (cp_parser_constant_expression): Allow non_constant_p to be nullptr even when allow_non_constant_p is true. Don't call _rvalue_constant_expression when not necessary. Move local variable declarations closer to their first use. (cp_parser_static_assert): Don't pass a dummy down to cp_parser_constant_expression.
-
Jason Merrill authored
For backward compatibility we still want to allow patterns like this->A<T>::foo, but the template keyword in a qualified name is specifically to specify that a dependent name is a template, so don't look in the enclosing scope at all. Also fix handling of dependent bases: if member lookup in the current instantiation fails and we have dependent bases, the lookup is dependent. We were already handling that for the case where lookup in the enclosing scope also fails, but we also want it to affect that lookup itself. PR c++/106310 gcc/cp/ChangeLog: * parser.cc (cp_parser_template_name): Skip non-member lookup after the template keyword. (cp_parser_lookup_name): Pass down template_keyword_p. gcc/testsuite/ChangeLog: * g++.dg/template/template-keyword4.C: New test.
-
David Faust authored
This patch adds support for the general atomic operations introduced in eBPF v3. In addition to the existing atomic add instruction, this adds: - Atomic and, or, xor - Fetching versions of these operations (including add) - Atomic exchange - Atomic compare-and-exchange To control emission of these instructions, a new target option -m[no-]v3-atomics is added. This option is enabled by -mcpu=v3 and above. Support for these instructions was recently added in binutils. gcc/ * config/bpf/bpf.opt (mv3-atomics): New option. * config/bpf/bpf.cc (bpf_option_override): Handle it here. * config/bpf/bpf.h (enum_reg_class): Add R0 class. (REG_CLASS_NAMES): Likewise. (REG_CLASS_CONTENTS): Likewise. (REGNO_REG_CLASS): Handle R0. * config/bpf/bpf.md (UNSPEC_XADD): Rename to UNSPEC_AADD. (UNSPEC_AAND): New unspec. (UNSPEC_AOR): Likewise. (UNSPEC_AXOR): Likewise. (UNSPEC_AFADD): Likewise. (UNSPEC_AFAND): Likewise. (UNSPEC_AFOR): Likewise. (UNSPEC_AFXOR): Likewise. (UNSPEC_AXCHG): Likewise. (UNSPEC_ACMPX): Likewise. (atomic_add<mode>): Use UNSPEC_AADD and atomic type attribute. Move to... * config/bpf/atomic.md: ...Here. New file. * config/bpf/constraints.md (t): New constraint for R0. * doc/invoke.texi (eBPF Options): Document -mv3-atomics. gcc/testsuite/ * gcc.target/bpf/atomic-cmpxchg-1.c: New test. * gcc.target/bpf/atomic-cmpxchg-2.c: New test. * gcc.target/bpf/atomic-fetch-op-1.c: New test. * gcc.target/bpf/atomic-fetch-op-2.c: New test. * gcc.target/bpf/atomic-fetch-op-3.c: New test. * gcc.target/bpf/atomic-op-1.c: New test. * gcc.target/bpf/atomic-op-2.c: New test. * gcc.target/bpf/atomic-op-3.c: New test. * gcc.target/bpf/atomic-xchg-1.c: New test. * gcc.target/bpf/atomic-xchg-2.c: New test.
-
Jonathan Wakely authored
GCC thinks the allocation can alter the object being copied if it's globally reachable, so doesn't realize that [x.begin(), x.end()) after the allocation is the same as x.size() before it. This causes a testsuite failure when testing with -D_GLIBCXX_DEBUG: FAIL: 23_containers/vector/bool/swap.cc (test for excess errors) A fix is to move the calls to x.begin() and x.end() to before the allocation. A similar problem exists in vector<bool>::_M_insert_range where *this is globally reachable, as reported in PR libstdc++/110807. That can also be fixed by moving calls to begin() and end() before the allocation. libstdc++-v3/ChangeLog: PR libstdc++/110807 * include/bits/stl_bvector.h (vector(const vector&)): Access iterators before allocating. * include/bits/vector.tcc (vector<bool>::_M_insert_range): Likewise. * testsuite/23_containers/vector/bool/110807.cc: New test.
-
Jonathan Wakely authored
We already have these attributes on the definitions in <bits/stl_algo.h> but they don't work due to PR c++/84542. Add the attributes to the declarations in <bits/algorithmfwd.h> as well, and add a test. libstdc++-v3/ChangeLog: * include/bits/algorithmfwd.h (random_shuffle): Add deprecated attribute. * include/bits/stl_algo.h (random_shuffle): Correct comments. * testsuite/25_algorithms/random_shuffle/1.cc: Disable deprecated warnings. * testsuite/25_algorithms/random_shuffle/59603.cc: Likewise. * testsuite/25_algorithms/random_shuffle/moveable.cc: Likewise. * testsuite/25_algorithms/random_shuffle/deprecated.cc: New test.
-
Matthew Malcomson authored
Also reformat a comment that had too long lines. Commit c5bd0e58 introduced both these problems to fix. Committed as obvious after ensuring that when running the testcase on AArch64 it still fails before the original c5bd0e58 commit and passes after it. gcc/ChangeLog: * tree-vect-stmts.cc (get_group_load_store_type): Reformat comment. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-multi-peel-gaps.c: Add `check_vect` call into `main` of this testcase.
-
Carl Love authored
The first argument of the vec_replace_unaligned built-in should always be of type vector unsigned char, as specified in gcc/doc/extend.texi. This patch fixes the builtin definitions and updates the test cases to use the correct arguments. The original test file is renamed and a second test file is added for a new test case. gcc/ChangeLog: * config/rs6000/rs6000-builtins.def: Rename __builtin_altivec_vreplace_un_uv2di as __builtin_altivec_vreplace_un_udi __builtin_altivec_vreplace_un_uv4si as __builtin_altivec_vreplace_un_usi __builtin_altivec_vreplace_un_v2df as __builtin_altivec_vreplace_un_df __builtin_altivec_vreplace_un_v2di as __builtin_altivec_vreplace_un_di __builtin_altivec_vreplace_un_v4sf as __builtin_altivec_vreplace_un_sf __builtin_altivec_vreplace_un_v4si as __builtin_altivec_vreplace_un_si. Rename VREPLACE_UN_UV2DI as VREPLACE_UN_UDI, VREPLACE_UN_UV4SI as VREPLACE_UN_USI, VREPLACE_UN_V2DF as VREPLACE_UN_DF, VREPLACE_UN_V2DI as VREPLACE_UN_DI, VREPLACE_UN_V4SF as VREPLACE_UN_SF, VREPLACE_UN_V4SI as VREPLACE_UN_SI. Rename vreplace_un_v2di as vreplace_un_di, vreplace_un_v4si as vreplace_un_si, vreplace_un_v2df as vreplace_un_df, vreplace_un_v2di as vreplace_un_di, vreplace_un_v4sf as vreplace_un_sf, vreplace_un_v4si as vreplace_un_si. * config/rs6000/rs6000-c.cc (find_instance): Add case RS6000_OVLD_VEC_REPLACE_UN. * config/rs6000/rs6000-overload.def (__builtin_vec_replace_un): Fix first argument type. Rename VREPLACE_UN_UV4SI as VREPLACE_UN_USI, VREPLACE_UN_V4SI as VREPLACE_UN_SI, VREPLACE_UN_UV2DI as VREPLACE_UN_UDI, VREPLACE_UN_V2DI as VREPLACE_UN_DI, VREPLACE_UN_V4SF as VREPLACE_UN_SF, VREPLACE_UN_V2DF as VREPLACE_UN_DF. * config/rs6000/vsx.md (REPLACE_ELT): Rename the mode_iterator REPLACE_ELT_V for vector modes. (REPLACE_ELT): New scalar mode iterator. (REPLACE_ELT_char): Add scalar attributes. (vreplace_un_<mode>): Change iterator and mode attribute. gcc/testsuite/ChangeLog: * gcc.target/powerpc/vec-replace-word-runnable.c: Renam vec-replace-word-runnable_1.c. * gcc.target/powerpc/vec-replace-word-runnable_1.c (dg-options): add -flax-vector-conversions. (vec_replace_unaligned) Fix first argument type. (vresult_uchar): Fix expected results. (vec_replace_unaligned): Update for loop to check uchar results. Remove extra spaces in if statements. Insert missing spaces in for statements. * gcc.target/powerpc/vec-replace-word-runnable_2.c: New test file.
-
David Malcolm authored
This patch introduces a "symbol" base class that region and svalue both inherit from, generalizing the ID from the region class so it's also used by svalues. This gives a way of sorting regions and svalues into creation order, which I've found useful in my experiments with adding SMT support (PR analyzer/104940). gcc/ChangeLog: PR analyzer/104940 * Makefile.in (ANALYZER_OBJS): Add analyzer/symbol.o. gcc/analyzer/ChangeLog: PR analyzer/104940 * region-model-manager.cc (region_model_manager::region_model_manager): Update for generalizing region ids to also cover svalues. (region_model_manager::get_or_create_constant_svalue): Likewise. (region_model_manager::get_or_create_unknown_svalue): Likewise. (region_model_manager::create_unique_svalue): Likewise. (region_model_manager::get_or_create_initial_value): Likewise. (region_model_manager::get_or_create_setjmp_svalue): Likewise. (region_model_manager::get_or_create_poisoned_svalue): Likewise. (region_model_manager::get_ptr_svalue): Likewise. (region_model_manager::get_or_create_unaryop): Likewise. (region_model_manager::get_or_create_binop): Likewise. (region_model_manager::get_or_create_sub_svalue): Likewise. (region_model_manager::get_or_create_repeated_svalue): Likewise. (region_model_manager::get_or_create_bits_within): Likewise. (region_model_manager::get_or_create_unmergeable): Likewise. (region_model_manager::get_or_create_widening_svalue): Likewise. (region_model_manager::get_or_create_compound_svalue): Likewise. (region_model_manager::get_or_create_conjured_svalue): Likewise. (region_model_manager::get_or_create_asm_output_svalue): Likewise. (region_model_manager::get_or_create_const_fn_result_svalue): Likewise. (region_model_manager::get_region_for_fndecl): Likewise. (region_model_manager::get_region_for_label): Likewise. (region_model_manager::get_region_for_global): Likewise. (region_model_manager::get_field_region): Likewise. (region_model_manager::get_element_region): Likewise. (region_model_manager::get_offset_region): Likewise. (region_model_manager::get_sized_region): Likewise. (region_model_manager::get_cast_region): Likewise. (region_model_manager::get_frame_region): Likewise. (region_model_manager::get_symbolic_region): Likewise. (region_model_manager::get_region_for_string): Likewise. (region_model_manager::get_bit_range): Likewise. (region_model_manager::get_var_arg_region): Likewise. (region_model_manager::get_region_for_unexpected_tree_code): Likewise. (region_model_manager::get_or_create_region_for_heap_alloc): Likewise. (region_model_manager::create_region_for_alloca): Likewise. (region_model_manager::log_stats): Likewise. * region-model-manager.h (region_model_manager::get_num_regions): Replace with... (region_model_manager::get_num_symbols): ...this. (region_model_manager::alloc_region_id): Replace with... (region_model_manager::alloc_symbol_id): ...this. (region_model_manager::m_next_region_id): Replace with... (region_model_manager::m_next_symbol_id): ...this. * region-model.cc (selftest::test_get_representative_tree): Update for generalizing region ids to also cover svalues. (selftest::test_binop_svalue_folding): Likewise. (selftest::test_state_merging): Likewise. * region.cc (region::cmp_ids): Delete, in favor of symbol::cmp_ids. (region::region): Update for introduction of symbol base class. (frame_region::get_region_for_local): Likewise. (root_region::root_region): Likewise. (symbolic_region::symbolic_region): Likewise. * region.h: Replace include of "analyzer/complexity.h" with "analyzer/symbol.h". (class region): Make a subclass of symbol. (region::get_id): Delete in favor of symbol::get_id. (region::cmp_ids): Delete in favor of symbol::cmp_ids. (region::get_complexity): Delete in favor of symbol::get_complexity. (region::region): Use symbol::id_t for "id" param. (region::m_complexity): Move field to symbol base class. (region::m_id): Likewise. (space_region::space_region): Use symbol::id_t for "id" param. (frame_region::frame_region): Likewise. (globals_region::globals_region): Likewise. (code_region::code_region): Likewise. (function_region::function_region): Likewise. (label_region::label_region): Likewise. (stack_region::stack_region): Likewise. (heap_region::heap_region): Likewise. (thread_local_region::thread_local_region): Likewise. (root_region::root_region): Likewise. (symbolic_region::symbolic_region): Likewise. (decl_region::decl_region): Likewise. (field_region::field_region): Likewise. (element_region::element_region): Likewise. (offset_region::offset_region): Likewise. (sized_region::sized_region): Likewise. (cast_region::cast_region): Likewise. (heap_allocated_region::heap_allocated_region): Likewise. (alloca_region::alloca_region): Likewise. (string_region::string_region): Likewise. (bit_range_region::bit_range_region): Likewise. (var_arg_region::var_arg_region): Likewise. (errno_region::errno_region): Likewise. (unknown_region::unknown_region): Likewise. * svalue.cc (sub_svalue::sub_svalue): Add symbol::id_t param. (repeated_svalue::repeated_svalue): Likewise. (bits_within_svalue::bits_within_svalue): Likewise. (compound_svalue::compound_svalue): Likewise. * svalue.h: Replace include of "analyzer/complexity.h" with "analyzer/symbol.h". (class svalue): Make a subclass of symbol. (svalue::get_complexity): Delete in favor of symbol::get_complexity. (svalue::svalue): Add symbol::id_t param. Update for new base class. (svalue::m_complexity): Delete in favor of symbol::m_complexity. (region_svalue::region_svalue): Add symbol::id_t param (constant_svalue::constant_svalue): Likewise. (unknown_svalue::unknown_svalue): Likewise. (poisoned_svalue::poisoned_svalue): Likewise. (setjmp_svalue::setjmp_svalue): Likewise. (initial_svalue::initial_svalue): Likewise. (unaryop_svalue::unaryop_svalue): Likewise. (binop_svalue::binop_svalue): Likewise. (sub_svalue::sub_svalue): Likewise. (repeated_svalue::repeated_svalue): Likewise. (bits_within_svalue::bits_within_svalue): Likewise. (unmergeable_svalue::unmergeable_svalue): Likewise. (placeholder_svalue::placeholder_svalue): Likewise. (widening_svalue::widening_svalue): Likewise. (compound_svalue::compound_svalue): Likewise. (conjured_svalue::conjured_svalue): Likewise. (asm_output_svalue::asm_output_svalue): Likewise. (const_fn_result_svalue::const_fn_result_svalue): Likewise. * symbol.cc: New file. * symbol.h: New file. Signed-off-by:
David Malcolm <dmalcolm@redhat.com>
-
Tobias Burnus authored
When copying a 2D or 3D rectangular memmory block, the performance is better when using CUDA's cuMemcpy2D/cuMemcpy3D instead of copying the data one by one. That's what this commit does. Additionally, it permits device-to-device copies, if neccessary using a temporary variable on the host. include/ChangeLog: * cuda/cuda.h (CUlimit): Add CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_INVALID_HANDLE. (CUarray, CUmemorytype, CUDA_MEMCPY2D, CUDA_MEMCPY3D, CUDA_MEMCPY3D_PEER): New typdefs. (cuMemcpy2D, cuMemcpy2DAsync, cuMemcpy2DUnaligned, cuMemcpy3D, cuMemcpy3DAsync, cuMemcpy3DPeer, cuMemcpy3DPeerAsync): New prototypes. libgomp/ChangeLog: * libgomp-plugin.h (GOMP_OFFLOAD_memcpy2d, GOMP_OFFLOAD_memcpy3d): New prototypes. * libgomp.h (struct gomp_device_descr): Add memcpy2d_func and memcpy3d_func. * libgomp.texi (nvtpx): Document when cuMemcpy2D/cuMemcpy3D is used. * oacc-host.c (memcpy2d_func, .memcpy3d_func): Init with NULL. * plugin/cuda-lib.def (cuMemcpy2D, cuMemcpy2DUnaligned, cuMemcpy3D): Invoke via CUDA_ONE_CALL. * plugin/plugin-nvptx.c (GOMP_OFFLOAD_memcpy2d, GOMP_OFFLOAD_memcpy3d): New. * target.c (omp_target_memcpy_rect_worker): (omp_target_memcpy_rect_check, omp_target_memcpy_rect_copy): Permit all device-to-device copyies; invoke new plugins for 2D and 3D copying when available. (gomp_load_plugin_for_device): DLSYM the new plugin functions. * testsuite/libgomp.c/target-12.c: Fix dimension bug. * testsuite/libgomp.fortran/target-12.f90: Likewise. * testsuite/libgomp.fortran/target-memcpy-rect-1.f90: New test.
-
Uros Bizjak authored
The testcase should use dg-additional-options istead of dg-options to not overwrite default compile flags that include path for finding the IEEE modules. gcc/testsuite/ChangeLog: * gfortran.dg/ieee/comparisons_3.F90: Use dg-additional-options instead of dg-options.
-
Richard Biener authored
The following patch makes sure to elide a redundant permute that can be merged with existing splats represented as load permutations as we now do for non-grouped SLP loads. This is the last bit missing to fix this PR where the main fix was already done by r14-2117-gdd86a5a69cbda4 PR tree-optimization/106081 * tree-vect-slp.cc (vect_optimize_slp_pass::start_choosing_layouts): Assign layout -1 to splats. * gcc.dg/vect/pr106081.c: New testcase.
-
Siddhesh Poyarekar authored
The test deliberately reads beyond bounds to exersize ubsan and the return value may be anything, based on previous allocations. The OFF test caters for it by ANDing the return with 0, do the same for the DYN test. gcc/testsuite/ChangeLog: PR testsuite/110763 * gcc.dg/ubsan/object-size-dyn.c (dyn): New parameter RET. (main): Use it. Signed-off-by:
Siddhesh Poyarekar <siddhesh@gotplt.org>
-
Aldy Hernandez authored
Now that we can generically handle bitmasks for unary operators, there's no need to special case them. gcc/ChangeLog: * range-op-mixed.h (class operator_cast): Add update_bitmask. * range-op.cc (operator_cast::update_bitmask): New. (operator_cast::fold_range): Call update_bitmask.
-
Li Xu authored
Consider this following case: void test_vsoxseg3ei32_v_i32mf2x3(int32_t *base, vuint32mf2_t bindex, vint32mf2x3_t v_tuple, size_t vl) { return __riscv_vsoxseg3ei32_v_i32mf2x3(base, bindex, v_tuple, vl); } Compiler failed with: test.c:19:1: internal compiler error: in vl_vtype_info, at config/riscv/riscv-vsetvl.cc:1679 19 | } | ^ 0x1439ec2 riscv_vector::vl_vtype_info::vl_vtype_info(riscv_vector::avl_info, unsigned char, riscv_vector::vlmul_type, unsigned char, bool, bool) ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:1679 0x143f788 get_vl_vtype_info ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:807 0x143f788 riscv_vector::vector_insn_info::parse_insn(rtl_ssa::insn_info*) ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:1843 0x1440371 riscv_vector::vector_infos_manager::vector_infos_manager() ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:2350 0x14407ee pass_vsetvl::init() ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:4581 0x14471cf pass_vsetvl::execute(function*) ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:4716 gcc/ChangeLog: * config/riscv/riscv-vector-builtins.def (vfloat16mf4x2_t): Change scalar type to float16, eliminate warning. (vfloat16mf4x3_t): Ditto. (vfloat16mf4x4_t): Ditto. (vfloat16mf4x5_t): Ditto. (vfloat16mf4x6_t): Ditto. (vfloat16mf4x7_t): Ditto. (vfloat16mf4x8_t): Ditto. (vfloat16mf2x2_t): Ditto. (vfloat16mf2x3_t): Ditto. (vfloat16mf2x4_t): Ditto. (vfloat16mf2x5_t): Ditto. (vfloat16mf2x6_t): Ditto. (vfloat16mf2x7_t): Ditto. (vfloat16mf2x8_t): Ditto. (vfloat16m1x2_t): Ditto. (vfloat16m1x3_t): Ditto. (vfloat16m1x4_t): Ditto. (vfloat16m1x5_t): Ditto. (vfloat16m1x6_t): Ditto. (vfloat16m1x7_t): Ditto. (vfloat16m1x8_t): Ditto. (vfloat16m2x2_t): Ditto. (vfloat16m2x3_t): Ditto. (vfloat16m2x4_t): Ditto. (vfloat16m4x2_t): Ditto. * config/riscv/vector-iterators.md: add RVVM4x2DF in iterator V4T. * config/riscv/vector.md: add tuple mode in attr sew. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/tuple-intrinsic.c: New test.
-
Uros Bizjak authored
Clear the upper half of a V4SFmode operand register in front of all potentially trapping instructions. The testcase: --cut here-- typedef float v2sf __attribute__((vector_size(8))); typedef float v4sf __attribute__((vector_size(16))); v2sf test(v4sf x, v4sf y) { v2sf x2, y2; x2 = __builtin_shufflevector (x, x, 0, 1); y2 = __builtin_shufflevector (y, y, 0, 1); return x2 + y2; } --cut here-- now compiles to: movq %xmm1, %xmm1 # 9 [c=4 l=4] *vec_concatv4sf_0 movq %xmm0, %xmm0 # 10 [c=4 l=4] *vec_concatv4sf_0 addps %xmm1, %xmm0 # 11 [c=12 l=3] *addv4sf3/0 This approach addresses issues with exceptions, as well as issues with denormal/invalid values. An obvious exception to the rule is a division, where the value != 0.0 should be loaded into the upper half of the denominator to avoid division by zero exception. The patch effectively tightens the solution from PR95046 by clearing upper halves of all operand registers before every potentially trapping instruction. The testcase: --cut here-- typedef float __attribute__((vector_size(8))) v2sf; v2sf test (v2sf a, v2sf b, v2sf c) { return a * b - c; } --cut here-- compiles to: movq %xmm1, %xmm1 # 8 [c=4 l=4] *vec_concatv4sf_0 movq %xmm0, %xmm0 # 9 [c=4 l=4] *vec_concatv4sf_0 movq %xmm2, %xmm2 # 12 [c=4 l=4] *vec_concatv4sf_0 mulps %xmm1, %xmm0 # 10 [c=16 l=3] *mulv4sf3/0 movq %xmm0, %xmm0 # 13 [c=4 l=4] *vec_concatv4sf_0 subps %xmm2, %xmm0 # 14 [c=12 l=3] *subv4sf3/0 The implementation emits V4SFmode operation, so we can remove all "emulated" SSE2 V2SFmode trapping instructions and remove "emulated" SSE2 V2SFmode alternatives from 3dNOW! insn patterns. PR target/110762 gcc/ChangeLog: * config/i386/i386.md (plusminusmult): New code iterator. * config/i386/mmx.md (mmxdoublevecmode): New mode attribute. (movq_<mode>_to_sse): New expander. (<plusminusmult:insn>v2sf3): Macroize expander from addv2sf3, subv2sf3 and mulv2sf3 using plusminusmult code iterator. Rewrite as a wrapper around V4SFmode operation. (mmx_addv2sf3): Change operand 1 and operand 2 predicates to nonimmediate_operand. (*mmx_addv2sf3): Remove SSE alternatives. Change operand 1 and operand 2 predicates to nonimmediate_operand. (mmx_subv2sf3): Change operand 2 predicate to nonimmediate_operand. (mmx_subrv2sf3): Change operand 1 predicate to nonimmediate_operand. (*mmx_subv2sf3): Remove SSE alternatives. Change operand 1 and operand 2 predicates to nonimmediate_operand. (mmx_mulv2sf3): Change operand 1 and operand 2 predicates to nonimmediate_operand. (*mmx_mulv2sf3): Remove SSE alternatives. Change operand 1 and operand 2 predicates to nonimmediate_operand. (divv2sf3): Rewrite as a wrapper around V4SFmode operation. (<smaxmin:code>v2sf3): Ditto. (mmx_<smaxmin:code>v2sf3): Change operand 1 and operand 2 predicates to nonimmediate_operand. (*mmx_<smaxmin:code>v2sf3): Remove SSE alternatives. Change operand 1 and operand 2 predicates to nonimmediate_operand. (mmx_ieee_<ieee_maxmin>v2sf3): Ditto. (sqrtv2sf2): Rewrite as a wrapper around V4SFmode operation. (*mmx_haddv2sf3_low): Ditto. (*mmx_hsubv2sf3_low): Ditto. (vec_addsubv2sf3): Ditto. (*mmx_maskcmpv2sf3_comm): Remove. (*mmx_maskcmpv2sf3): Remove. (vec_cmpv2sfv2si): Rewrite as a wrapper around V4SFmode operation. (vcond<V2FI:mode>v2sf): Ditto. (fmav2sf4): Ditto. (fmsv2sf4): Ditto. (fnmav2sf4): Ditto. (fnmsv2sf4): Ditto. (fix_truncv2sfv2si2): Ditto. (fixuns_truncv2sfv2si2): Ditto. (mmx_fix_truncv2sfv2si2): Remove SSE alternatives. Change operand 1 predicate to nonimmediate_operand. (floatv2siv2sf2): Rewrite as a wrapper around V4SFmode operation. (floatunsv2siv2sf2): Ditto. (mmx_floatv2siv2sf2): Remove SSE alternatives. Change operand 1 predicate to nonimmediate_operand. (nearbyintv2sf2): Rewrite as a wrapper around V4SFmode operation. (rintv2sf2): Ditto. (lrintv2sfv2si2): Ditto. (ceilv2sf2): Ditto. (lceilv2sfv2si2): Ditto. (floorv2sf2): Ditto. (lfloorv2sfv2si2): Ditto. (btruncv2sf2): Ditto. (roundv2sf2): Ditto. (lroundv2sfv2si2): Ditto. (*mmx_roundv2sf2): Remove. gcc/testsuite/ChangeLog: * gcc.target/i386/pr110762.c: New test.
-
Jose E. Marchesi authored
This patch fixes GCC to generate correct neg and neg32 instructions, which do not take a source register operand. A couple of new tests are added. Tested in bpf-unknown-none. gcc/ChangeLog 2023-07-26 Jose E. Marchesi <jose.marchesi@oracle.com> * config/bpf/bpf.md: Fix neg{SI,DI}2 insn. gcc/testsuite/ChangeLog 2023-07-26 Jose E. Marchesi <jose.marchesi@oracle.com> * gcc.target/bpf/neg-1.c: New test. * gcc.target/bpf/neg-pseudoc-1.c: Likewise.
-
Tobias Burnus authored
libgomp/ChangeLog: * libgomp.texi (OpenMP 5.2 features): Add 'all' for 'defaultmap' as 'N'. (Tasking Routines): Document omp_in_explicit_task. (Implementation-defined ICV Initialization): Use @ref not @code.
-
Richard Biener authored
Code hoisting part of GIMPLE PRE failed to adjust the TBAA behavior of common loads in the case the alias set of the ref was the same but the base alias set was not. It also failed to adjust the base behavior, assuming it would match. The following plugs this hole. PR tree-optimization/110799 * tree-ssa-pre.cc (compute_avail): More thoroughly match up TBAA behavior of redundant loads. * gcc.dg/torture/pr110799.c: New testcase.
-
Jakub Jelinek authored
IEEE754 says that x + (-x) and x - x result in +0 in all rounding modes but rounding towards negative infinity, in which case the result is -0 for all finite x. x + x and x - (-x) if it is zero retain sign of x. Now, range_arithmetic implements the normal rounds to even rounding, and as the addition or subtraction in those cases is exact, we don't do any further rounding etc. and e.g. on the testcase below distilled from glibc compute a range [+0, +INF], which is fine for -fno-rounding-math or if we'd have a guarantee that those statements aren't executed with rounding towards negative infinity. I believe it is only +- which has this problematic behavior and I think it is best to deal with it in frange_arithmetic; if we know -frounding-math is on, it is x + (-x) or x - x and we are asked to round to negative infinity (i.e. want low bound rather than high bound), change +0 result to -0. 2023-07-26 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/110755 * range-op-float.cc (frange_arithmetic): Change +0 result to -0 for PLUS_EXPR or MINUS_EXPR if -frounding-math, inf is negative and it is exact op1 + (-op1) or op1 - op1. * gcc.dg/pr110755.c: New test.
-
Kewen Lin authored
PR110741 exposes one issue that we didn't use the correct character for vsx operands in output operand substitution, consequently it can map to the wrong registers which hold some unexpected values. PR target/110741 gcc/ChangeLog: * config/rs6000/vsx.md (define_insn xxeval): Correct vsx operands output with "x". gcc/testsuite/ChangeLog: * g++.target/powerpc/pr110741.C: New test.
-
Aldy Hernandez authored
gcc/ChangeLog: * range-op.cc (class operator_absu): Add update_bitmask. (operator_absu::update_bitmask): New.
-
Aldy Hernandez authored
gcc/ChangeLog: * range-op-mixed.h (class operator_abs): Add update_bitmask. * range-op.cc (operator_abs::update_bitmask): New.
-
Aldy Hernandez authored
gcc/ChangeLog: * range-op-mixed.h (class operator_bitwise_not): Add update_bitmask. * range-op.cc (operator_bitwise_not::update_bitmask): New.
-
Aldy Hernandez authored
It looks like we missed out on bitmasks for unary operators because we were using bit_value_binop exclusively. This patch hands off to bit_value_unop when appropriate, thus allowing us to handle ABS and BIT_NOT_EXPR, and others. Follow-up patches will add the tweaks for the range-ops entries themselves. gcc/ChangeLog: * range-op.cc (update_known_bitmask): Handle unary operators.
-
Aldy Hernandez authored
bit_value_binop initializes VAL regardless of the final mask. It even has a comment to that effect: /* Ensure that VAL is initialized (to any value). */ However, bit_value_unop, which in theory shares the same API, does not. This causes range-ops to choke on uninitialized VALs for some inputs to ABS. Instead of fixing the callers, it's cleaner to make bit_value_unop and bit_value_binop consistent. gcc/ChangeLog: * tree-ssa-ccp.cc (bit_value_unop): Initialize val when appropriate.
-
Jin Ma authored
The pattern mistakenly believes that fsflags can use immediate numbers, but in fact it does not support it. Immediate numbers should use fsflagsi. For example: __builtin_riscv_fsflags(4); The following error occurred. /tmp/ccoWdWqT.s: Assembler messages: /tmp/ccoWdWqT.s:14: Error: illegal operands `fsflags 4' gcc/ChangeLog: * config/riscv/riscv.md: Likewise. gcc/testsuite/ChangeLog: * gcc.target/riscv/fsflags.c: New test.
-
Jan Hubicka authored
gcc/ChangeLog: * profile-count.cc (profile_count::to_sreal_scale): Value is not know if we divide by zero.
-
Nathaniel Shead authored
This adds rudimentary lifetime tracking in C++ constexpr contexts, allowing the compiler to report errors with using values after their backing has gone out of scope. We don't yet handle other ways of accessing values outside their lifetime (e.g. following explicit destructor calls). PR c++/96630 PR c++/98675 PR c++/70331 gcc/cp/ChangeLog: * constexpr.cc (constexpr_global_ctx::is_outside_lifetime): New function. (constexpr_global_ctx::get_value): Don't return expired values. (constexpr_global_ctx::get_value_ptr): Likewise. (constexpr_global_ctx::remove_value): Mark value outside lifetime. (outside_lifetime_error): New function. (cxx_eval_call_expression): No longer track save_exprs. (cxx_eval_loop_expr): Likewise. (cxx_eval_constant_expression): Add checks for outside lifetime values. Remove local variables at end of bind exprs, and temporaries after cleanup points. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/constexpr-lifetime1.C: New test. * g++.dg/cpp1y/constexpr-lifetime2.C: New test. * g++.dg/cpp1y/constexpr-lifetime3.C: New test. * g++.dg/cpp1y/constexpr-lifetime4.C: New test. * g++.dg/cpp1y/constexpr-lifetime5.C: New test. * g++.dg/cpp1y/constexpr-lifetime6.C: New test. Signed-off-by:
Nathaniel Shead <nathanieloshead@gmail.com>
-
Nathaniel Shead authored
Currently, when typeck discovers that a return statement will refer to a local variable it rewrites to return a null pointer. This causes the error messages for using the return value in a constant expression to be unhelpful, especially for reference return values, and is also a visible change to otherwise valid code (as in the linked PR). The transformation is nonetheless important, however, both as a safety guard against attackers being able to gain a handle to other data on the stack, and to prevent duplicate warnings from later null-dereference warning passes. As such, this patch just delays the transformation until cp_genericize, after constexpr function definitions have been generated. PR c++/110619 gcc/cp/ChangeLog: * cp-gimplify.cc (cp_genericize_r): Transform RETURN_EXPRs to not return dangling pointers. * cp-tree.h (RETURN_EXPR_LOCAL_ADDR_P): New flag. (check_return_expr): Add a new parameter. * semantics.cc (finish_return_stmt): Set flag on RETURN_EXPR when referring to dangling pointer. * typeck.cc (check_return_expr): Disable transformation of dangling pointers, instead pass this information to caller. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/constexpr-110619.C: New test. Signed-off-by:
Nathaniel Shead <nathanieloshead@gmail.com>
-