diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-23 17:56:34 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-23 17:56:34 +0000 |
commit | 500973f9e37df5690e1b533264ac680160972f82 (patch) | |
tree | e0887a2560fec0a0e8b3c179f750ffe3d3ab7f18 /gcc/config/elfos.h | |
parent | d3e7b04c71b033554413956b1c787fe6e1809eef (diff) | |
download | gcc-500973f9e37df5690e1b533264ac680160972f82.tar.gz |
2006-07-23 Steven Bosscher <steven@gcc.gnu.org>
PR debug/25468
* config/elfos.h (ASM_OUTPUT_ASCII): Remove 'register' marks.
Cache the last found '\0' marker to avoid quadratic behavior.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115685 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/elfos.h')
-rw-r--r-- | gcc/config/elfos.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h index 31e309d9b07..a2bd49f909a 100644 --- a/gcc/config/elfos.h +++ b/gcc/config/elfos.h @@ -429,14 +429,15 @@ Boston, MA 02110-1301, USA. */ #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \ do \ { \ - register const unsigned char *_ascii_bytes = \ + const unsigned char *_ascii_bytes = \ (const unsigned char *) (STR); \ - register const unsigned char *limit = _ascii_bytes + (LENGTH); \ - register unsigned bytes_in_chunk = 0; \ + const unsigned char *limit = _ascii_bytes + (LENGTH); \ + const unsigned char *last_null = NULL; \ + unsigned bytes_in_chunk = 0; \ \ for (; _ascii_bytes < limit; _ascii_bytes++) \ { \ - register const unsigned char *p; \ + const unsigned char *p; \ \ if (bytes_in_chunk >= 60) \ { \ @@ -444,8 +445,14 @@ Boston, MA 02110-1301, USA. */ bytes_in_chunk = 0; \ } \ \ - for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \ - continue; \ + if (_ascii_bytes > last_null) \ + { \ + for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \ + continue; \ + last_null = p; \ + } \ + else \ + p = last_null; \ \ if (p < limit && (p - _ascii_bytes) <= (long)STRING_LIMIT) \ { \ |