- 06 Apr, 2021 1 commit
-
-
Fixes use-after-free bugs exposed by new glibc version.
Jim Wilson committed
-
- 06 Nov, 2020 7 commits
-
-
gcc/ChangeLog: * common/config/riscv/riscv-common.c (riscv_subset_list::parse_multiletter_ext): Checking multiletter extension has more than 1 letter. gcc/testsuite/ChangeLog * gcc.target/riscv/arch-7.c: New. * gcc.target/riscv/attribute-10.c: Update test arch string.
Kito Cheng committed -
- Able to configure complex multi-lib rule in configure time, without modify any in-tree source. - I was consider to implmenet this into `--with-multilib-list` option, but I am not sure who will using that with riscv*-*-elf*, so I decide to using another option name for that. - --with-multilib-generator will pass arguments to multilib-generator, and then using the generated multi-lib config file to build the toolchain. e.g. Build riscv gcc, default arch/abi is rv64gc/lp64, and build multilib for rv32imafd/ilp32 and rv32i/ilp32; rv32ic/ilp32 will reuse rv32i/ilp32. $ <GCC-SRC>/configure \ --target=riscv64-elf \ --with-arch=rv64gc --with-abi=lp64 \ --with-multilib-generator=rv32i-ilp32--c;rv32imafd-ilp32-- V3 Changes: - Rename --with-multilib-config to --with-multilib-generator - Check --with-multilib-generator and --with-multilib-list can't be used at same time. V2 Changes: - Fix --with-multilib-config hanling on non riscv*-*-elf* triple. gcc/ChangeLog: * config.gcc (riscv*-*-*): Handle --with-multilib-generator. * configure: Regen. * configure.ac: Add --with-multilib-generator. * config/riscv/multilib-generator: Exit when parsing arch string error. * config/riscv/t-withmultilib-generator: New. * doc/install.texi: Document --with-multilib-generator.
Kito Cheng committed -
- Generalize logic for translating arch to internal flags, this patch is infrastructure for supporing sub-extension parsing. gcc/ChangeLog * common/config/riscv/riscv-common.c (opt_var_ref_t): New. (riscv_ext_flag_table_t): New. (riscv_ext_flag_table): New. (riscv_parse_arch_string): Pass gcc_options* instead of &opts->x_target_flags only, and using riscv_arch_option_table to setup flags. (riscv_handle_option): Update argument for riscv_parse_arch_string. (riscv_expand_arch): Ditto. (riscv_expand_arch_from_cpu): Ditto.
Kito Cheng committed -
- Support expansion operator (*) in the multilib config string. - Motivation of this patch is reduce the complexity when we deal multilib with sub-extension, expand the combinations by hand would be very painful and error prone, no one deserve to experience this[1] again! [1] https://github.com/sifive/freedom-tools/blob/f4d7facafb27d16125768c90ff1790c674e4be7a/Makefile#L348 gcc/ChangeLog: * config/riscv/multilib-generator: Add TODO, import itertools and functools.reduce. Handle expantion operator. (LONG_EXT_PREFIXES): New. (arch_canonicalize): Update comment and improve python3 debuggability/compatibility. (add_underline_prefix): New. (_expand_combination): Ditto. (unique): Ditto. (expand_combination): Ditto.
Kito Cheng committed -
- -march has handle implied extension for a while, so I think multilib-generator should handle this well too. - Currently only add rule for D imply F. gcc/ChangeLog: * config/riscv/multilib-generator (IMPLIED_EXT): New. (arch_canonicalize): Update comment and handle implied extensions.
Kito Cheng committed -
- The behavior of -mcpu basically equal to -march plus -mtune, but it has lower priority than -march and -mtune. - The behavior and available options has sync with clang except we don't add few LLVM specific value, and add more sifive processor to the list. - -mtune also accept all available options of -mcpu, and use it setting. gcc/ChangeLog: * common/config/riscv/riscv-common.c (riscv_cpu_tables): New. (riscv_arch_str): Return empty string if current_subset_list is NULL. (riscv_find_cpu): New. (riscv_handle_option): Verify option value of -mcpu. (riscv_expand_arch): Using std::string. (riscv_default_mtune): New. (riscv_expand_arch_from_cpu): Ditto. * config/riscv/riscv-cores.def: New. * config/riscv/riscv-protos.h (riscv_find_cpu): New. (riscv_cpu_info): New. * config/riscv/riscv.c (riscv_tune_info): Rename ... (riscv_tune_param): ... to this. (riscv_cpu_info): Rename ... (riscv_tune_info): ... to this. (tune_info): Rename ... (tune_param): ... to this. (rocket_tune_info): Update data type name. (sifive_7_tune_info): Ditto. (optimize_size_tune_info): Ditto. (riscv_cpu_info_table): Rename ... (riscv_tune_info_table): ... to this. (riscv_parse_cpu): Rename ... (riscv_parse_tune): ... to this, and translate valid -mcpu option to -mtune option. (riscv_rtx_costs): Rename tune_info to tune_param. (riscv_class_max_nregs): Ditto. (riscv_memory_move_cost): Ditto. (riscv_init_machine_status): Use value of -mcpu if -mtune is not given, and rename tune_info to tune_param. * config/riscv/riscv.h (riscv_expand_arch_from_cpu): New. (riscv_default_mtune): Ditto. (EXTRA_SPEC_FUNCTIONS): Add riscv_expand_arch_from_cpu and riscv_default_mtune. (OPTION_DEFAULT_SPECS): Handle default value of -march/-mabi. (DRIVER_SELF_SPECS): Expand -march from -mcpu if -march is not given. * config/riscv/riscv.opt (-mcpu): New option. * config/riscv/t-riscv ($(common_out_file)): Add riscv-cores.def to dependency. * doc/invoke.texi (RISC-V Option): Add -mcpu, and update the description of default value for -mtune and -march. gcc/testsuite/ChangeLog: * gcc.target/riscv/mcpu-1.c: New. * gcc.target/riscv/mcpu-2.c: Ditto. * gcc.target/riscv/mcpu-3.c: Ditto. * gcc.target/riscv/mcpu-4.c: Ditto. * gcc.target/riscv/mcpu-5.c: Ditto. * gcc.target/riscv/mcpu-6.c: Ditto. * gcc.target/riscv/mcpu-7.c: Ditto.
Kito Cheng committed -
- According the conclusion in RISC-V C API document, we decide to deprecat the __riscv_cmodel_pic marco - __riscv_cmodel_pic is deprecated and will removed in next GCC release. [1] https://github.com/riscv/riscv-c-api-doc/pull/11 gcc/ChangeLog: * config/riscv/riscv-c.c (riscv_cpu_cpp_builtins): Define __riscv_cmodel_medany when PIC mode. gcc/testsuite/ChangeLog: * gcc.target/riscv/predef-3.c: Update testcase. * gcc.target/riscv/predef-6.c: Ditto.
Kito Cheng committed
-
- 05 Oct, 2020 1 commit
-
-
Extends the configure check for zstd.h to also verify the zstd version, since gcc requires features that only exist in 1.3.0 and newer. Without this patch we get a build error for lto-compress.c when using an old zstd version. Backported from master: 2020-09-29 Jim Wilson <jimw@sifive.com> gcc/ PR bootstrap/97183 * configure.ac (gcc_cv_header_zstd_h): Check ZSTD_VERISON_NUMBER. * configure: Regenerated.
Jim Wilson committed
-
- 23 Sep, 2020 2 commits
-
-
gcc/ChangeLog: * config/riscv/riscv.h (CSW_MAX_OFFSET): Fix typo. gcc/testsuite/ChangeLog: * gcc.target/riscv/shorten-memrefs-8.c: New test.
Yeting Kuo committed -
gfortran produces associates a different line number for the same error message depending on x86 versus other architectures. This patch adjusts the dg-error line number depending on the target. gcc/testsuite/ChangeLog 2020-07-01 David Edelsohn <dje.gcc@gmail.com> * gfortran.dg/pr95690.f90: Adjust dg-error line number.
David Edelsohn committed
-
- 23 Jul, 2020 12 commits
-
-
- The order of multi-lib config could be wrong if multi-ltter are used, e.g. `./multilib-generator rv32izfh-ilp32--c`, would expect rv32ic_zfh/ilp32 reuse rv32i_zfh/ilp32, however the multi-ltter is not handled correctly, it will generate reuse rule for rv32izfhc/ilp32 which is invalid arch configuration. - Remove re-use rule gen for g/imafd, because we canonicalize the -march at gcc driver too, so we don't need handle 'g' for multilib now. gcc/ChangeLog: * config/riscv/multilib-generator (arch_canonicalize): Handle multi-letter extension. Using underline as separator between different extensions.
Kito Cheng committed -
- Arch version should preserved if user explicitly specified the version. e.g. After normalize, -march=rv32if3d should be -march=rv32i_f3p0d instead of-march=rv32ifd. gcc/ChangeLog: * common/config/riscv/riscv-common.c (riscv_subset_t): New field added. (riscv_subset_list::parsing_subset_version): Add parameter for indicate explicitly version, and handle explicitly version. (riscv_subset_list::handle_implied_ext): Ditto. (riscv_subset_list::add): Ditto. (riscv_subset_t::riscv_subset_t): Init new field. (riscv_subset_list::to_string): Always output version info if version explicitly specified. (riscv_subset_list::parsing_subset_version): Handle explicitly arch version. (riscv_subset_list::parse_std_ext): Ditto. (riscv_subset_list::parse_multiletter_ext): Ditto. gcc/testsuite/ChangeLog: * gcc.target/riscv/attribute-13.c: New.
Kito Cheng committed -
- Normalize arch string would help the multi-lib handling, e.g. rv64gc and rv64g_c are both valid and same arch, but latter one would confuse the detection of multi-lib, earlier normalize can resolve this issue. gcc/ChangeLog: * config/riscv/riscv.h (ASM_SPEC): Remove riscv_expand_arch call. (DRIVER_SELF_SPECS): New.
Kito Cheng committed -
The ISA manual specifies that divide by zero always returns -1 as the result. We were failing to do that when the dividend was negative. Original patch from Virginie Moser. libgcc/ * config/riscv/div.S (__divdi3): For negative arguments, change bgez to bgtz.
Jim Wilson committed -
This is potentially a sequence of 3 shifts, we which optimize to a sequence of 2 shifts. This can happen when unsigned int is used for array indexing. gcc/ * config/riscv/riscv.md (zero_extendsidi2_shifted): New. gcc/testsuite/ * gcc.target/riscv/zero-extend-5.c: New.
Jim Wilson committed -
- The alignment for local variable was adjust during estimate_stack_frame_size, however it seems wrong spot to adjust that, expand phase will adjust that but it little too late to some gimple optimization, which rely on certain target hooks need to check alignment, forwprop is an example for that, result of simplify_builtin_call rely on the alignment on some target like ARM or RISC-V. - Exclude static local var and hard register var in the process of alignment adjustment. - This patch fix gfortran.dg/pr45636.f90 for arm and riscv. - Regression test on riscv32/riscv64 and x86_64-linux-gnu, no new fail introduced. gcc/ChangeLog PR target/90811 * Makefile.in (OBJS): Add adjust-alignment.o. * adjust-alignment.c (pass_data_adjust_alignment): New. (pass_adjust_alignment): New. (pass_adjust_alignment::execute): New. (make_pass_adjust_alignment): New. * tree-pass.h (make_pass_adjust_alignment): New. * passes.def: Add pass_adjust_alignment.
Kito Cheng committed -
- Implied rule are introduced into latest RISC-V ISA spec. - Only implemented D implied F-extension. Zicsr and Zifence are not implement yet, so the rule not included in this patch. - Pass preprocessed arch string to arch. - Verified with binutils 2.30 and 2.34. gcc/ChangeLog * common/config/riscv/riscv-common.c (riscv_implied_info_t): New. (riscv_implied_info): New. (riscv_subset_list): Add handle_implied_ext. (riscv_subset_list::to_string): New parameter version_p to control output format. (riscv_subset_list::handle_implied_ext): New. (riscv_subset_list::parse_std_ext): Call handle_implied_ext. (riscv_arch_str): New parameter version_p to control output format. (riscv_expand_arch): New. * config/riscv/riscv-protos.h (riscv_arch_str): New parameter, version_p. * config/riscv/riscv.h (riscv_expand_arch): New, (EXTRA_SPEC_FUNCTIONS): Define. (ASM_SPEC): Transform -march= via riscv_expand_arch. gcc/testsuite/ChangeLog * gcc.target/riscv/arch-6.c: New. * gcc.target/riscv/attribute-11.c: New. * gcc.target/riscv/attribute-12.c: New.
Kito Cheng committed -
- The arch string rule has changed in latest spec, it introduced new multi-letter extension prefix with 'h' and 'z', and drop `sx`. also adjust parsing order for 's' and 'x'. gcc/ChangeLog * riscv-common.c (parse_sv_or_non_std_ext): Rename to parse_multiletter_ext. (parse_multiletter_ext): Add parsing `h` and `z`, drop `sx`, adjust parsing order for 's' and 'x'. gcc/testsuite/ChangeLog * gcc.target/riscv/arch-3.c: Adjust option. * gcc.target/riscv/arch-5.c: New. * gcc.target/riscv/attribute-9.c: Adjust option and test condition.
Kito Cheng committed -
gcc/ * config.gcc: Add riscv-shorten-memrefs.o to extra_objs for riscv. * config/riscv/riscv-passes.def: New file. * config/riscv/riscv-protos.h (make_pass_shorten_memrefs): Declare. * config/riscv/riscv-shorten-memrefs.c: New file. * config/riscv/riscv.c (tree-pass.h): New include. (riscv_compressed_reg_p): New Function (riscv_compressed_lw_offset_p): Likewise. (riscv_compressed_lw_address_p): Likewise. (riscv_shorten_lw_offset): Likewise. (riscv_legitimize_address): Attempt to convert base + large_offset to compressible new_base + small_offset. (riscv_address_cost): Make anticipated compressed load/stores cheaper for code size than uncompressed load/stores. (riscv_register_priority): Move compressed register check to riscv_compressed_reg_p. * config/riscv/riscv.h (C_S_BITS): Define. (CSW_MAX_OFFSET): Define. * config/riscv/riscv.opt (mshorten-memefs): New option. * config/riscv/t-riscv (riscv-shorten-memrefs.o): New rule. (PASSES_EXTRA): Add riscv-passes.def. * doc/invoke.texi: Document -mshorten-memrefs. * config/riscv/riscv.c (riscv_new_address_profitable_p): New function. (TARGET_NEW_ADDRESS_PROFITABLE_P): Define. * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_NEW_ADDRESS_PROFITABLE_P): New hook. * sched-deps.c (attempt_change): Use old address if it is cheaper than new address. * target.def (new_address_profitable_p): New hook. * targhooks.c (default_new_address_profitable_p): New function. * targhooks.h (default_new_address_profitable_p): Declare. gcc/testsuite/ * gcc.target/riscv/shorten-memrefs-1.c: New test. * gcc.target/riscv/shorten-memrefs-2.c: New test. * gcc.target/riscv/shorten-memrefs-3.c: New test. * gcc.target/riscv/shorten-memrefs-4.c: New test. * gcc.target/riscv/shorten-memrefs-5.c: New test. * gcc.target/riscv/shorten-memrefs-6.c: New test. * gcc.target/riscv/shorten-memrefs-7.c: New test.
Craig Blackmore committed -
Kito Cheng committed
-
Richard Biener committed
-
GCC Administrator committed
-
- 22 Jul, 2020 1 commit
-
-
GCC Administrator committed
-
- 21 Jul, 2020 2 commits
-
-
2020-07-21 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: * config/i386/i386.h (TARGET_AVOID_MFENCE): Rename from TARGET_USE_XCHG_FOR_ATOMIC_STORE. * config/i386/sync.md (atomic_store<mode>): Update for rename. * config/i386/x86-tune.def (X86_TUNE_AVOID_MFENCE): Rename from X86_TUNE_USE_XCHG_FOR_ATOMIC_STORE.
Uros Bizjak committed -
GCC Administrator committed
-
- 20 Jul, 2020 2 commits
-
-
* gcc.pot: Regenerate.
Joseph Myers committed -
GCC Administrator committed
-
- 19 Jul, 2020 1 commit
-
-
GCC Administrator committed
-
- 18 Jul, 2020 1 commit
-
-
GCC Administrator committed
-
- 17 Jul, 2020 2 commits
-
-
gcc/ * Makefile.in (SELFTEST_DEPS): Move before including language makefile fragments. (cherry picked from commit b19d8aac15649f31a7588b2634411a1922906ea8)
Romain Naour committed -
GCC Administrator committed
-
- 16 Jul, 2020 2 commits
-
-
Squashed with commit f842bdd7a97e9fef7513a266d641cac72d5f97cc gcc/ChangeLog: * config.in: Regenerate. * config/s390/s390.c (print_operand): Emit vector alignment hints for target z13, if AS accepts them. For other targets the logic stays the same. * config/s390/s390.h (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS): Define macro. * configure: Regenerate. * configure.ac: Check HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13. gcc/testsuite/ChangeLog: * gcc.target/s390/vector/align-1.c: Change target architecture to z13. * gcc.target/s390/vector/align-2.c: Change target architecture to z13. (cherry picked from commit 929fd91ba975eebf9e57f7f092041271dcaf0c34)
Stefan Schulze Frielinghaus committed -
GCC Administrator committed
-
- 15 Jul, 2020 4 commits
-
-
This is a release branch version of r11-1741-g:31427b974ed7b7dd54e28fec595e731bf6eea8ba and r11-2022-g:efe99cca78215e339ba79f0a900a896b4c0a3d36. The trunk versions of the patch made GNU and Advanced SIMD vectors distinct (but inter-convertible) in all cases. However, the traditional behaviour is that the types are distinct in template arguments but not otherwise. Following a suggestion from Jason, this patch puts the check for different vector types under comparing_specializations. In order to keep the backport as simple as possible, the patch hard-codes the name of the attribute in the frontend rather than adding a new branch-only target hook. I didn't find a test that tripped the assert on the branch, even with the --param in the PR, so instead I tested this by forcing the hash function to only hash the tree code. That made the static assertion in the test fail without the patch but pass with it. This means that the tests pass for unmodified sources even without the patch (unless you're very unlucky). gcc/ PR target/95726 * config/aarch64/aarch64.c (aarch64_attribute_table): Add "Advanced SIMD type". * config/aarch64/aarch64-builtins.c: Include stringpool.h and attribs.h. (aarch64_init_simd_builtin_types): Add an "Advanced SIMD type" attribute to each Advanced SIMD type. * config/arm/arm.c (arm_attribute_table): Add "Advanced SIMD type". * config/arm/arm-builtins.c: Include stringpool.h and attribs.h. (arm_init_simd_builtin_types): Add an "Advanced SIMD type" attribute to each Advanced SIMD type. gcc/cp/ PR target/95726 * typeck.c (structural_comptypes): When comparing template specializations, differentiate between vectors that have and do not have an "Advanced SIMD type" attribute. gcc/testsuite/ PR target/95726 * g++.target/aarch64/pr95726.C: New test. * g++.target/arm/pr95726.C: Likewise.
Richard Sandiford committed -
The _mm512_{,mask_}cmp_p[ds]_mask and also _mm_{,mask_}cmp_s[ds]_mask intrinsics have an argument which must have a constant passed to it and so use an inline version only for ifdef __OPTIMIZE__ and have a #define for -O0. But the _mm512_{,mask_}cmp*_p[ds]_mask intrinsics don't need a constant argument, they are essentially the first set with the constant added to them implicitly based on the comparison name, and so there is no #define version for them (correctly). But their inline versions are defined in between the first and s[ds] set and so inside of ifdef __OPTIMIZE__, which means that with -O0 they aren't defined at all. This patch fixes that by moving those after the #ifdef __OPTIMIZE #else use #define #endif block. 2020-07-15 Jakub Jelinek <jakub@redhat.com> PR target/96174 * config/i386/avx512fintrin.h (_mm512_cmpeq_pd_mask, _mm512_mask_cmpeq_pd_mask, _mm512_cmplt_pd_mask, _mm512_mask_cmplt_pd_mask, _mm512_cmple_pd_mask, _mm512_mask_cmple_pd_mask, _mm512_cmpunord_pd_mask, _mm512_mask_cmpunord_pd_mask, _mm512_cmpneq_pd_mask, _mm512_mask_cmpneq_pd_mask, _mm512_cmpnlt_pd_mask, _mm512_mask_cmpnlt_pd_mask, _mm512_cmpnle_pd_mask, _mm512_mask_cmpnle_pd_mask, _mm512_cmpord_pd_mask, _mm512_mask_cmpord_pd_mask, _mm512_cmpeq_ps_mask, _mm512_mask_cmpeq_ps_mask, _mm512_cmplt_ps_mask, _mm512_mask_cmplt_ps_mask, _mm512_cmple_ps_mask, _mm512_mask_cmple_ps_mask, _mm512_cmpunord_ps_mask, _mm512_mask_cmpunord_ps_mask, _mm512_cmpneq_ps_mask, _mm512_mask_cmpneq_ps_mask, _mm512_cmpnlt_ps_mask, _mm512_mask_cmpnlt_ps_mask, _mm512_cmpnle_ps_mask, _mm512_mask_cmpnle_ps_mask, _mm512_cmpord_ps_mask, _mm512_mask_cmpord_ps_mask): Move outside of __OPTIMIZE__ guarded section. * gcc.target/i386/avx512f-vcmppd-3.c: New test. * gcc.target/i386/avx512f-vcmpps-3.c: New test. (cherry picked from commit 12d69dbfff9dd5ad4a30b20d1636f5cab6425e8c)
Jakub Jelinek committed -
This reverts commit 8147c741. 2020-07-15 Richard Biener <rguenther@suse.de> PR bootstrap/96203 * lto-opts.c: Revert changes. * lto-wrapper.c: Likewise.
Richard Biener committed -
GCC Administrator committed
-
- 14 Jul, 2020 2 commits
-
-
convert_like issues errors about bad_p conversions at the beginning of the function, but in the ck_ref_bind case, it only issues them after we've called convert_like on the next conversion. This doesn't work as expected since r10-7096 because when we see a conversion from/to class type in a template, we return early, thereby missing the error, and a bad_p conversion goes by undetected. That made the attached test to compile even though it should not. I had thought that I could just move the ck_ref_bind/bad_p errors above to the rest of them, but that regressed diagnostics because expr then wasn't converted yet by the nested convert_like_real call. So, for bad_p conversions, do the normal processing, but still return the IMPLICIT_CONV_EXPR to avoid introducing trees that the template processing can't handle well. This I achieved by adding a wrapper function. gcc/cp/ChangeLog: PR c++/95789 PR c++/96104 PR c++/96179 * call.c (convert_like_real_1): Renamed from convert_like_real. (convert_like_real): New wrapper for convert_like_real_1. gcc/testsuite/ChangeLog: PR c++/95789 PR c++/96104 PR c++/96179 * g++.dg/conversion/ref4.C: New test. * g++.dg/conversion/ref5.C: New test. * g++.dg/conversion/ref6.C: New test. (cherry picked from commit 8e64d182850560dbedfabb88aac90d4fc6155067)
Marek Polacek committed -
The version of nvprof in CUDA 9.0 causes a hang when used to profile an OpenACC program. This is because it calls acc_get_device_type from a callback called during device initialization, which then attempts to acquire acc_device_lock while it is already taken, resulting in deadlock. This works around the issue by returning acc_device_none from acc_get_device_type without attempting to acquire the lock when initialization has not completed yet. 2020-07-14 Tom de Vries <tom@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com> Thomas Schwinge <thomas@codesourcery.com> Kwok Cheung Yeung <kcy@codesourcery.com> libgomp/ * oacc-init.c (acc_init_state_lock, acc_init_state, acc_init_thread): New variable. (acc_init_1): Set acc_init_thread to pthread_self (). Set acc_init_state to initializing at the start, and to initialized at the end. (self_initializing_p): New function. (acc_get_device_type): Return acc_device_none if called by thread that is currently executing acc_init_1. * libgomp.texi (acc_get_device_type): Update documentation. (Implementation Status and Implementation-Defined Behavior): Likewise. * testsuite/libgomp.oacc-c-c++-common/acc_prof-init-2.c: New. (cherry picked from commit b52643ab9004ba8ecea06a399885fe1e04183eda)
Kwok Cheung Yeung committed
-