summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-23 05:52:37 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-23 05:52:37 +0000
commit6f7111d236be1c7d97f3f9d8d1bc1bfa1c4c387e (patch)
treeba92bf163fa4223390a08c190b2807a9cafe6cd5
parenta50f224518a13f3df6a702b32958205ebcb54c87 (diff)
downloadppe42-gcc-6f7111d236be1c7d97f3f9d8d1bc1bfa1c4c387e.tar.gz
ppe42-gcc-6f7111d236be1c7d97f3f9d8d1bc1bfa1c4c387e.zip
* read-rtl.c (read_rtx): Tidy use of format_ptr.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86403 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/read-rtl.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3639ad68c90..c442371f657 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2004-08-23 Richard Sandiford <rsandifo@redhat.com>
+ * read-rtl.c (read_rtx): Tidy use of format_ptr.
+
+2004-08-23 Richard Sandiford <rsandifo@redhat.com>
+
* read-rtl.c (string_obstack): New file-scope variable.
(read_string, read_quoted_string, read_braced_string)
(read_escape): Remove obstack parameter and use string_obstack instead.
diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
index 57bdfa00966..2b9bd915d23 100644
--- a/gcc/read-rtl.c
+++ b/gcc/read-rtl.c
@@ -598,8 +598,8 @@ again:
else
ungetc (i, infile);
- for (i = 0; i < GET_RTX_LENGTH (GET_CODE (return_rtx)); i++)
- switch (*format_ptr++)
+ for (i = 0; format_ptr[i] != 0; i++)
+ switch (format_ptr[i])
{
/* 0 means a field for internal use only.
Don't expect it to be present in the input. */
@@ -668,7 +668,7 @@ again:
/* 'S' fields are optional and should be NULL if no string
was given. Also allow normal 's' and 'T' strings to be
omitted, treating them in the same way as empty strings. */
- XSTR (return_rtx, i) = (format_ptr[-1] == 'S' ? NULL : "");
+ XSTR (return_rtx, i) = (format_ptr[i] == 'S' ? NULL : "");
break;
}
@@ -676,7 +676,7 @@ again:
DEFINE_INSN_AND_SPLIT, or DEFINE_PEEPHOLE automatically
gets a star inserted as its first character, if it is
written with a brace block instead of a string constant. */
- star_if_braced = (format_ptr[-1] == 'T');
+ star_if_braced = (format_ptr[i] == 'T');
stringbuf = read_string (infile, star_if_braced);
@@ -741,7 +741,7 @@ again:
default:
fprintf (stderr,
"switch format wrong in rtl.read_rtx(). format was: %c.\n",
- format_ptr[-1]);
+ format_ptr[i]);
fprintf (stderr, "\tfile position: %ld\n", ftell (infile));
abort ();
}
OpenPOWER on IntegriCloud