This commit is contained in:
Jakub Jelinek 2006-08-16 18:28:12 +00:00
parent 65b2441465
commit 56455ee78d
4 changed files with 90 additions and 2 deletions

View File

@ -1 +1 @@
gcc-4.1.1-20060811.tar.bz2 gcc-4.1.1-20060816.tar.bz2

84
gcc41-pr28709.patch Normal file
View File

@ -0,0 +1,84 @@
2006-08-16 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/28709
* macro.c (paste_tokens): Do error reporting here, use BUF with the
spelled LHS token as opposed to spelling it again.
(paste_all_tokens): Don't report errors here, just break on failure.
* gcc.dg/cpp/paste14.c: New test.
--- libcpp/macro.c.jj 2006-06-09 23:07:54.000000000 +0200
+++ libcpp/macro.c 2006-08-16 17:30:17.000000000 +0200
@@ -430,15 +430,14 @@ stringify_arg (cpp_reader *pfile, macro_
static bool
paste_tokens (cpp_reader *pfile, const cpp_token **plhs, const cpp_token *rhs)
{
- unsigned char *buf, *end;
+ unsigned char *buf, *end, *lhsend;
const cpp_token *lhs;
unsigned int len;
- bool valid;
lhs = *plhs;
len = cpp_token_len (lhs) + cpp_token_len (rhs) + 1;
buf = (unsigned char *) alloca (len);
- end = cpp_spell_token (pfile, lhs, buf, false);
+ end = lhsend = cpp_spell_token (pfile, lhs, buf, false);
/* Avoid comment headers, since they are still processed in stage 3.
It is simpler to insert a space here, rather than modifying the
@@ -455,10 +454,22 @@ paste_tokens (cpp_reader *pfile, const c
/* Set pfile->cur_token as required by _cpp_lex_direct. */
pfile->cur_token = _cpp_temp_token (pfile);
*plhs = _cpp_lex_direct (pfile);
- valid = pfile->buffer->cur == pfile->buffer->rlimit;
- _cpp_pop_buffer (pfile);
+ if (pfile->buffer->cur != pfile->buffer->rlimit)
+ {
+ _cpp_pop_buffer (pfile);
+ _cpp_backup_tokens (pfile, 1);
+ *lhsend = '\0';
- return valid;
+ /* Mandatory error for all apart from assembler. */
+ if (CPP_OPTION (pfile, lang) != CLK_ASM)
+ cpp_error (pfile, CPP_DL_ERROR,
+ "pasting \"%s\" and \"%s\" does not give a valid preprocessing token",
+ buf, cpp_token_as_text (pfile, rhs));
+ return false;
+ }
+
+ _cpp_pop_buffer (pfile);
+ return true;
}
/* Handles an arbitrarily long sequence of ## operators, with initial
@@ -490,17 +501,7 @@ paste_all_tokens (cpp_reader *pfile, con
abort ();
if (!paste_tokens (pfile, &lhs, rhs))
- {
- _cpp_backup_tokens (pfile, 1);
-
- /* Mandatory error for all apart from assembler. */
- if (CPP_OPTION (pfile, lang) != CLK_ASM)
- cpp_error (pfile, CPP_DL_ERROR,
- "pasting \"%s\" and \"%s\" does not give a valid preprocessing token",
- cpp_token_as_text (pfile, lhs),
- cpp_token_as_text (pfile, rhs));
- break;
- }
+ break;
}
while (rhs->flags & PASTE_LEFT);
--- gcc/testsuite/gcc.dg/cpp/paste14.c.jj 2006-08-16 16:51:45.000000000 +0200
+++ gcc/testsuite/gcc.dg/cpp/paste14.c 2006-08-16 16:53:30.000000000 +0200
@@ -0,0 +1,7 @@
+/* PR preprocessor/28709 */
+/* { dg-do preprocess } */
+
+#define foo - ## >>
+foo /* { dg-error "pasting \"-\" and \">>\"" } */
+#define bar = ## ==
+bar /* { dg-error "pasting \"=\" and \"==\"" } */

View File

@ -143,6 +143,7 @@ Patch35: gcc41-pr28706.patch
Patch36: gcc41-pr28725.patch Patch36: gcc41-pr28725.patch
Patch37: gcc41-pr28709.patch Patch37: gcc41-pr28709.patch
Patch38: gcc41-pr28744.patch Patch38: gcc41-pr28744.patch
Patch39: gcc41-x86_64-kernel-ssp.patch
%define _gnu %{nil} %define _gnu %{nil}
%ifarch sparc %ifarch sparc
@ -462,6 +463,7 @@ which are required to run programs compiled with the GNAT.
%patch36 -p0 -b .pr28725~ %patch36 -p0 -b .pr28725~
%patch37 -p0 -b .pr28709~ %patch37 -p0 -b .pr28709~
%patch38 -p0 -b .pr28744~ %patch38 -p0 -b .pr28744~
%patch39 -p0 -b .x86_64-kernel-ssp~
sed -i -e 's/4\.1\.2/4.1.1/' gcc/BASE-VER gcc/version.c sed -i -e 's/4\.1\.2/4.1.1/' gcc/BASE-VER gcc/version.c
sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c
@ -1529,6 +1531,8 @@ fi
- merge gomp fixes from the trunk (-r116152:116154) - merge gomp fixes from the trunk (-r116152:116154)
- PRs middle-end/28713, middle-end/28724 - PRs middle-end/28713, middle-end/28724
- add -march=geode and -mtune=geode support (Vlad Makarov) - add -march=geode and -mtune=geode support (Vlad Makarov)
- use %gs rather than %fs register on x86_64 with
-mcmodel=kernel -fstack-protector (Arjan van de Ven, #202842)
- don't create jar manifest in libgcj-tools-4.*.jar (#200887) - don't create jar manifest in libgcj-tools-4.*.jar (#200887)
- externally_visible attribute fixes (Jan Hubicka, PRs c/25795, c++/27369) - externally_visible attribute fixes (Jan Hubicka, PRs c/25795, c++/27369)
- --combine fixes for aggregates with attributes (PRs c/28706, c/28712) - --combine fixes for aggregates with attributes (PRs c/28706, c/28712)

View File

@ -1 +1 @@
5ef7a43629890be560c67e4354701824 gcc-4.1.1-20060811.tar.bz2 3743f891cb127e18bca681d57c07a2c0 gcc-4.1.1-20060816.tar.bz2