aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-08-17Fix up flag_cunroll_grow_size handling in presence of optimize attr [PR96535]Jakub Jelinek4-33/+49
As the testcase in the PR shows (not included in the patch, as it seems quite fragile to observe unrolling in the IL), the introduction of flag_cunroll_grow_size broke optimize attribute related to loop unrolling. The problem is that the new option flag is set (if not set explicitly) only in process_options and in rs6000_option_override_internal (and there only if global_init_p). So, this means that while it is Optimization option, it will only be set based on the command line -funroll-loops/-O3/-fpeel-loops or -funroll-all-loops, which means that if command line does include any of those, it is enabled even for functions that will through optimize attribute have all of those disabled, and if command line does not include those, it will not be enabled for functions that will through optimize attribute have any of those enabled. process_options is called just once, so IMHO it should be handling only non-Optimization option adjustments (various other options suffer from that too, but as this is a regression from 10.1 on the 10 branch, changing those is not appropriate). Similarly, rs6000_option_override_internal is called only once (with global_init_p) and then for target attribute handling, but not for optimize attribute handling. This patch moves the unrolling related handling from process_options into finish_options which is invoked whenever the options are being finalized, and the rs6000 specific parts into the override_options_after_change hook which is called for optimize attribute handling (and unfortunately also th cfun changes, but what the hook does is cheap) and I've added a call to that from rs6000_override_options_internal, so it is also called on cmdline processing and for target attribute. Furthermore, it stops using AUTODETECT_VALUE, which can work only once, and instead uses the global_options_set.x_... flags. 2020-08-12 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/96535 * toplev.c (process_options): Move flag_unroll_loops and flag_cunroll_grow_size handling from here to ... * opts.c (finish_options): ... here. For flag_cunroll_grow_size, don't check for AUTODETECT_VALUE, but instead check opts_set->x_flag_cunroll_grow_size. * common.opt (funroll-completely-grow-size): Default to 0. * config/rs6000/rs6000.c (TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Redefine. (rs6000_override_options_after_change): New function. (rs6000_option_override_internal): Call it. Move there the flag_cunroll_grow_size, unroll_only_small_loops and flag_rename_registers handling.
2020-08-17[testsuite, nvptx] Borrow ia64-sync-*.c test-cases in gcc.target/nvptxTom de Vries4-0/+9
In absence of nvptx-enabling for effective target sync_int_long (see PR96494), copy a few test-cases to gcc.target/nvptx. Tested on nvptx. gcc/testsuite/ChangeLog: * gcc.target/nvptx/ia64-sync-1.c: New test. * gcc.target/nvptx/ia64-sync-2.c: New test. * gcc.target/nvptx/ia64-sync-3.c: New test. * gcc.target/nvptx/ia64-sync-4.c: New test.
2020-08-17Fix gcc.dg/ia64-sync-5.c for architectures with unsigned char as default (PR ↵Kwok Cheung Yeung1-3/+3
96519) If char is unsigned, then comparisons of the char array elements against negative integers in the test will fail as values in the array will always be positive, and will remain so when promoted to signed int. 2020-08-12 Kwok Cheung Yeung <kcy@codesourcery.com> PR testsuite/96519 gcc/testsuite/ * gcc.dg/ia64-sync-5.c (AC, init_qi, test_qi): Change element type to signed char.
2020-08-17[testsuite] Add effective target large_initializerTom de Vries3-2/+15
When compiling builtin-object-size-21.c for nvptx, cc1 times out while emitting the initializer for global variable xm3_3. With x86_64, we are able to emit the initializer with a few lines of assembly: ... xm3_3: .byte 0 .zero 9223372036854775803 .byte 1 .byte 2 .byte 3 ... but with nvptx, we don't have some something similar available, and thus generate: ... .visible .global .align 1 .u32 xm3_3[2305843009213693952] = { 0, 0, 0, ... ... Introduce an effective target large_initializer, returning false for nvptx, and require it for test-cases with large initializers. Tested on nvptx with make check-gcc. gcc/testsuite/ChangeLog: PR testsuite/96566 * lib/target-supports.exp (check_effective_target_large_initializer): New proc. * gcc.dg/builtin-object-size-21.c: Require large_initializer. * gcc.dg/strlenopt-55.c: Same.
2020-08-17[nvptx] Fix array dimension in nvptx_assemble_decl_beginTom de Vries1-2/+2
When compiling test-case builtin-object-size-21.c, cc1 emits: ... .visible .global .align 1 .u32 xm3_3[-2305843009213693951] = ... for: ... struct Ax_m3 { char a[PTRDIFF_MAX - 3], ax[]; }; struct Ax_m3 xm3_3 = { { 0 }, { 1, 2, 3 } }; ... Fix this by: - changing the printing format for unsigned HOST_WIDE_INT init_frag.remaining to HOST_WIDE_INT_PRINT_UNSIGNED - changing the type of local variable elt_size in nvptx_assemble_decl_begin to unsigned HOST_WIDE_INT. such that we have: ... .visible .global .align 1 .u32 xm3_3[2305843009213693952] = ... where 2305843009213693952 == 0x2000000000000000, so the array is claiming 0x8000000000000000 bytes, which is one more than PTRDIFF_MAX. This is due to using .u32 instead of .u8, so strictly speaking we should downgrade to using .u8 in this case, but that corner-case problem doesn't look urgent enough to fix in this commit. Build on nvptx, tested with make check-gcc. gcc/ChangeLog: * config/nvptx/nvptx.c (nvptx_assemble_decl_begin): Make elt_size an unsigned HOST_WIDE_INT. Print init_frag.remaining using HOST_WIDE_INT_PRINT_UNSIGNED.
2020-08-17testsuite: Fix gcc.target/arm/stack-protector-1.c for Cortex-MChristophe Lyon1-2/+2
The stack-protector-1.c test fails when compiled for Cortex-M: - for Cortex-M0/M1, str r0, [sp #-8]! is not supported - for Cortex-M3/M4..., the assembler complains that "use of r13 is deprecated" This patch replaces the str instruction with sub sp, sp, #8 str r0, [sp] and removes the check for r13, which is unlikely to leak the canary value. 2020-08-11 Christophe Lyon <christophe.lyon@linaro.org> gcc/testsuite/ * gcc.target/arm/stack-protector-1.c: Adapt code to Cortex-M restrictions.
2020-08-17testsuite: Fix gcc.target/arm/multilib.exp use of gcc_optsChristophe Lyon1-1/+1
This patch fixes an incorrect parameter passing for $gcc_opts, which produces a DejaGnu error: (DejaGnu) proc "gcc_opts" does not exist. 2020-08-12 Christophe Lyon <christophe.lyon@linaro.org> gcc/testsuite/ * gcc.target/arm/multilib.exp: Fix parameter passing for gcc_opts.
2020-08-17x86_64: Use peephole2 to eliminate redundant moves.Roger Sayle1-0/+10
The recent fix for mul_widen_cost revealed an interesting quirk of ira/reload register allocation on x86_64. As shown in https://gcc.gnu.org/pipermail/gcc-patches/2020-August/551648.html for gcc.target/i386/pr71321.c we generate the following code that performs unnecessary register shuffling. movl $-51, %edx movl %edx, %eax mulb %dil Various discussions in bugzilla seem to point to reload preferring not to load constants directly into CLASS_LIKELY_SPILLED_P registers. Whatever the cause, one solution (workaround), that doesn't involve rewriting a register allocator, is to use peephole2 to spot this wierdness and eliminate it. With this peephole2 the above three instructions (from pr71321.c) are replaced with: movl $-51, %eax mulb %dil 2020-08-12 Roger Sayle <roger@nextmovesoftware.com> Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog * config/i386/i386.md (peephole2): Reduce unnecessary register shuffling produced by register allocation.
2020-08-17Replace std::vector<> usage in ipa-fnsummary.c with GCC's vec<>.Aldy Hernandez2-10/+12
gcc/ChangeLog: * ipa-fnsummary.c (evaluate_conditions_for_known_args): Use vec<> instead of std::vector<>. (evaluate_properties_for_edge): Same. (ipa_fn_summary_t::duplicate): Same. (estimate_ipcp_clone_size_and_time): Same. * vec.h (<T, A, vl_embed>::embedded_size): Change vec_embedded type to contain a char[].
2020-08-17IBM Z: Fix PR96308Andreas Krebbel2-0/+32
For the testcase a symbol with a TLS reloc and an unary minus is being generated. The backend didn't handle this correctly. In s390_cannot_force_const_mem an unary minus on a symbolic constant is rejected now since gas would not allow this. legitimize_tls_address now makes the NEG rtx the outermost operation by pulling it out of the CONST rtx. gcc/ChangeLog: PR target/96308 * config/s390/s390.c (s390_cannot_force_const_mem): Reject an unary minus for everything not being a numeric constant. (legitimize_tls_address): Move a NEG out of the CONST rtx. gcc/testsuite/ChangeLog: PR target/96308 * g++.dg/pr96308.C: New test.
2020-08-17IBM Z: Fix PR96456Andreas Krebbel3-3/+21
The testcase failed because our backend refuses to generate vector compare instructions for signaling operators with -fno-trapping-math -fno-finite-math-only. gcc/ChangeLog: PR target/96456 * config/s390/s390.h (TARGET_NONSIGNALING_VECTOR_COMPARE_OK): New macro. * config/s390/vector.md (vcond_comparison_operator): Use new macro for the check. gcc/testsuite/ChangeLog: PR target/96456 * gcc.target/s390/pr96456.c: New test.
2020-08-17Re: PR96493, powerpc local call linkage failureAlan Modra1-1/+3
PR target/96525 * gcc.target/powerpc/pr96493.c: Make it a link test when no power10_hw. Require power10_ok.
2020-08-17Daily bump.GCC Administrator4-1/+101
2020-08-17internal/syscall/unix: restore ppc build tagIan Lance Taylor1-1/+1
It was accidentally lost in the 1.15rc1 merge. Fixes PR go/96567 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/247843
2020-08-17testsuite: remove xfail flifetime-dse[24].CDavid Edelsohn2-2/+0
The testcases no longer are failing due to operator new, so remove the xfails to reduce testsuite summary noise. gcc/testsuite/ChangeLog: 2020-08-11 David Edelsohn <dje.gcc@gmail.com> * g++.dg/opt/flifetime-dse2.C: Remove AIX xfail. * g++.dg/opt/flifetime-dse4.C: Remove AIX xfail.
2020-08-17[testsuite] Add missing require-effective-target directives in gcc.dgTom de Vries40-20/+66
Add some missing require-effect-targets directives (alloca, indirect_jumps, label_values and nonlocal_goto). Tested on nvptx. gcc/testsuite/ChangeLog: * gcc.dg/Warray-bounds-46.c: Add missing require-effective-target directive. * gcc.dg/Warray-bounds-48.c: Same. * gcc.dg/Warray-bounds-50.c: Same. * gcc.dg/Wreturn-local-addr-2.c: Same. * gcc.dg/Wreturn-local-addr-3.c: Same. * gcc.dg/Wreturn-local-addr-4.c: Same. * gcc.dg/Wreturn-local-addr-6.c: Same. * gcc.dg/Wstack-usage.c: Same. * gcc.dg/Wstringop-overflow-15.c: Same. * gcc.dg/Wstringop-overflow-23.c: Same. * gcc.dg/Wstringop-overflow-25.c: Same. * gcc.dg/Wstringop-overflow-27.c: Same. * gcc.dg/Wstringop-overflow-39.c: Same. * gcc.dg/analyzer/alloca-leak.c: Same. * gcc.dg/analyzer/data-model-1.c: Same. * gcc.dg/analyzer/data-model-16.c: Same. * gcc.dg/analyzer/malloc-1.c: Same. * gcc.dg/analyzer/malloc-paths-8.c: Same. * gcc.dg/analyzer/pr93546.c: Same. * gcc.dg/analyzer/setjmp-1.c: Same. * gcc.dg/analyzer/setjmp-2.c: Same. * gcc.dg/analyzer/setjmp-3.c: Same. * gcc.dg/analyzer/setjmp-4.c: Same. * gcc.dg/analyzer/setjmp-5.c: Same. * gcc.dg/analyzer/setjmp-6.c: Same. * gcc.dg/analyzer/setjmp-7.c: Same. * gcc.dg/analyzer/setjmp-7a.c: Same. * gcc.dg/analyzer/setjmp-8.c: Same. * gcc.dg/analyzer/setjmp-9.c: Same. * gcc.dg/analyzer/setjmp-pr93378.c: Same. * gcc.dg/gimplefe-44.c: Same. * gcc.dg/pr84131.c: Same. * gcc.dg/pr93986.c: Same. * gcc.dg/pr95133.c: Same. * gcc.dg/pr95857.c: Same. * gcc.dg/strlenopt-83.c: Same. * gcc.dg/strlenopt-84.c: Same. * gcc.dg/strlenopt-91.c: Same. * gcc.dg/uninit-32.c: Same. * gcc.dg/uninit-36.c: Same.
2020-08-17c-family: Fix ICE in get_atomic_generic_size [PR96545]Jakub Jelinek2-1/+39
As the testcase shows, we would ICE if the type of the first argument of various atomic builtins was pointer to (non-void) incomplete type, we would assume that TYPE_SIZE_UNIT must be non-NULL. This patch diagnoses it instead. And also changes the TREE_CODE != INTEGER_CST check to !tree_fits_uhwi_p, as we use tree_to_uhwi after this and at least in theory the int could be too large and not fit. 2020-08-11 Jakub Jelinek <jakub@redhat.com> PR c/96545 * c-common.c (get_atomic_generic_size): Require that first argument's type points to a complete type and use tree_fits_uhwi_p instead of just INTEGER_CST TREE_CODE check for the TYPE_SIZE_UNIT. * c-c++-common/pr96545.c: New test.
2020-08-17expr: Optimize noop copies [PR96539]Jakub Jelinek2-0/+22
At GIMPLE e.g. for __builtin_memmove we optimize away (to just the return value) noop copies where src == dest, but at the RTL we don't, and as the testcase shows, in some cases such copies can appear only at the RTL level e.g. from trying to copy an aggregate by value argument to the same location as it already has. If the block move is expanded e.g. piecewise, we actually manage to optimize it away, as the individual memory copies are seen as noop moves, but if the target optabs are used, often the sequences stay until final. 2020-08-11 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/96539 * expr.c (emit_block_move_hints): Don't copy anything if x and y are the same and neither is MEM_VOLATILE_P. * gcc.target/i386/pr96539.c: New test.
2020-08-17tree: Fix up get_narrower [PR96549]Jakub Jelinek2-1/+13
My changes to get_narrower to support COMPOUND_EXPRs apparently used a wrong type for the COMPOUND_EXPRs, while e.g. the rhs type was unsigned short, the COMPOUND_EXPR got int type as that was the original type of op. The type of COMPOUND_EXPR should be always the type of the rhs. 2020-08-11 Jakub Jelinek <jakub@redhat.com> PR c/96549 * tree.c (get_narrower): Use TREE_TYPE (ret) instead of TREE_TYPE (win) for COMPOUND_EXPRs. * gcc.c-torture/execute/pr96549.c: New test.
2020-08-17Do not combine PRED_LOOP_GUARD and PRED_LOOP_GUARD_WITH_RECURSIONJan Hubicka2-6/+32
This patch avoids both PRED_LOOP_GUARD and PRED_LOOP_GUARD_WITH_RECURSION to be attached to one edge. We have logic that prevents same predictor to apply to one edge twice, but since we split LOOP_GUARD to two more specialized cases, this no longer fires. Double prediction happens in exchange benchmark and leads to unrealistically low hitrates on some edges which in turn leads to bad IPA profile and misguides ipa-cp. Unforutnately it seems that the bad profile also leads to bit better performance by disabling some of loop stuff, but that really ought to be done in some meaningful way, not by an accident. gcc/ChangeLog: 2020-08-11 Jan Hubicka <hubicka@ucw.cz> * predict.c (not_loop_guard_equal_edge_p): New function. (maybe_predict_edge): New function. (predict_paths_for_bb): Use it. (predict_paths_leading_to_edge): Use it. gcc/testsuite/ChangeLog: 2020-08-11 Jan Hubicka <hubicka@ucw.cz> * gcc.dg/ipa/ipa-clone-2.c: Lower threshold from 500 to 400.
2020-08-17Add debug counter for IPA bits CP.Martin Liska2-3/+9
gcc/ChangeLog: * dbgcnt.def (DEBUG_COUNTER): Add ipa_cp_bits. * ipa-cp.c (ipcp_store_bits_results): Use it when we store known bits for parameters.
2020-08-17Daily bump.GCC Administrator6-1/+138
2020-08-17c++: Add unfixed test [PR88003]Marek Polacek1-0/+13
Now that dg-ice is available, let's try it out. gcc/testsuite/ChangeLog: PR c++/88003 * g++.dg/cpp1y/auto-fn61.C: New test.
2020-08-17runtime: revert eqtype for AIXClément Chigot9-10/+43
AIX linker is not able to merge identical type descriptors in a single symbol if there are coming from different object or shared object files. This results into several pointers referencing the same type descriptors. Thus, eqtype is needed to ensure that these different symbols will be considered as the same type descriptor. Fixes golang/go#39276 gcc/go/ChangeLog: * go-c.h (struct go_create_gogo_args): Add need_eqtype field. * go-lang.c (go_langhook_init): Set need_eqtype. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/235697
2020-08-17testsuite: Introduce dg-ice.Marek Polacek4-2/+65
This patch adds a new DejaGNU directive, dg-ice, as outlined in the proposal here: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/550913.html It means that it's expected that the compiler crashes with an internal compiler error when compiling test with such a directive. A minor optimization could be to use -pass-exit-codes and then check for ICE_EXIT_CODE return code instead of using string match. gcc/ChangeLog: * doc/sourcebuild.texi: Document dg-ice. gcc/testsuite/ChangeLog: * lib/gcc-dg.exp (gcc-dg-test-1): Handle dg-ice. (cleanup-after-saved-dg-test): Reset expect_ice. * lib/prune.exp (prune_ices): New. * lib/target-supports-dg.exp (dg-ice): New.
2020-08-17i386: Improve code generation of smin(x,0) with -m32.Roger Sayle2-1/+28
To make amends for the recent (temporary) testsuite failure of my new gcc.target/i386/minmax-9.c when compiled with -m32, this patch improves the -m32 code we generate for the examples in that test case. The trick is to expand smin(x,0) as "x < 0 ? x : 0" instead of the current "x <= 0 ? x : 0", as the former can take advantage of sign_bit_mask operations. 2020-08-10 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * config/i386/i386-expand.c (ix86_expand_int_movcc): Expand signed MIN_EXPR against zero as "x < 0 ? x : 0" instead of "x <= 0 ? x : 0" to enable sign_bit_compare_p optimizations. gcc/testsuite/ChangeLog * gcc.target/i386/minmax-12.c: New test.
2020-08-17Fix NULL pointer dereference in doloop_contained_function_call.Thomas Koenig2-1/+60
gcc/fortran/ChangeLog: PR fortran/96556 * frontend-passes.c (doloop_contained_function_call): Do not dereference a NULL pointer for value.function.esym. gcc/testsuite/ChangeLog: PR fortran/96556 * gfortran.dg/do_check_15.f90: New test.
2020-08-17c++: Fix constexpr evaluation of SPACESHIP_EXPR [PR96497]Jakub Jelinek2-2/+9
The following valid testcase is rejected, because cxx_eval_binary_expression is called on the SPACESHIP_EXPR with lval = true, as the address of the spaceship needs to be passed to a method call. After recursing on the operands and calling genericize_spaceship which turns it into a TARGET_EXPR with initialization, we call cxx_eval_constant_expression on it which succeeds, but then we fall through into code that will VERIFY_CONSTANT (r) which FAILs because it is an address of a variable. Rather than avoiding that for lval = true and SPACESHIP_EXPR, the patch just tail calls cxx_eval_constant_expression - I believe that call should perform all the needed verifications. 2020-08-10 Jakub Jelinek <jakub@redhat.com> PR c++/96497 * constexpr.c (cxx_eval_binary_expression): For SPACESHIP_EXPR, tail call cxx_eval_constant_expression after genericize_spaceship to avoid undesirable further VERIFY_CONSTANT. * g++.dg/cpp2a/spaceship-constexpr3.C: New test.
2020-08-17c++: constraints and address of template-idPatrick Palka6-5/+25
When resolving the address of a template-id, we need to drop functions whose associated constraints are not satisfied, as per [over.over]. We do so in resolve_address_of_overloaded_function, but not in resolve_overloaded_unification or resolve_nondeduced_context, which seems like an oversight. gcc/cp/ChangeLog: * pt.c (resolve_overloaded_unification): Drop functions with unsatisfied constraints. (resolve_nondeduced_context): Likewise. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-fn5.C: New test. * g++.dg/concepts/fn8.C: Generalize dg-error directive to accept "no matching function ..." diagnostic. * g++.dg/cpp2a/concepts-fn1.C: Likewise. * g++.dg/cpp2a/concepts-ts2.C: Likewise. * g++.dg/cpp2a/concepts-ts3.C: Likewise.
2020-08-17Declare gt_* functions inline in value-range.h.Aldy Hernandez1-3/+3
gcc/ChangeLog: * value-range.h (gt_ggc_mx): Declare inline. (gt_pch_nx): Same.
2020-08-17Simplify X * C1 == C2 with wrapping overflowMarc Glisse5-35/+68
Odd numbers are invertible in Z / 2^n Z, so X * C1 == C2 can be rewritten as X == C2 * inv(C1) when overflow wraps. mod_inv should probably be updated to better match the other wide_int functions, but that's a separate issue. 2020-08-10 Marc Glisse <marc.glisse@inria.fr> PR tree-optimization/95433 * match.pd (X * C1 == C2): Handle wrapping overflow. * expr.c (maybe_optimize_mod_cmp): Qualify call to mod_inv. (mod_inv): Move... * wide-int.cc (mod_inv): ... here. * wide-int.h (mod_inv): Declare it. * gcc.dg/tree-ssa/pr95433-2.c: New file.
2020-08-17Fix remove_predictions_associated_with_edgeJan Hubicka1-7/+8
remove_predictions_associated_with_edge currently calls filter_predicitons passing it equal_edge_p. Becase filter_predictions removes all edges where filter returns false, the function does exact oposite. Fixed thus. Bootstrapped/regtested x86_64-linux. gcc/ChangeLog: 2020-08-02 Jan Hubicka <hubicka@ucw.cz> * predict.c (filter_predictions): Document semantics of filter. (equal_edge_p): Rename to ... (not_equal_edge_p): ... this; reverse semantics. (remove_predictions_associated_with_edge): Fix.
2020-08-17Correct ChangeLog foul ups.Paul Thomas2-26/+0
2020-08-17This patch fixes PR96312. Cures a used uninitialized warning.Paul Thomas2-6/+51
2020-08-10 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/96312 * trans-expr.c (fcncall_realloc_result): Only compare shapes if lhs was allocated.. gcc/testsuite/ PR fortran/96312 * gfortran.dg/pr96312.f90: New test.
2020-08-17This patch fixes PR96102. See the explanatory comment in the testcase.Paul Thomas2-0/+37
2020-08-10 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/96102 * resolve.c (check_host_association): Replace the gcc_assert with an error for internal procedures. gcc/testsuite/ PR fortran/96102 * gfortran.dg/pr96102.f90: New test.
2020-08-17Using UNSPEC for vector compare to mask register.liuhongt5-112/+26
For rtx like (eq:HI (V8SI 90) (V8SI 91)), cse will take it as a boolean value and try to do some optimization. But it is not true for vector compare, also other places in rtl passes hold the same assumption. 2020-07-20 Hongtao Liu <hongtao.liu@intel.com> gcc/ PR target/96243 * config/i386/i386-expand.c (ix86_expand_sse_cmp): Refine for maskcmp. (ix86_expand_mask_vec_cmp): Change prototype. * config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): Change prototype. * config/i386/i386.c (ix86_print_operand): Remove operand modifier 'I'. * config/i386/sse.md (*<avx512>_cmp<mode>3<mask_scalar_merge_name><round_saeonly_name>): Deleted. (*<avx512>_cmp<mode>3<mask_scalar_merge_name>): Ditto. (*<avx512>_ucmp<mode>3<mask_scalar_merge_name>): Ditto. (*<avx512>_ucmp<mode>3<mask_scalar_merge_name>, avx512f_maskcmp<mode>3): Ditto. gcc/testsuite * gcc.target/i386/pr92865-1.c: Adjust testcase.
2020-08-17Daily bump.GCC Administrator3-1/+21
2020-08-17middle-end: Correct calculation of mul_widen_cost and mul_highpart_cost.Roger Sayle2-2/+4
This patch fixes a subtle bug in the depths of GCC's synth_mult, where the middle-end queries whether (how well) the target supports widening and highpart multiplications by calling targetm.rtx_costs. The code in init_expmed and init_expmed_one_mode iterates over various RTL patterns querying the cost of each. To avoid generating & garbage collecting too much junk, it reuses the same RTL over and over, but adjusting the modes between each call. Alas this reuse of state is a little fragile, and at some point a change to init_expmed_one_conv has resulted in the state (mode of a register) being changed, but not reset before being used again. Using the old software engineering/defensive programming maxim of "why fix a bug just once, if it can be fixed in multiple places", this patch both restores the original value in init_expmed_one_conv, and also sets it to the expected value in init_expmed_one_mode. This should hopefully signal the need to be careful of invariants for anyone modifying this code in future. 2020-08-09 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * expmed.c (init_expmed_one_conv): Restore all->reg's mode. (init_expmed_one_mode): Set all->reg to desired mode. gcc/testsuite/ChangeLog PR target/71321 * gcc.target/i386/pr71321.c: Check that the code doesn't use the 4B zero displacement lea, not that it uses lea.
2020-08-17testsuite, Darwin: XFAIL runs for two timode conversion tests.Iain Sandoe2-0/+2
X86 Darwin fails these at present, because (to work around PR80556) we insert libSystem ahead of libgcc. The libSystem implementation has a similar bug to one that was fixed for GCC. We need to fix 80556 properly, and then this issue will go away - we will be able to use the libgcc impl as intended. XFAIL the run for now, to reduce testsuite noise. gcc/testsuite/ChangeLog: * gcc.dg/torture/fp-int-convert-timode-3.c: XFAIL run. * gcc.dg/torture/fp-int-convert-timode-4.c: Likewise.
2020-08-17gcc.dg/pr44194-1.c: Skip for mmix.Hans-Peter Nilsson1-0/+1
The test makes sense only for targets that return the "struct { int a, b, c; }" in registers (not in memory). Starting a skip-construct is IMHO better than another iteration of that obscuring "{ ... && { ! mytarget-*-* } }". New targets can just append to the list without additional {}:s. I chose not to "convert" any of the previous exclusions, as without targets to test, I'd surely mess up {}-pairs. A new effective_target would be even better, but such a check_effective_target_returns_struct_in_memory (or complementary, _in_registers) would surely have to be parametrized on the size and type of the returned blob. Maybe best to restrict to just x86_64, as seems to have been the original problem target. gcc/testsuite: * gcc.dg/pr44194-1.c: Skip for mmix.
2020-08-17Daily bump.GCC Administrator3-1/+36
2020-08-17gcc.dg/pr30957-1.c: xfail for mmix.Hans-Peter Nilsson1-2/+2
IV (loop2_unroll) doesn't like the mmix port. The feelings are mutual. For mmix, gcc.dg/pr30957-1.c fails (runtime and rtl-scan) for these reasons: - IV doesn't handle the zero-extension-by-shift sequences generated by middle-end (expr.c:convert_mode_scalar) in the absence of zero-extend patterns in a port. - (when adding such patterns) IV doesn't understand the subreg constructs generated by middle-end in the absence of addsi3 and compare/branch in SImode (int). - (when hacking pr30957-1.c to iterate using a register-mode type) IV doesn't understand the admittedly weird SFmode operations (performing in DFmode, then truncating, for lack of SFmode operations, but presence of truncdfsf2 and float_extendsfdf2) in order to perform the "Expanding Accumulator" optimization. When also editing the type in the test to be double instead of float, the test passes. While at least the last point seems like a valid reason to just skip the test for mmix, it also seems possible that IV (and maybe convert_mode_scalar by e.g. adding REG_EQUIV notes) be improved to be both smarter and dumber to actually make the test pass, so I think it's better to use xfail. Smarter: understanding zero-extend- by-shift and subregged operations better, and "seeing" the accumulation through the DF/SFmode truncations and expansions. Dumber: ignoring the cost; unrolling the several operations per SFmode add anyway. I'm considering adding a variant of this test with "double" and "__SIZE_TYPE__" iteration types, as that passes for mmix as-is. Maybe as a mmix-specific test; the world has suffered enough from the questionable gcc.dg/pr30957-1.c (see the test and its history). gcc/testsuite: * gcc.dg/pr30957-1.c: xfail for mmix.
2020-08-17rs6000: MMA built-ins reject typedefs of MMA typesPeter Bergner2-17/+51
We do not allow conversions between the MMA types and other types. However, we are being too strict in not matching MMA types with typdefs of those types. Use TYPE_CANONICAL to see through the types to their canonical types before comparing them. 2020-08-08 Peter Bergner <bergner@linux.ibm.com> gcc/ PR target/96530 * config/rs6000/rs6000.c (rs6000_invalid_conversion): Use canonical types for type comparisons. Refactor code to simplify it. gcc/testsuite/ PR target/96530 * gcc.target/powerpc/pr96530.c: New test.
2020-08-17openmp: Handle clauses with gimple sequences in convert_nonlocal_omp_clauses ↵Jakub Jelinek1-10/+36
properly If the walk_body on the various sequences of reduction, lastprivate and/or linear clauses needs to create a temporary variable, we should declare that variable in that sequence rather than outside, where it would need to be privatized inside of the construct. 2020-08-08 Jakub Jelinek <jakub@redhat.com> PR fortran/93553 * tree-nested.c (convert_nonlocal_omp_clauses): For OMP_CLAUSE_REDUCTION, OMP_CLAUSE_LASTPRIVATE and OMP_CLAUSE_LINEAR save info->new_local_var_chain around walks of the clause gimple sequences and declare_vars if needed into the sequence. 2020-08-08 Tobias Burnus <tobias@codesourcery.com> PR fortran/93553 * testsuite/libgomp.fortran/pr93553.f90: New test.
2020-08-17openmp: Avoid floating point comparison at the end of bb with ↵Jakub Jelinek2-4/+41
-fnon-call-exceptions The following testcase ICEs with -fexceptions -fnon-call-exceptions because in that mode floating point comparisons should not be done at the end of bb in GIMPLE_COND. Fixed by forcing it into a bool SSA_NAME and comparing that against false. 2020-08-08 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/96424 * omp-expand.c: Include tree-eh.h. (expand_omp_for_init_vars): Handle -fexceptions -fnon-call-exceptions by forcing floating point comparison into a bool temporary. * c-c++-common/gomp/pr96424.c: New test.
2020-08-17libgo: update to Go1.15rc2 releaseIan Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/247517
2020-08-17Daily bump.GCC Administrator3-1/+103
2020-08-17Disable some VEC_COND_EXPR transformations after vector loweringMarc Glisse3-9/+31
ARM understands VEC_COND_EXPR<v == w, -1, 0> but not a plain v == w which is fed to something other than VEC_COND_EXPR (say BIT_IOR_EXPR). This patch avoids introducing the second kind of statement after the vector lowering pass, which is the last chance to turn v == w back into something the target handles. This is just a workaround to avoid ICEs, a v == w produced before vector lowering will yield pretty bad code. Either the arm target needs to learn to handle vector comparisons (aarch64 already does), or the middle-end needs to fall back to vcond when plain comparisons are not supported (or ...). 2020-08-07 Marc Glisse <marc.glisse@inria.fr> * generic-match-head.c (optimize_vectors_before_lowering_p): New function. * gimple-match-head.c (optimize_vectors_before_lowering_p): Likewise. * match.pd ((v ? w : 0) ? a : b, c1 ? c2 ? a : b : b): Use it.
2020-08-17tree-optimization/96514 - avoid if-converting control-altering callsRichard Biener2-0/+32
This avoids if-converting when encountering control-altering calls. 2020-08-07 Richard Biener <rguenther@suse.de> PR tree-optimization/96514 * tree-if-conv.c (if_convertible_bb_p): If the last stmt is a call that is control-altering, fail. * gcc.dg/pr96514.c: New testcase.
2020-08-17bpf: remove trailing whitespaces from source filesJose E. Marchesi49-65/+55
This patch is a little cleanup that removes trailing whitespaces from the bpf backend source files. 2020-08-07 Jose E. Marchesi <jose.marchesi@oracle.com> gcc/ * config/bpf/bpf.md: Remove trailing whitespaces. * config/bpf/constraints.md: Likewise. * config/bpf/predicates.md: Likewise. gcc/testsuite/ * gcc.target/bpf/diag-funargs-2.c: Remove trailing whitespaces. * gcc.target/bpf/skb-ancestor-cgroup-id.c: Likewise. * gcc.target/bpf/helper-xdp-adjust-meta.c: Likewise. * gcc.target/bpf/helper-xdp-adjust-head.c: Likewise. * gcc.target/bpf/helper-tcp-check-syncookie.c: Likewise. * gcc.target/bpf/helper-sock-ops-cb-flags-set.c * gcc.target/bpf/helper-sysctl-set-new-value.c: Likewise. * gcc.target/bpf/helper-sysctl-get-new-value.c: Likewise. * gcc.target/bpf/helper-sysctl-get-name.c: Likewise. * gcc.target/bpf/helper-sysctl-get-current-value.c: Likewise. * gcc.target/bpf/helper-strtoul.c: Likewise. * gcc.target/bpf/helper-strtol.c: Likewise. * gcc.target/bpf/helper-sock-map-update.c: Likewise. * gcc.target/bpf/helper-sk-storage-get.c: Likewise. * gcc.target/bpf/helper-sk-storage-delete.c: Likewise. * gcc.target/bpf/helper-sk-select-reuseport.c: Likewise. * gcc.target/bpf/helper-sk-release.c: Likewise. * gcc.target/bpf/helper-sk-redirect-map.c: Likewise. * gcc.target/bpf/helper-sk-lookup-upd.c: Likewise. * gcc.target/bpf/helper-sk-lookup-tcp.c: Likewise. * gcc.target/bpf/helper-skb-change-head.c: Likewise. * gcc.target/bpf/helper-skb-cgroup-id.c: Likewise. * gcc.target/bpf/helper-skb-adjust-room.c: Likewise. * gcc.target/bpf/helper-set-hash.c: Likewise. * gcc.target/bpf/helper-setsockopt.c: Likewise. * gcc.target/bpf/helper-redirect-map.c: Likewise. * gcc.target/bpf/helper-rc-repeat.c: Likewise. * gcc.target/bpf/helper-rc-keydown.c: Likewise. * gcc.target/bpf/helper-probe-read-str.c: Likewise. * gcc.target/bpf/helper-perf-prog-read-value.c: Likewise. * gcc.target/bpf/helper-perf-event-read-value.c: Likewise. * gcc.target/bpf/helper-override-return.c: Likewise. * gcc.target/bpf/helper-msg-redirect-map.c: Likewise. * gcc.target/bpf/helper-msg-pull-data.c: Likewise. * gcc.target/bpf/helper-msg-cork-bytes.c: Likewise. * gcc.target/bpf/helper-msg-apply-bytes.c: Likewise. * gcc.target/bpf/helper-lwt-seg6-store-bytes.c: Likewise. * gcc.target/bpf/helper-lwt-seg6-adjust-srh.c: Likewise. * gcc.target/bpf/helper-lwt-seg6-action.c: Likewise. * gcc.target/bpf/helper-lwt-push-encap.c: Likewise. * gcc.target/bpf/helper-get-socket-uid.c: Likewise. * gcc.target/bpf/helper-get-socket-cookie.c: Likewise. * gcc.target/bpf/helper-get-local-storage.c: Likewise. * gcc.target/bpf/helper-get-current-cgroup-id.c: Likewise. * gcc.target/bpf/helper-getsockopt.c: Likewise. * gcc.target/bpf/diag-funargs-3.c: Likewise.