diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-10 22:30:02 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-10 22:30:02 +0000 |
commit | 5aad2fa1049adc3ef2a3d0634cebe6d7282f8d30 (patch) | |
tree | 8e749f899be5b475f7eabcd7ed59d5c5a699c7e2 /gcc/config/i386/i386.c | |
parent | e20ab4012af75586700f1d945026d32cb58f6901 (diff) | |
download | gcc-5aad2fa1049adc3ef2a3d0634cebe6d7282f8d30.tar.gz |
PR target/34403
* config/i386/i386.c (ix86_expand_movmem): Punt if the count is large.
(ix86_expand_setmem): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130753 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/i386.c')
-rw-r--r-- | gcc/config/i386/i386.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 9d2c14438a9..ebbf48957ba 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -15282,7 +15282,7 @@ smallest_pow2_greater_than (int val) } /* Expand string move (memcpy) operation. Use i386 string operations when - profitable. expand_clrmem contains similar code. The code depends upon + profitable. expand_setmem contains similar code. The code depends upon architecture, block size and alignment, but always has the same overall structure: @@ -15333,6 +15333,10 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, if (CONST_INT_P (expected_size_exp) && count == 0) expected_size = INTVAL (expected_size_exp); + /* Make sure we don't need to care about overflow later on. */ + if (count > ((unsigned HOST_WIDE_INT) 1 << 30)) + return 0; + /* Step 0: Decide on preferred algorithm, desired alignment and size of chunks to be copied by main loop. */ @@ -15657,6 +15661,10 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, if (CONST_INT_P (expected_size_exp) && count == 0) expected_size = INTVAL (expected_size_exp); + /* Make sure we don't need to care about overflow later on. */ + if (count > ((unsigned HOST_WIDE_INT) 1 << 30)) + return 0; + /* Step 0: Decide on preferred algorithm, desired alignment and size of chunks to be copied by main loop. */ |