diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-03-04 21:28:27 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-03-04 21:28:27 +0100 |
commit | 602045546463f33fb426f6f623ece65fb41b907e (patch) | |
tree | bfacbc66a21eb158218197fefa57e7ab1f9485c2 | |
parent | f79d4eabaf2646be0090458dfa6b94dabf82ca8e (diff) | |
download | gcc-602045546463f33fb426f6f623ece65fb41b907e.zip gcc-602045546463f33fb426f6f623ece65fb41b907e.tar.gz gcc-602045546463f33fb426f6f623ece65fb41b907e.tar.bz2 |
re PR target/70062 (ICE: in decide_alg, at config/i386/i386.c:26173 with -mmemcpy-strategy=libcall)
PR target/70062
* config/i386/i386.c (decide_alg): Add RECUR argument. Revert
2016-02-22 changes, instead don't recurse if RECUR is already true.
Don't change *dynamic_check if RECUR. Adjust recursive caller
to pass true to the new argument.
(ix86_expand_set_or_movmem): Adjust decide_alg caller.
* gcc.target/i386/pr70062.c: New test.
From-SVN: r233979
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 28 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr70062.c | 11 |
4 files changed, 36 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a65e347..ea4e2d5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2016-03-04 Jakub Jelinek <jakub@redhat.com> + PR target/70062 + * config/i386/i386.c (decide_alg): Add RECUR argument. Revert + 2016-02-22 changes, instead don't recurse if RECUR is already true. + Don't change *dynamic_check if RECUR. Adjust recursive caller + to pass true to the new argument. + (ix86_expand_set_or_movmem): Adjust decide_alg caller. + PR target/70059 * config/i386/sse.md (vec_set_lo_<mode><mask_name>, <extract_type_2>_vinsert<shuffletype><extract_suf_2>_mask): Formatting diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 8a026ae..1f98d5b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -26032,14 +26032,13 @@ static enum stringop_alg decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, unsigned HOST_WIDE_INT min_size, unsigned HOST_WIDE_INT max_size, bool memset, bool zero_memset, bool have_as, - int *dynamic_check, bool *noalign) + int *dynamic_check, bool *noalign, bool recur) { const struct stringop_algs *algs; bool optimize_for_speed; int max = 0; const struct processor_costs *cost; int i; - HOST_WIDE_INT orig_expected_size = expected_size; bool any_alg_usable_p = false; *noalign = false; @@ -26157,19 +26156,18 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, enum stringop_alg alg; HOST_WIDE_INT new_expected_size = (max > 0 ? max : 4096) / 2; - /* If there aren't any usable algorithms or if recursing with the - same arguments as before, then recursing on smaller sizes or - same size isn't going to find anything. Just return the simple - byte-at-a-time copy loop. */ - if (!any_alg_usable_p || orig_expected_size == new_expected_size) - { - /* Pick something reasonable. */ - if (TARGET_INLINE_STRINGOPS_DYNAMICALLY) - *dynamic_check = 128; - return loop_1_byte; - } + /* If there aren't any usable algorithms or if recursing already, + then recursing on smaller sizes or same size isn't going to + find anything. Just return the simple byte-at-a-time copy loop. */ + if (!any_alg_usable_p || recur) + { + /* Pick something reasonable. */ + if (TARGET_INLINE_STRINGOPS_DYNAMICALLY && !recur) + *dynamic_check = 128; + return loop_1_byte; + } alg = decide_alg (count, new_expected_size, min_size, max_size, memset, - zero_memset, have_as, dynamic_check, noalign); + zero_memset, have_as, dynamic_check, noalign, true); gcc_assert (*dynamic_check == -1); if (TARGET_INLINE_STRINGOPS_DYNAMICALLY) *dynamic_check = max; @@ -26430,7 +26428,7 @@ ix86_expand_set_or_movmem (rtx dst, rtx src, rtx count_exp, rtx val_exp, alg = decide_alg (count, expected_size, min_size, probable_max_size, issetmem, issetmem && val_exp == const0_rtx, have_as, - &dynamic_check, &noalign); + &dynamic_check, &noalign, false); if (alg == libcall) return false; gcc_assert (alg != no_stringop); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 84c4275..763364f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-03-04 Jakub Jelinek <jakub@redhat.com> + + PR target/70062 + * gcc.target/i386/pr70062.c: New test. + 2016-03-04 H.J. Lu <hongjiu.lu@intel.com> * g++.dg/template/typename21.C: Remove c++98_only. diff --git a/gcc/testsuite/gcc.target/i386/pr70062.c b/gcc/testsuite/gcc.target/i386/pr70062.c new file mode 100644 index 0000000..e5cb854 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr70062.c @@ -0,0 +1,11 @@ +/* PR target/70062 */ +/* { dg-options "-minline-all-stringops -minline-stringops-dynamically -mmemcpy-strategy=libcall:-1:noalign -Wno-psabi" } */ +/* { dg-additional-options "-mtune=k6-2" { target ia32 } } */ + +typedef int V __attribute__ ((vector_size (32))); + +V +foo (V x) +{ + return (V) { x[0] }; +} |