From d88259d140c0f82745f460e659b0266fa3eb67f7 Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Sun, 23 Jul 2006 17:56:34 +0000 Subject: [PATCH] re PR debug/25468 (-g makes g++ loop forever) 2006-07-23 Steven Bosscher PR debug/25468 * config/elfos.h (ASM_OUTPUT_ASCII): Remove 'register' marks. Cache the last found '\0' marker to avoid quadratic behavior. From-SVN: r115685 --- gcc/ChangeLog | 6 ++++++ gcc/config/elfos.h | 19 +++++++++++++------ gcc/fortran/ChangeLog | 2 +- .../execute/der_init_4.f90 | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index de9be71ced1..d52141a0931 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-07-23 Steven Bosscher + + PR debug/25468 + * config/elfos.h (ASM_OUTPUT_ASCII): Remove 'register' marks. + Cache the last found '\0' marker to avoid quadratic behavior. + 2006-07-23 Jan Hubicka * i386.md (subsi_3_zext): Fix output template. 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) \ { \ diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ad63dd19bbb..13ba6113660 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,6 +1,6 @@ 2006-07-22 Steven Bosscher - PR fortran/28439 + PR fortran/28439 * trans-stmt.c (gfc_trans_arithmetic_if): Evaluate the condition once. 2006-07-16 Jakub Jelinek diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/der_init_4.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/der_init_4.f90 index 2b136207aa8..644ef65e1ab 100644 --- a/gcc/testsuite/gfortran.fortran-torture/execute/der_init_4.f90 +++ b/gcc/testsuite/gfortran.fortran-torture/execute/der_init_4.f90 @@ -1,5 +1,5 @@ ! PR13930 -! We were trying to assugn a default initializer to dummy variables. +! We were trying to assign a default initializer to dummy variables. program der_init_4 type t integer :: i = 42 -- 2.30.2