- 12 Jul, 2020 2 commits
-
-
The following testcase ICEs, because during the cfg cleanup, we see: switch (i$e_11) <default: <L12> [33.33%], case -3: <lab2> [33.33%], case 0: <L10> [33.33%], case 2: <lab2> [33.33%]> ... lab2: __builtin_unreachable (); where lab2 is FORCED_LABEL. The way it works, we go through the case labels and when we reach the first one that points to gimple_seq_unreachable* basic block, we remove the edge (if any) from the switch bb to the bb containing the label and bbs reachable only through that edge we've just removed. Once we do that, we must throw away all other cases that use the same label (or some other labels from the same bb we've removed the edge to and the bb). To avoid quadratic behavior, this is not done by walking all remaining cases immediately before removing, but only when processing them later. For normal labels this works, fine, if the label is in a deleted bb, it will have NULL label_to_block and we handle that case, or, if the unreachable bb has some other edge to it, only the edge will be removed and not the bb, and again, find_edge will not find the edge and we only remove the case. And if a label would be to some other block, that other block wouldn't have been removed earlier because there would be still an edge from the switch block. Now, FORCED_LABEL (and I think DECL_NONLOCAL too) break this, because those labels aren't removed, but instead moved to some surrounding basic block. So, when we later process those, when their gimple_seq_unreachable* basic block is removed, label_to_block will return some unrelated block (in the testcase the switch bb), so we decide to keep the case which doesn't seem to be unreachable, but we don't really have an edge from the switch block to the block the label got moved to. I thought first about punting in gimple_seq_unreachable* on FORCED_LABEL/DECL_NONLOCAL labels, but that might penalize even code that doesn't care, so this instead just makes sure that for FORCED_LABEL/DECL_NONLOCAL labels that are being removed (and thus moved randomly) we remember in a hash_set the fact that those labels should be treated as removed for the purpose of the optimization, and later on handle those labels that way. 2020-07-02 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/95857 * tree-cfg.c (group_case_labels_stmt): When removing an unreachable base_bb, remember all forced and non-local labels on it and later treat those as if they have NULL label_to_block. Formatting fix. Fix a comment typo. * gcc.dg/pr95857.c: New test. (cherry picked from commit 00f24f56732861d09a9716fa5b6b8a96c2289143)
Jakub Jelinek committed -
GCC Administrator committed
-
- 11 Jul, 2020 1 commit
-
-
GCC Administrator committed
-
- 10 Jul, 2020 12 commits
-
-
gcc/ChangeLog: PR target/95581 * config/rs6000/rs6000-call.c: Add new type v16qi_ftype_pcvoid. (altivec_init_builtins) Change __builtin_altivec_mask_for_load to use v16qi_ftype_pcvoid with correct number of parameters. (cherry picked from commit c6b7ba5de624f2a17d799bac5ff017cd065ce035)
Bill Seurer committed -
This patch adds execution tests that use the MMA builtins and check for the right answer, and new tests that checks whether __builtin_cpu_supports and __builtin_cpu_is return sane answers for power10. 2020-06-30 Rajalakshmi Srinivasaraghavan <rajis@linux.vnet.ibm.com> Aaron Sawdey <acsawdey@linux.ibm.com> gcc/testsuite/ * gcc.target/powerpc/p10-identify.c: New file. * gcc.target/powerpc/p10-arch31.c: New file. * gcc.target/powerpc/mma-single-test.c: New file. * gcc.target/powerpc/mma-double-test.c: New file. (cherry picked from commit ed1d3639e42dccc9372f11c6231c3ffe0589fd1c)
Aaron Sawdey committed -
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/241999
Ian Lance Taylor committed -
Make the costs such that they do not exaclty reflect the actual instructions costs from the manual but make the codegen emit the code we want it to. gcc/ChangeLog: * config/aarch64/aarch64.c (thunderx2t99_regmove_cost, thunderx2t99_vector_cost): Likewise.
Anton Youdkevitch committed -
The code snippet for this test was returning 1 if power10 instructions executed correctly. It should return 0 if the test passes. 2020-07-07 Aaron Sawdey <acsawdey@linux.ibm.com> gcc/testsuite/ * lib/target-supports.exp (check_power10_hw_available): Return 0 for passing test. (cherry picked from commit 7126583af5d29235584b51b3b05eeaba2adef024)
Aaron Sawdey committed -
Built-in initialization occurs only once and fairly early, when the command line options are in force. If the -mcpu=<CPU> is pre-power10, then we fail to initialize the MMA built-ins, so they are not available to call in a #pragma target/attribute target function. The fix is to basically always (on server type cpus) initialize the MMA built-ins so we can use them in #pragma target/attribute target functions. 2020-07-09 Peter Bergner <bergner@linux.ibm.com> gcc/ PR target/96125 * config/rs6000/rs6000-call.c (rs6000_init_builtins): Define the MMA specific types __vector_quad and __vector_pair, and initialize the MMA built-ins if TARGET_EXTRA_BUILTINS is set. (mma_init_builtins): Don't test for mask set in rs6000_builtin_mask. Remove now unneeded mask variable. * config/rs6000/rs6000.c (rs6000_option_override_internal): Add the OPTION_MASK_MMA flag for power10 if not already set. gcc/testsuite/ PR target/96125 * gcc.target/powerpc/pr96125.c: New test. (cherry picked from commit fd263be4b523ff1b7f7dda49d856cc57221e8d21)
Peter Bergner committed -
gcc/ChangeLog: 2020-07-08 Will Schmidt <will_schmidt@vnet.ibm.com> * config/rs6000/altivec.h (vec_vmsumudm): New define. * config/rs6000/altivec.md (UNSPEC_VMSUMUDM): New unspec. (altivec_vmsumudm): New define_insn. * config/rs6000/rs6000-builtin.def (altivec_vmsumudm): New BU_ALTIVEC_3 entry. (vmsumudm): New BU_ALTIVEC_OVERLOAD_3 entry. * config/rs6000/rs6000-call.c (altivec_overloaded_builtins): Add entries for ALTIVEC_BUILTIN_VMSUMUDM variants of vec_msum. * doc/extend.texi: Add document for vmsumudm behind vmsum. gcc/testsuite/ChangeLog: 2020-07-08 Will Schmidt <will_schmidt@vnet.ibm.com> * gcc.target/powerpc/builtins-msum-runnable.c: New test. * gcc.target/powerpc/vsx-builtin-msum.c: New test. (cherry picked from commit c1a57681a64150d2fc336ba8e055c5f82e3737e8)
Will Schmidt committed -
We were wrongly checking is_empty_class on the result of strip_array_types rather than the actual field type. We weren't considering the alignment of the data member. We needed to handle unions the same way as layout_nonempty_base_or_field. gcc/cp/ChangeLog: PR c++/96105 PR c++/96052 PR c++/95976 * class.c (check_field_decls): An array of empty classes is not an empty data member. (layout_empty_base_or_field): Handle explicit alignment. Fix union handling. gcc/testsuite/ChangeLog: PR c++/96105 PR c++/96052 PR c++/95976 * g++.dg/cpp2a/no_unique_address4.C: New test. * g++.dg/cpp2a/no_unique_address5.C: New test. * g++.dg/cpp2a/no_unique_address6.C: New test.
Jason Merrill committed -
This fixes the case where we try to fold a read from an array initalizer and happen to cross the boundary of multiple CTORs which isn't really supported. For the interesting cases like the testcase we actually handle the folding by encoding the whole initializer. 2020-07-10 Richard Biener <rguenther@suse.de> PR tree-optimization/96133 * gimple-fold.c (fold_array_ctor_reference): Do not recurse to folding a CTOR that does not fully cover the asked for object. * gcc.dg/torture/pr96133.c: New testcase. (cherry picked from commit 6e41c27bf549d957eb399d39d7d0c213f8733351)
Richard Biener committed -
If reduction partition's SCC is broken by runtime alias checks, force a negative post order to it so that it will be scheduled in the last. 2020-07-09 Bin Cheng <bin.cheng@linux.alibaba.com> gcc/ PR tree-optimization/95804 * tree-loop-distribution.c (break_alias_scc_partitions): Force negative post order to reduction partition. gcc/testsuite/ PR tree-optimization/95804 * gcc.dg/tree-ssa/pr95804.c: New test. (cherry picked from commit dd21b03900085c4d60bf03207ad28bcbfbc86a4b)
Bin Cheng committed -
gcc/ PR tree-optimization/95638 * tree-loop-distribution.c (pg_edge_callback_data): New field. (loop_distribution::break_alias_scc_partitions): Record and restore postorder information. Fix memory leak. gcc/testsuite/ PR tree-optimization/95638 * g++.dg/tree-ssa/pr95638.C: New test. (cherry picked from commit 2c0069fafb53ccb7a45a6815025dfcbd2882a36e)
Bin Cheng committed -
GCC Administrator committed
-
- 09 Jul, 2020 12 commits
-
-
libstdc++-v3/ChangeLog: * include/bits/unique_ptr.h (operator<<): Define for C++20. * testsuite/20_util/unique_ptr/io/lwg2948.cc: New test. * testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error line number. * testsuite/20_util/default_delete/void_neg.cc: Likewise. (cherry picked from commit 187da2ce31f13b2f75d5bb780e30ee364ead9d1d)
Jonathan Wakely committed -
The bug report is that transform_view's sentinel<false> cannot be compared to its iterator<true>. The comparison is supposed to use operator==(iterator<Const>, sentinel<Const>) after converting sentinel<false> to sentinel<true>. However, the operator== is a hidden friend so is not a candidate when comparing iterator<true> with sentinel<false>. The required conversion would only happen if we'd found the operator, but we can't find the operator until after the conversion happens. A new LWG issue has been reported, but not yet assigned a number. The solution suggested by Casey Carter is to make the hidden friends of the sentinel types work with iterators of any const-ness, so that no conversions are required. Patrick Palka observed that join_view has a similar problem and a similar fix is used for its sentinel. PR libstdc++/95322 * include/std/ranges (transform_view::_Sentinel): Allow hidden friends to work with _Iterator<true> and _Iterator<false>. (join_view::_Sentinel): Likewise. * testsuite/std/ranges/adaptors/95322.cc: New test. (cherry picked from commit 6c2582c0406250c66e2eb3651f8e8638796b7f53)
Jonathan Wakely committed -
I implicitly assumed that programs using pmr::synchronized_pool_resource would also be using multiple threads, and so the weak symbols in gthr-posix.h would be resolved by linking to libpthread. If that isn't true then it crashes when trying to use pthread_key_create. This commit makes the pool resource check __gthread_active_p() before using thread-specific data, and just use a single set of memory pools when there's only a single thread. PR libstdc++/94936 * src/c++17/memory_resource.cc (synchronized_pool_resource::_TPools): Add comment about single-threaded behaviour. (synchronized_pool_resource::_TPools::move_nonempty_chunks()): Hoist class member access out of loop. (synchronized_pool_resource::synchronized_pool_resource()) (synchronized_pool_resource::~synchronized_pool_resource()) (synchronized_pool_resource::release()): Check __gthread_active_p before creating and/or deleting the thread-specific data key. (synchronized_pool_resource::_M_thread_specific_pools()): Adjust assertions. (synchronized_pool_resource::do_allocate(size_t, size_t)): Add fast path for single-threaded case. (synchronized_pool_resource::do_deallocate(void*, size_t, size_t)): Likewise. Return if unable to find a pool that owns the allocation. * testsuite/20_util/synchronized_pool_resource/allocate_single.cc: New test. * testsuite/20_util/synchronized_pool_resource/cons_single.cc: New test. * testsuite/20_util/synchronized_pool_resource/release_single.cc: New test. (cherry picked from commit ec40967f1323069da3a5a45286f71fa4f80926df)
Jonathan Wakely committed -
It's not difficult for multiple threads to drain the entropy available to the RDSEED instruction, at which point we throw an exception. This change will try to use RDRAND after RDSEED fails repeatedly, and only throw if RDRAND also fails repeatedly. This doesn't guarantee a random value can always be read, but reduces the likelihood of failure when using the RDSEED instruction. PR libstdc++/94087 * src/c++11/random.cc (__x86_rdseed): Allow fallback function to be passed in. (__x86_rdseed_rdrand): New function that uses rdseed with rdrand fallback. (random_device::_M_init): Use __x86_rdseed_rdrand when both instructions are available. * testsuite/26_numerics/random/random_device/94087.cc: New test. (cherry picked from commit a2d196e75cef95c2b70734ad02e94f9da0e769fe)
Jonathan Wakely committed -
- This optimization will adjust stack, but it not check/update other stack pointer use-site, the example is when the arguments put on stack, the offset become wrong after optimization. - However adjust stack frame usage after register allocation could be error prone, so we decide to turn off this optimization for such case. - Ye-Ting Kuo report this issue on github: https://github.com/riscv/riscv-gcc/pull/192 gcc/ChangeLog: * config/riscv/riscv-sr.c (riscv_remove_unneeded_save_restore_calls): Abort if any arguments on stack. gcc/testsuite/ChangeLog * gcc.target/riscv/save-restore-9.c: New. (cherry picked from commit 4c0d1322033ce979532425d336530b217f6b5fd3)
Kito Cheng committed -
- g++ will complain too few arguments for frflags builtin like bellow message: error: too few arguments to function 'unsigned int __builtin_riscv_frflags(void)' - However it's no arguments needed, it because we declare the function type with VOID arguments, that seems like require a VOID argument in the c++ front-end when GCC tried to resolve the function. gcc/ChangeLog * config/riscv/riscv-builtins.c (RISCV_FTYPE_NAME0): New. (RISCV_FTYPE_ATYPES0): New. (riscv_builtins): Using RISCV_USI_FTYPE for frflags. * config/riscv/riscv-ftypes.def: Remove VOID argument. gcc/testsuite/ChangeLog * g++.target/riscv/frflags.C: New. (cherry picked from commit 33d9794b7277a64543914bfbbfd567505e72da6c)
Kito Cheng committed -
- riscv_gpr_save_operation_p might try to match parallel on other patterns like inline asm pattern, and then it might trigger ther assertion checking there, so we could trun it into a early exit check. gcc/ChangeLog: PR target/95683 * config/riscv/riscv.c (riscv_gpr_save_operation_p): Remove assertion and turn it into a early exit check. gcc/testsuite/ChangeLog PR target/95683 * gcc.target/riscv/pr95683.c: New. (cherry picked from commit beaf12b49ae030505194cdcac18b5c8533a43921)
Kito Cheng committed -
gcc/ChangeLog: * config/riscv/riscv.c (riscv_gen_gpr_save_insn): Change type to unsigned for i. (riscv_gpr_save_operation_p): Change type to unsigned for i and len. (cherry picked from commit 82a3008e56c620008b4575a97e459e2769df54db)
Kito Cheng committed -
gcc/ChangeLog: * config/riscv/riscv-protos.h (riscv_output_gpr_save): Remove. * config/riscv/riscv-sr.c (riscv_sr_match_prologue): Update value. * config/riscv/riscv.c (riscv_output_gpr_save): Remove. * config/riscv/riscv.md (gpr_save): Update output asm pattern. (cherry picked from commit dcf41a4e6033213f5e5f80da23080df961d83996)
Kito Cheng committed -
- Verified on rv32emc/rv32gc/rv64gc bare-metal target and rv32gc/rv64gc linux target with qemu. gcc/ChangeLog: * config/riscv/predicates.md (gpr_save_operation): New. * config/riscv/riscv-protos.h (riscv_gen_gpr_save_insn): New. (riscv_gpr_save_operation_p): Ditto. * config/riscv/riscv-sr.c (riscv_remove_unneeded_save_restore_calls): Ignore USEs for gpr_save patter. * config/riscv/riscv.c (gpr_save_reg_order): New. (riscv_expand_prologue): Use riscv_gen_gpr_save_insn to gen gpr_save. (riscv_gen_gpr_save_insn): New. (riscv_gpr_save_operation_p): Ditto. * config/riscv/riscv.md (S3_REGNUM): New. (S4_REGNUM): Ditto. (S5_REGNUM): Ditto. (S6_REGNUM): Ditto. (S7_REGNUM): Ditto. (S8_REGNUM): Ditto. (S9_REGNUM): Ditto. (S10_REGNUM): Ditto. (S11_REGNUM): Ditto. (gpr_save): Model USEs correctly. gcc/testsuite/ChangeLog: * gcc.target/riscv/pr95252.c: New. (cherry picked from commit d0e0c1300f9f08608873df5571e14a61308dd0c0)
Kito Cheng committed -
default_unique_section uses ".sdata2" as a prefix for SECCAT_SRODATA unique sections, but RISC-V uses ".srodata" instead. Override the TARGET_ASM_UNIQUE_SECTION function to catch this case, allowing the default to be used for all other sections. Signed-off-by: Keith Packard <keithp@keithp.com> gcc/ * config/riscv/riscv.c (riscv_unique_section): New. (TARGET_ASM_UNIQUE_SECTION): New. (cherry picked from commit adce62f53d8ad00e8110a6a2de7962d7a850de16)
Keith Packard committed -
GCC Administrator committed
-
- 08 Jul, 2020 6 commits
-
-
The legacy "assigned GOTO" accepts only scalar integer variables. Check for proper arguments. gcc/fortran/ PR fortran/95709 * resolve.c (gfc_resolve_code): Check for valid arguments to assigned GOTO. (cherry picked from commit 824084e72e388f81015e7f67922c75f50741355a)
Harald Anlauf committed -
* sv.po: Update.
Joseph Myers committed -
Only '(' and ':' currently terminate file lists in ChangeLog entries in the ChangeLog parser. This rules out such legitimate entries as: * filename <CASE>: * filename [COND]: This patch extends the ChangeLog parser to recognize these forms. for contrib/ChangeLog * gcc-changelog/git_commit.py: Support CASE and COND. * gcc-changelog/test_patches.txt: Add test. * gcc-changelog/test_email.py: Add test. Co-Authored-By: Martin Liska <mliska@suse.cz> (cherry picked from commit a759bfc7cf238b9fc5bf97884297fc69d8cdf2b5)
Alexandre Oliva committed -
Compiling this testcase with -march=armv8.2-a+sve -msve-vector-bits=512: ---------------------------------------------------------- typedef __SVFloat32_t foo; typedef foo bar __attribute__((arm_sve_vector_bits(512))); template<typename T> struct s { T x; }; extern s<bar> a; bar &b = a.x; ---------------------------------------------------------- gave the bogus error: cannot bind non-const lvalue reference of type ‘bar&’ to an rvalue of type ‘bar’ The testcase works if the attribute is applied directly to __SVFloat32_t instead of via foo. This shows a more general problem with the way that we were handling the arm_sve_vector_bits attribute: we started by building a distinct copy of the type to which the attribute was applied, instead of starting with its main variant. This new type then became its own main variant, meaning that the relationship between types that have the attribute could be different from the relationship between types that don't have the attribute. This patch instead copies the main variant of the original type and then reapplies all the differences. gcc/ PR target/95105 * config/aarch64/aarch64-sve-builtins.cc (handle_arm_sve_vector_bits_attribute): Create a copy of the original type's TYPE_MAIN_VARIANT, then reapply all the differences between the original type and its main variant. gcc/testsuite/ PR target/95105 * gcc.target/aarch64/sve/acle/general/attributes_8.c: New test. * g++.target/aarch64/sve/acle/general-c++/attributes_1.C: Likewise.
Richard Sandiford committed -
On AIX, the compiler supports DWARF 5 but the linker does not. 2020-07-07 Clement Chigot <clement.chigot@atos.net> * configure.ac: Test linker support for DWARF5 * configure: Regenerate
Ian Lance Taylor committed -
GCC Administrator committed
-
- 07 Jul, 2020 3 commits
-
-
This fixes bogus misalignment calculation for negative steps since an assertion a previous comment indicated no longer holds: /* DR_STEP(dr) is the same as -TYPE_SIZE of the scalar type, otherwise we wouldn't be here. */ Thus the following replaces DR_STEP by -TYPE_SIZE. 2020-07-06 Richard Biener <rguenther@suse.de> PR tree-optimization/96075 * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Use TYPE_SIZE_UNIT of the vector component type instead of DR_STEP for the misalignment calculation for negative step. * gcc.dg/vect/slp-46.c: New testcase. (cherry picked from commit dccbf1e2a6e544f71b4a5795f0c79015db019fc3)
Richard Biener committed -
This fixes the sorting of to copy symbols in lto_output introduced with GCC 10 to not depend on the actual values of the randomness we append to LTO section names but instead on the order they appear in the unsorted array. This fixed observed debug info differences due to tree merging prevailing different early debug pointers. 2020-07-06 Richard Biener <rguenther@suse.de> * lto-streamer-out.c (cmp_symbol_files): Use the computed order map to sort symbols from the same sub-file together. (lto_output): Compute a map of sub-file to an order number it appears in the symbol output array. (cherry picked from commit c50502ca4ebb4d4bd2df9edf1eb5c53aacfa0a1e)
Richard Biener committed -
GCC Administrator committed
-
- 06 Jul, 2020 3 commits
-
-
[PATCH, PR target/94954] Fix wrong codegen for vec_pack_to_short_fp32() builtin Hi, Fix codegen for builtin vec_pack_to_short_fp32. This includes adding a define_insn for xvcvsphp, and adding a new define_expand for convert_4f32_8f16. [v2] Comment on altivec.md "convert_4f32_8f16" enhanced. Testsuite builtins-1-p9-runnable.c updated. OK for trunk and backports? Thanks -Will PR target/94954 gcc/Changelog: * config/rs6000/altivec.h (vec_pack_to_short_fp32): Update. * config/rs6000/altivec.md (UNSPEC_CONVERT_4F32_8F16): New unspec. (convert_4f32_8f16): New define_expand * config/rs6000/rs6000-builtin.def (convert_4f32_8f16): New builtin define and overload. * config/rs6000/rs6000-call.c (P9V_BUILTIN_VEC_CONVERT_4F32_8F16): New overloaded builtin entry. * config/rs6000/vsx.md (UNSPEC_VSX_XVCVSPHP): New unspec. (vsx_xvcvsphp): New define_insn. gcc/testsuite/ChangeLog: * gcc.target/powerpc/builtins-1-p9-runnable.c: Update.
Will Schmidt committed -
When declaring a polymorphic variable that is not a dummy, allocatable or pointer, an ICE occurred due to a NULL pointer dereference. Check for that situation and punt. gcc/fortran/ PR fortran/93337 * class.c (gfc_find_derived_vtab): Punt if name is not set. (cherry picked from commit d9fb6f2b4f1321b059807ff6073156f07d9d376b)
Harald Anlauf committed -
GCC Administrator committed
-
- 05 Jul, 2020 1 commit
-
-
This regression came about because of a change in the way types are displayed in error messages. The character representation is also used to calculate the hashes for our types, so this patch restores the old behavior if we are indeed calculating a hash. The test case also checks for the specific hash value because changing that would be an ABI change, which we should not be doing unintentionally. gcc/fortran/ChangeLog: 2020-06-30 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/95366 * gfortran.h (gfc_typename): Add optional argument for_hash. * misc.c (gfc_typename): When for_hash is true, just retur CHARACTER(kind). * class.c (gfc_intrinsic_hash_value): Call gfc_typename with for_hash = true. (cherry picked from commit 5958b926dcc3332aec0a2e34653c4394d2613401)
Thomas Koenig committed
-