aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2018-01-22rl78-protos.h: New function declaration rl78_split_movdiSebastian Perta4-0/+27
2018-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/rl78-protos.h: New function declaration rl78_split_movdi * config/rl78/rl78.md: New define_expand "movdi" * config/rl78/rl78.c: New function definition rl78_split_movdi From-SVN: r256960
2018-01-22re PR target/83862 (powerpc: ICE in signbit testcase)Michael Meissner6-94/+127
[gcc] 2018-01-22 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/83862 * config/rs6000/rs6000-protos.h (rs6000_split_signbit): Delete, no longer used. * config/rs6000/rs6000.c (rs6000_split_signbit): Likewise. * config/rs6000/rs6000.md (signbit<mode>2): Change code for IEEE 128-bit to produce an UNSPEC move to get the double word with the signbit and then a shift directly to do signbit. (signbit<mode>2_dm): Replace old IEEE 128-bit signbit implementation with a new version that just does either a direct move or a regular move. Move memory interface to separate insns. Move insns so they are next to the expander. (signbit<mode>2_dm_mem_be): New combiner insns to combine load with signbit move. Split big and little endian case. (signbit<mode>2_dm_mem_le): Likewise. (signbit<mode>2_dm_<su>ext): Delete, no longer used. (signbit<mode>2_dm2): Likewise. [gcc/testsuite] 2018-01-22 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/83862 * gcc.target/powerpc/pr83862.c: New test. From-SVN: r256959
2018-01-22rl78.md: New define_expand "anddi3".Sebastian Perta2-0/+14
2018-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/rl78.md: New define_expand "anddi3". 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/anddi3.S: New assembly file. * config/rl78/t-rl78: Added anddi3.S to LIB2ADD. From-SVN: r256958
2018-01-22rl78.md: New define_expand "umindi3".Sebastian Perta2-0/+14
2018-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/rl78.md: New define_expand "umindi3". 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/umindi3.S: New assembly file. * config/rl78/t-rl78: Added umindi3.S to LIB2ADD. From-SVN: r256957
2018-01-22* es.po: Update.Joseph Myers2-37/+32
From-SVN: r256955
2018-01-22rl78.md: New define_expand "smindi3".Sebastian Perta2-0/+14
2018-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/rl78.md: New define_expand "smindi3". 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/smindi3.S: New assembly file. * config/rl78/t-rl78: Added smindi3.S to LIB2ADD. From-SVN: r256954
2018-01-22rl78.md: New define_expand "smaxdi3".Sebastian Perta2-0/+14
2018-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/rl78.md: New define_expand "smaxdi3". 2018-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/smaxdi3.S: New assembly file. * config/rl78/t-rl78: Added smaxdi3.S to LIB2ADD. From-SVN: r256953
2018-01-22rs6000-builtin.def (ST_ELEMREV_V1TI, [...]): Add macro expansion.Carl Love10-35/+1605
gcc/ChangeLog: 2018-01-22 Carl Love <cel@us.ibm.com> * config/rs6000/rs6000-builtin.def (ST_ELEMREV_V1TI, LD_ELEMREV_V1TI, LVX_V1TI): Add macro expansion. * config/rs6000/rs6000-c.c (altivec_builtin_types): Add argument definitions for VSX_BUILTIN_VEC_XST_BE, VSX_BUILTIN_VEC_ST, VSX_BUILTIN_VEC_XL, LD_ELEMREV_V1TI builtins. * config/rs6000/rs6000-p8swap.c (insn_is_swappable_p); Change check to determine if the instruction is a byte reversing entry. Fix typo in comment. * config/rs6000/rs6000.c (altivec_expand_builtin): Add case entry for VSX_BUILTIN_ST_ELEMREV_V1TI and VSX_BUILTIN_LD_ELEMREV_V1TI. Add def_builtin calls for new builtins. * config/rs6000/vsx.md (vsx_st_elemrev_v1ti, vsx_ld_elemrev_v1ti): Add define_insn expansion. gcc/testsuite/ChangeLog: 2018-01-22 Carl Love <cel@us.ibm.com> * gcc.target/powerpc/powerpc.exp: Add torture tests for builtins-4-runnable.c, builtins-6-runnable.c, builtins-5-p9-runnable.c, builtins-6-p9-runnable.c. * gcc.target/powerpc/builtins-6-runnable.c: New test file. * gcc.target/powerpc/builtins-4-runnable.c: Add additional tests for signed/unsigned 128-bit and long long int loads. From-SVN: r256952
2018-01-22re PR c++/81933 (Invalid "constexpr call flows off the end of the function" ↵Marek Polacek4-1/+67
error) PR c++/81933 * typeck2.c (split_nonconstant_init_1): Return false if we didn't split out anything. * g++.dg/cpp1y/constexpr-empty4.C: New test. From-SVN: r256951
2018-01-22fixed year in gcc/ChangeLog and libgcc/ChangeLogSebastian Perta1-1/+1
From-SVN: r256949
2018-01-22rl78.md: New define_expand "umaxdi3".Sebastian Perta2-0/+14
2017-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/rl78.md: New define_expand "umaxdi3". 2017-01-22 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/umaxdi3.S: New assembly file. * config/rl78/t-rl78: Added umaxdi3.S to LIB2ADD. From-SVN: r256948
2018-01-22fold-vec-abs-short-fwrap.c: Add xxspltib to scan-asembler valid instructions ↵Will Schmidt5-6/+15
list. [testsuite] 2018-01-19 Will Schmidt <will_schmidt@vnet.ibm.com> * gcc.target/powerpc/fold-vec-abs-short-fwrap.c: Add xxspltib to scan-asembler valid instructions list. * gcc.target/powerpc/fold-vec-abs-short.c: Same. * gcc.target/powerpc/fold-vec-shift-left-longlong.c: Clean up power8-vector requirement and option. * gcc.target/powerpc/fold-vec-shift-left-fwrapv.c: Same. From-SVN: r256947
2018-01-22rl78.c (rl78_note_reg_set): fixed dead reg check for non-QImode registersSebastian Perta2-3/+13
2018-01-12 Sebastian Perta <sebastian.perta@renesas.com> * config/rl78/rl78.c (rl78_note_reg_set): fixed dead reg check for non-QImode registers From-SVN: r256945
2018-01-22PR 78534, 83704 Large character lengthsJanne Blomqvist17-86/+113
This patch fixes various parts of the code to use a larger type than int for the character length. Depending on the situation, HOST_WIDE_INT, size_t, or gfc_charlen_t is appropriate. Regtested on x86_64-pc-linux-gnu and i686-pc-linux-gnu. gcc/fortran/ChangeLog: 2018-01-22 Janne Blomqvist <jb@gcc.gnu.org> PR 78534 PR 83704 * arith.c (gfc_arith_concat): Use size_t for string length. (gfc_compare_string): Likewise. (gfc_compare_with_Cstring): Likewise. * array.c (gfc_resolve_character_array_constructor): Use HOST_WIDE_INT, gfc_mpz_get_hwi. * check.c (gfc_check_fe_runtime_error): Use size_t. * data.c (create_character_initializer): Use HOST_WIDE_INT, gfc_extract_hwi. * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t. (add_init_expr_to_sym): Use HOST_WIDE_INT. * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT, gfc_extract_hwi. (gfc_apply_init): Likewise. * match.h (gfc_set_constant_character_len): Update prototype. * primary.c (match_string_constant): Use size_t. * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT, gfc_mpz_get_hwi. * simplify.c (init_result_expr): Likewise. (gfc_simplify_len_trim): Use size_t. * target-memory.c (gfc_encode_character): Use size_t. (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi. (interpret_array): Use size_t. (gfc_interpret_character): Likewise. * target-memory.h (gfc_encode_character): Update prototype. (gfc_interpret_character): Likewise. (gfc_target_interpret_expr): Likewise. * trans-const.c (gfc_build_string_const): Use size_t for length argument. (gfc_build_wide_string_const): Likewise. * trans-const.h (gfc_build_string_const): Likewise. (gfc_build_wide_string_const): Likewise. 2018-01-22 Janne Blomqvist <jb@gcc.gnu.org> PR 78534 PR 83704 * gfortran.dg/string_1.f90: Remove printing the length. From-SVN: r256944
2018-01-22re PR tree-optimization/83963 ([graphite] ICE in merge_sese, at ↵Richard Biener4-18/+55
graphite-scop-detection.c:517) 2018-01-22 Richard Biener <rguenther@suse.de> PR tree-optimization/83963 * graphite-scop-detection.c (scop_detection::get_sese): Delay including the loop exit block. (scop_detection::merge_sese): Likewise. (scop_detection::add_scop): Do it here instead. * gcc.dg/graphite/pr83963.c: New testcase. From-SVN: r256943
2018-01-22re PR c++/83895 (-Wparentheses warns about pointer-to-member typedefs)Ville Voutilainen3-0/+15
PR c++/83895 cp/ * decl.c (grokdeclarator): Don't diagnose extra parens on typedefs. testsuite/ * g++.dg/warn/83895.C: New. From-SVN: r256942
2018-01-22[ARM] Fix test fail with conflicting -mfloat-abiSudakshina Das2-0/+8
This patch fixes my earlier test case that fails for arm-none-eabi with explicit user option for -mfloat-abi which conflict with the test case options. I have added a guard to skip the test on those cases. ChangeLog entries: *** gcc/testsuite/ChangeLog *** 2018-01-22 Sudakshina Das <sudi.das@arm.com> * gcc.c-torture/compile/pr82096.c: Add dg-skip-if and dg-require-effective-target directives. From-SVN: r256941
2018-01-22[arm] Make gcc.target/arm/copysign_softfloat_1.c more robustKyrylo Tkachov5-5/+33
This test has needlessly restrictive requirements. It tries to force a soft-float target and tries to run. This makes it unsupportable for any non-soft-float variant. In fact, the test can be a run-time test for any target, and only the scan-assembler tests are specific to -mfloat-abi=soft. So this patch makes the test always runnable and makes the scan-assembler checks predicable on the the new arm_sotftfloat effective target check. * doc/sourcebuild.texi (arm_softfloat): Document. * lib/target-supports.exp (check_effective_target_arm_softfloat): New procedure. * gcc.target/arm/copysign_softfloat_1.c: Allow running everywhere. Adjust scan-assembler checks for soft-float. From-SVN: r256940
2018-01-22re PR target/83946 (Safe Indirect Jumps broken on AIX)Bill Schmidt2-0/+6
2018-01-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR target/83946 * gcc.target/powerpc/safe-indirect-jump-8.c: Skip for AIX. From-SVN: r256939
2018-01-22Daily bump.GCC Administrator1-1/+1
From-SVN: r256938
2018-01-21pr83621.c: Add -fno-common additional option on hppa*-&-hpux*.John David Anglin4-0/+9
* gcc.dg/pr83621.c: Add -fno-common additional option on hppa*-&-hpux*. * gcc.dg/pr83623.c: Likewise. * gcc.dg/pr83666.c: Likewise. From-SVN: r256935
2018-01-21re PR testsuite/77734 (FAIL: gcc.dg/plugin/must-tail-call-1.c ↵John David Anglin2-4/+11
-fplugin=./must_tail_call_plugin.so (test for excess errors)) PR gcc/77734 * config/pa/pa.c (pa_function_ok_for_sibcall): Use targetm.binds_local_p instead of TREE_PUBLIC to check local binding. Move TARGET_PORTABLE_RUNTIME check after TARGET_64BIT check. From-SVN: r256934
2018-01-21re PR target/83946 (Safe Indirect Jumps broken on AIX)Bill Schmidt8-16/+47
[gcc] 2018-01-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com> David Edelsohn <dje.gcc@gmail.com> PR target/83946 * config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>): Change "crset eq" to "crset 2". (*call_value_indirect_nonlocal_sysv<mode>): Likewise. (*call_indirect_aix<mode>_nospec): Likewise. (*call_value_indirect_aix<mode>_nospec): Likewise. (*call_indirect_elfv2<mode>_nospec): Likewise. (*call_value_indirect_elfv2<mode>_nospec): Likewise. (*sibcall_nonlocal_sysv<mode>): Change "crset eq" to "crset 2"; change assembly output from . to $. (*sibcall_value_nonlocal_sysv<mode>): Likewise. (indirect_jump<mode>_nospec): Change assembly output from . to $. (*tablejump<mode>_internal1_nospec): Likewise. [gcc/testsuite] 2018-01-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com> David Edelsohn <dje.gcc@gmail.com> PR target/83946 * gcc.target/powerpc/safe-indirect-jump-1.c: Change expected assembly output from "crset eq" to "crset 2". * gcc.target/powerpc/safe-indirect-jump-2.c: Change expected assembly output from . to $. * gcc.target/powerpc/safe-indirect-jump-3.c: Likewise. * gcc.target/powerpc/safe-indirect-jump-1.c: Change expected assembly output from "crset eq" to "crset 2". * gcc.target/powerpc/safe-indirect-jump-8.c: Change expected assembly output from "crset eq" to "crset 2", and from . to $. Co-Authored-By: David Edelsohn <dje.gcc@gmail.com> From-SVN: r256931
2018-01-21Fix ChangeLog entry.Oleg Endo1-1/+1
From-SVN: r256927
2018-01-21re PR target/80870 (ICE building 7.1.0 sh-elf crosscompiler on macOS)Oleg Endo2-3/+8
PR target/80870 * config/sh/rx/rx.c (config/sh/sh_optimize_sett_clrt.cc): Use INCLUDE_ALGORITHM and INCLUDE_VECTOR instead of direct includes. From-SVN: r256926
2018-01-21Daily bump.GCC Administrator1-1/+1
From-SVN: r256924
2018-01-20re PR fortran/83900 (ICE in gfc_simplify_matmul, at fortran/simplify.c:4593)Steven G. Kargl4-3/+35
2018-01-20 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/83900 * simplify.c (gfc_simplify_matmul): Set return type correctly. 2018-01-20 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/83900 * gfortran.dg/matmul_18.f90: New test. From-SVN: r256919
2018-01-20Fix vect_def_type handling in x86 scatter support (PR 83940)Richard Sandiford4-55/+78
As Jakub says in the PR, the problem here was that the x86/built-in version of the scatter support was using a bogus scatter_src_dt when calling vect_get_vec_def_for_stmt_copy (and had since it was added). The patch uses the vect_def_type from the original call to vect_is_simple_use instead. However, Jakub also pointed out that other parts of the load and store code passed the vector operand rather than the scalar operand to vect_is_simple_use. That probably works most of the time since a constant scalar operand should give a constant vector operand, and likewise for external and internal definitions. But it definitely seems more robust to pass the scalar operand. The patch avoids the issue for gather and scatter offsets by using the cached gs_info.offset_dt. This is safe because gathers and scatters are never grouped, so there's only one statement operand to consider. The patch also caches the vect_def_type for mask operands, which is safe because grouped masked operations share the same mask. That just leaves the store rhs. We still need to recalculate the vect_def_type there since different store values in the group can have different definition types. But since we still have access to the original scalar operand, it seems better to use that instead. 2018-01-20 Richard Sandiford <richard.sandiford@linaro.org> gcc/ PR tree-optimization/83940 * tree-vect-stmts.c (vect_truncate_gather_scatter_offset): Set offset_dt to vect_constant_def rather than vect_unknown_def_type. (vect_check_load_store_mask): Add a mask_dt_out parameter and use it to pass back the definition type. (vect_check_store_rhs): Likewise rhs_dt_out. (vect_build_gather_load_calls): Add a mask_dt argument and use it instead of a call to vect_is_simple_use. (vectorizable_store): Update calls to vect_check_load_store_mask and vect_check_store_rhs. Use the dt returned by the latter instead of scatter_src_dt. Use the cached mask_dt and gs_info.offset_dt instead of calls to vect_is_simple_use. Pass the scalar rather than the vector operand to vect_is_simple_use when handling second and subsequent copies of an rhs value. (vectorizable_load): Update calls to vect_check_load_store_mask and vect_build_gather_load_calls. Use the cached mask_dt and gs_info.offset_dt instead of calls to vect_is_simple_use. gcc/testsuite/ PR tree-optimization/83940 * gcc.dg/torture/pr83940.c: New test. From-SVN: r256918
2018-01-20re PR middle-end/83945 (internal compiler error: Segmentation fault with -O ↵Jakub Jelinek4-0/+53
-fcode-hoisting) PR middle-end/83945 * tree-emutls.c: Include gimplify.h. (lower_emutls_2): New function. (lower_emutls_1): If ADDR_EXPR is a gimple invariant and walk_tree with lower_emutls_2 callback finds some TLS decl in it, unshare_expr it before further processing. * gcc.dg/tls/pr83945.c: New test. From-SVN: r256916
2018-01-20re PR target/83930 (ICE: RTL check: expected code 'const_int', have 'mem' in ↵Jakub Jelinek4-1/+30
simplify_binary_operation_1, at simplify-rtx.c:3302) PR target/83930 * simplify-rtx.c (simplify_binary_operation_1) <case UMOD>: Use UINTVAL (trueop1) instead of INTVAL (op1). * gcc.dg/pr83930.c: New test. From-SVN: r256915
2018-01-20re PR fortran/83900 (ICE in gfc_simplify_matmul, at fortran/simplify.c:4593)Steven G. Kargl4-1/+19
2018-01-19 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/83900 * simplify.c (gfc_simplify_matmul): Delete bogus assertion. 2018-01-19 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/83900 * gfortran.dg/matmul_17.f90: New test. From-SVN: r256912
2018-01-20Daily bump.GCC Administrator1-1/+1
From-SVN: r256911
2018-01-19re PR fortran/80768 (NULL pointer dereferenced in gfc_check_num_images at ↵Steven G. Kargl2-0/+14
fortran/check.c) 2018-01-19 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/80768 * gfortran.dg/num_images_1.f90: New test that tests fix in r250734. From-SVN: r256906
2018-01-19re PR c++/81167 (ICE on valid C++ code in deferred_printed_type, at ↵Jakub Jelinek4-1/+32
cp/error.c:118) PR c++/81167 * call.c (joust): Use TREE_TYPE (source) if source is a POINTER_TYPE_P rather than if ! DECL_CONSTRUCTOR_P (w->fn). * g++.dg/cpp0x/pr81167.C: New test. From-SVN: r256905
2018-01-19re PR debug/81570 (create_pseudo_cfg assumes that INCOMING_FRAME_SP_OFFSET ↵Jakub Jelinek6-4/+65
is a constant) PR debug/81570 PR debug/83728 * dwarf2cfi.c (DEFAULT_INCOMING_FRAME_SP_OFFSET): Define to INCOMING_FRAME_SP_OFFSET if not defined. (scan_trace): Add ENTRY argument. If true and DEFAULT_INCOMING_FRAME_SP_OFFSET != INCOMING_FRAME_SP_OFFSET, emit a note to adjust the CFA offset. (create_cfi_notes): Adjust scan_trace callers. (create_cie_data): Use DEFAULT_INCOMING_FRAME_SP_OFFSET rather than INCOMING_FRAME_SP_OFFSET in the CIE. * config/i386/i386.h (DEFAULT_INCOMING_FRAME_SP_OFFSET): Define. * config/stormy16/stormy16.h (DEFAULT_INCOMING_FRAME_SP_OFFSET): Likewise. * doc/tm.texi.in (DEFAULT_INCOMING_FRAME_SP_OFFSET): Document. * doc/tm.texi: Regenerated. From-SVN: r256904
2018-01-19re PR c++/83919 (spurious -Wignored-qualifiers warning)Jakub Jelinek5-0/+24
PR c++/83919 * typeck.c (convert_for_assignment): Suppress warn_ignored_qualifiers for direct enum init. * decl.c (reshape_init): Likewise. * g++.dg/cpp0x/pr83919.C: New test. From-SVN: r256903
2018-01-19re PR rtl-optimization/83147 (LRA inheritance undo on multiple sets problem)Andreas Krebbel2-4/+12
2018-01-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com> PR rtl-optimization/83147 * lra-constraints.c (remove_inheritance_pseudos): Use lra_substitute_pseudo_within_insn. From-SVN: r256902
2018-01-19* constexpr.c (fold_simple): Simplify.Marek Polacek2-6/+9
From-SVN: r256899
2018-01-19stack-check-16.c: New test.Jeff Law2-0/+41
* gcc.dg/stack-check-16.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r256896
2018-01-19[nvptx] Fix bug in jit bug workaroundTom de Vries2-2/+32
2018-01-19 Tom de Vries <tom@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com> PR target/83920 * config/nvptx/nvptx.c (nvptx_single): Fix jit workaround. * testsuite/libgomp.oacc-c-c++-common/pr83920.c: New test. * testsuite/libgomp.oacc-fortran/pr83920.f90: New test. Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com> From-SVN: r256894
2018-01-19[nvptx] Add support for CUDA 9Cesar Philippidis4-2/+38
PR target/83790 gcc/ * config/nvptx/nvptx.c (output_init_frag): Don't use generic address spaces for function labels. gcc/testsuite/ * gcc.target/nvptx/indirect_call.c: New test. From-SVN: r256891
2018-01-19Fix missing g++.dg/torture/pr83619.C warningRainer Orth2-1/+5
* g++.dg/torture/pr83619.C: Remove dg-message. From-SVN: r256890
2018-01-19Fix test-suite fallout.Martin Liska6-6/+14
2018-01-19 Martin Liska <mliska@suse.cz> * gcc.dg/predict-1.c: Adjust expected probability. * gcc.dg/predict-3.c: Likewise. * gcc.dg/predict-5.c: Likewise. * gcc.dg/predict-6.c: Likewise. * gcc.dg/predict-9.c: Likewise. From-SVN: r256889
2018-01-19Adjust predictor values according to SPEC2006 and SPEC2017.Martin Liska2-9/+21
2018-01-19 Martin Liska <mliska@suse.cz> * predict.def (PRED_LOOP_EXIT): Change from 85 to 89. (PRED_LOOP_EXIT_WITH_RECURSION): Change from 72 to 78. (PRED_LOOP_EXTRA_EXIT): Change from 83 to 67. (PRED_OPCODE_POSITIVE): Change from 64 to 59. (PRED_TREE_OPCODE_POSITIVE): Change from 64 to 59. (PRED_CONST_RETURN): Change from 69 to 65. (PRED_NULL_RETURN): Change from 91 to 71. (PRED_LOOP_IV_COMPARE_GUESS): Change from 98 to 64. (PRED_LOOP_GUARD): Change from 66 to 73. From-SVN: r256888
2018-01-19Introduce PROB_UNINITIALIZED constant and use it in predict.def.Martin Liska4-5/+22
2018-01-19 Martin Liska <mliska@suse.cz> * predict.c (predict_insn_def): Add new assert. (struct branch_predictor): Change type to signed integer. (test_prediction_value_range): Amend test to cover PROB_UNINITIALIZED. * predict.def (PRED_LOOP_ITERATIONS): Use the new constant. (PRED_LOOP_ITERATIONS_GUESSED): Likewise. (PRED_LOOP_ITERATIONS_MAX): Likewise. (PRED_LOOP_IV_COMPARE): Likewise. * predict.h (PROB_UNINITIALIZED): Define new constant. From-SVN: r256887
2018-01-19Fix usage of analyze_brprob.py script.Martin Liska3-0/+25
2018-01-19 Martin Liska <mliska@suse.cz> * analyze_brprob.py: Support new format that can be easily parsed. Add new column to report. 2018-01-19 Martin Liska <mliska@suse.cz> * predict.c (dump_prediction): Add new format for analyze_brprob.py script which is enabled with -details suboption. * profile-count.h (precise_p): New function. From-SVN: r256886
2018-01-19Check whether any statements need masking (PR 83922)Richard Sandiford4-2/+69
This PR is an odd case in which, due to the low optimisation level, we enter vectorisation with: outer1: x_1 = PHI <x_3(outer2), ...>; ... inner: x_2 = 0; ... outer2: x_3 = PHI <x_2(inner)>; These statements are tentatively treated as a double reduction by vect_force_simple_reduction, but in the end only x_3 and x_2 are marked as relevant. vect_analyze_loop_operations skips over x_3, leaving the vectorizable_reduction check to a presumed future test of x_1, which in this case never happens. We therefore end up vectorising x_2 only (complete with peeling for niters!) and leave the scalar x_3 in place. This caused a segfault in the support for fully-masked loops, since there were no statements that needed masking. Fixed by checking for that. But I think this is also a flaw in vect_analyze_loop_operations. Outer loop vectorisation reduces the number of times that the inner loop is executed, so it wouldn't necessarily be valid to leave the scalar x_3 in place for all vectorisable x_2. There's already code to forbid that when x_1 isn't present: /* FORNOW: we currently don't support the case that these phis are not used in the outerloop (unless it is double reduction, i.e., this phi is vect_reduction_def), cause this case requires to actually do something here. */ I think we need to do the same if x_1 is present but not relevant. 2018-01-19 Richard Sandiford <richard.sandiford@linaro.org> gcc/ PR tree-optimization/83922 * tree-vect-loop.c (vect_verify_full_masking): Return false if there are no statements that need masking. (vect_active_double_reduction_p): New function. (vect_analyze_loop_operations): Use it when handling phis that are not in the loop header. gcc/testsuite/ PR tree-optimization/83922 * gcc.dg/pr83922.c: New test. From-SVN: r256885
2018-01-19Avoid ICE for nested inductions (PR 83914)Richard Sandiford4-27/+50
This testcase ICEd because we converted the initial value of an induction to the vector element type even for nested inductions. This isn't necessary because the initial expression is vectorised normally, and it meant that init_expr was no longer the original statement operand by the time we called vect_get_vec_def_for_operand. Also, adding the conversion code here made the existing SLP conversion redundant. 2018-01-19 Richard Sandiford <richard.sandiford@linaro.org> gcc/ PR tree-optimization/83914 * tree-vect-loop.c (vectorizable_induction): Don't convert init_expr or apply the peeling adjustment for inductions that are nested within the vectorized loop. gcc/testsuite/ PR tree-optimization/83914 * gcc.dg/vect/pr83914.c: New test. From-SVN: r256884
2018-01-19[arm] Fix gcc.target/arm/negdi-[12].cKyrylo Tkachov6-6/+15
These tests are failing for a silly reason. They scan for an occurrence of the NEGS instruction. NEGS (and NEG in general) is a pre-UAL alias of RSB with an immediate of 0 and we only emit it in one pattern: *thumb2_negsi2_short in thumb2.md. In all other instances of negation we emit the modern RSB mnemonic. This causes needless differences in assembly output. For example, for these testcases we emit NEG when compiling for -march=armv7-a, but for armv7ve we emit RSB, causing the scan-assembler tests to fail. This patch updates the *thumb2_negsi2_short pattern to use the RSB mnemonic and fixes the flaky scan-assembler directives. These tests now pass for my compiler configured with: --with-cpu=cortex-a15 --with-fpu=neon-vfpv4 --with-float=hard --with-mode=thumb Bootstrapped and tested on arm-none-linux-gnueabihf as well. * config/arm/thumb2.md (*thumb2_negsi2_short): Use RSB mnemonic instead of NEG. * gcc.target/arm/negdi-1.c: Remove bogus assembler scan for negs. * gcc.target/arm/negdi-2.c: Likewise. * gcc.target/arm/thumb-16bit-ops.c: Replace scan for NEGS with RSBS. --This line,gand those below, will be ignored-- M gcc/config/arm/thumb2.md M gcc/ChangeLog M gcc/testsuite/gcc.target/arm/thumb-16bit-ops.c M gcc/testsuite/gcc.target/arm/negdi-1.c M gcc/testsuite/gcc.target/arm/negdi-2.c M gcc/testsuite/ChangeLog From-SVN: r256881
2018-01-19[arm] Fix gcc.target/arm/pr40956.cKyrylo Tkachov2-2/+5
The scan-assembler tests here check for MOVS for Thumb1 and MOV for Thumb2, but in fact there's no reason why we wouldn't generate MOVS for Thumb2 as well, it really depends on a lot of optimisation decisions. The only behaviour we want to test is that we move a 0 constant into a register only once, which can be achieved with either MOV or MOVS. Simplify the check by always checking for either MOV or MOVS. * gcc.target/arm/pr40956.c: Adjust scan-assembler pattern. From-SVN: r256880