summaryrefslogtreecommitdiff
path: root/gcc/config/i386
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-16 20:45:25 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-16 20:45:25 +0000
commitb6073eb2c52c702b92624e0f355ec5103387f507 (patch)
tree600297ba5e05c6243f0431610c893cf0b80f82c0 /gcc/config/i386
parentc1892ae1775888ee2236670c50aaa4c40148ebb3 (diff)
downloadgcc-b6073eb2c52c702b92624e0f355ec5103387f507.tar.gz
* config/i386/i386.c (decide_alg): Correctly handle
maximum size of stringop algorithm. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211714 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386')
-rw-r--r--gcc/config/i386/i386.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 33226a9f935..77d54e5bcb7 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -23832,7 +23832,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size,
{
const struct stringop_algs * algs;
bool optimize_for_speed;
- int max = -1;
+ int max = 0;
const struct processor_costs *cost;
int i;
bool any_alg_usable_p = false;
@@ -23870,7 +23870,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size,
/* If expected size is not known but max size is small enough
so inline version is a win, set expected size into
the range. */
- if (max > 1 && (unsigned HOST_WIDE_INT) max >= max_size
+ if (((max > 1 && (unsigned HOST_WIDE_INT) max >= max_size) || max == -1)
&& expected_size == -1)
expected_size = min_size / 2 + max_size / 2;
@@ -23959,7 +23959,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size,
*dynamic_check = 128;
return loop_1_byte;
}
- if (max == -1)
+ if (max <= 0)
max = 4096;
alg = decide_alg (count, max / 2, min_size, max_size, memset,
zero_memset, dynamic_check, noalign);