This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [distcc] gcc bootstraps with distcc


On Aug  5, 2003, "Mark Mitchell" <mark@codesourcery.com> wrote:

> If this is approved for mainline, it is OK for 3.3.2, once the branch
> reopens.

> From: "Alexandre Oliva" <aoliva@redhat.com>
> Sent: Monday, August 04, 2003 9:54 AM

>> Mark, any chance of having this in the 3.3 branch as well, after 3.3.1
>> is released?

>> On Aug  4, 2003, Alexandre Oliva <aoliva@redhat.com> wrote:

>> > Index: gcc/ChangeLog
>> > from  Alexandre Oliva  <aoliva@redhat.com>
>> 
>> > * c-ppoutput.c (cb_line_change): Don't skip line changing while
>> > parsing macro arguments in the top-level context.

Ok, I've finally tested this patch in the 3.3 branch, so I'm checking
it in.

I'd like to take this opportunity to thank Neil and Zack for all the
time they have spent helping me get this and the other patch needed
for distcc to be usable for bootstrapping GCC, and for all their
patience putting up with me in all the times I got this -><- close to
losing my temper :-)  This was really appreciated, folks.

I also want to thank Mark, the GCC release manager, for having
considered both patches for the 3.3 branch, and for having approved
only the safest one.  Unfortunately, this means we'll have incorrect
comp_unit_dir in debug info produced by GCC 3.3 when using distcc, but
I have to agree with Mark that the patch was indeed a bit more
invasive than desirable for a stable release.  It will be in 3.4,
though, along with the new -f[no-]working-directory preprocessor
command-line switches used to control it.

Meanwhile, this patch, that I've just installed in the 3.3 branch,
will at least get us the same line numbers in debug information and
error messages, which is already a nice improvement for users of
ccache and distcc.  It will be in GCC 3.3.2.


Oh, and before I forget, I'd like to apologize once again to the
distcc mailing list for all the e-mails in this subject that I and
others unintentionally Cc:ed to it.  This is hopefully the last of
them, that I thought I would Cc: to let you all know that this long
story had a happy ending :-)


Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* cppmain.c (cb_line_change): Don't skip line changing while
	parsing macro arguments in the top-level context.

Index: gcc/cppmain.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/cppmain.c,v
retrieving revision 1.105
diff -u -p -r1.105 cppmain.c
--- gcc/cppmain.c 8 Nov 2002 20:15:05 -0000 1.105
+++ gcc/cppmain.c 22 Aug 2003 19:43:54 -0000
@@ -1,5 +1,5 @@
 /* Preprocess only, using cpplib.
-   Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
    Written by Per Bothner, 1994-95.
 
@@ -284,9 +284,9 @@ static void
 cb_line_change (pfile, token, parsing_args)
      cpp_reader *pfile;
      const cpp_token *token;
-     int parsing_args;
+     int parsing_args ATTRIBUTE_UNUSED;
 {
-  if (token->type == CPP_EOF || parsing_args)
+  if (token->type == CPP_EOF)
     return;
 
   maybe_print_line (pfile, pfile->print.map, token->line);
Index: gcc/testsuite/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* gcc.dg/cpp/separate-1.c: New test.
	* gcc.dg/cpp/spacing1.c: Update.

Index: gcc/testsuite/gcc.dg/cpp/separate-1.c
===================================================================
RCS file: gcc/testsuite/gcc.dg/cpp/separate-1.c
diff -N gcc/testsuite/gcc.dg/cpp/separate-1.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/gcc.dg/cpp/separate-1.c 22 Aug 2003 19:44:01 -0000
@@ -0,0 +1,12 @@
+/* Copyright 2003 Free Software Foundation.  */
+
+/* { dg-do compile } */
+/* { dg-options "-save-temps" } */
+
+/* Make sure we report errors in the right line, even if separate
+   preprocessing is used.  */
+
+#define FOO()
+
+int FOO(
+	), bar; /* { dg-error "(parse|syntax) error" "error on this line" } */
Index: gcc/testsuite/gcc.dg/cpp/spacing1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/spacing1.c,v
retrieving revision 1.3
diff -u -p -r1.3 spacing1.c
--- gcc/testsuite/gcc.dg/cpp/spacing1.c 8 Oct 2001 06:15:14 -0000 1.3
+++ gcc/testsuite/gcc.dg/cpp/spacing1.c 22 Aug 2003 19:44:01 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.  */
+/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
 
@@ -10,6 +10,19 @@
 
    Neil Booth, 1 Dec 2000, 23 Sep 2001.  */
 
+/* The actual location of the expansion of a multi-line macro
+   invocation is not defined: we might consider them to be in the same
+   line as the initial token of the invocation, or as the final token
+   of the invocation, or even anything in between.  We choose to make
+   it the final token, but we might as well collapse the invocation
+   and the rest of the line into the initial line, such that `g
+   ... bam baz' below were all in a single line in the preprocessor
+   output.  We used to do this at some point, but it disagreed with
+   the way we numbered lines with the integrated preprocessor, so we
+   had to pick one of them to change.
+
+   Alexandre Oliva, Aug 5, 2003.  */
+
 #define str(x) #x
 #define f(x) x
 #define glue(x, y) x ## y
@@ -28,8 +41,12 @@
 B Q B Q A Q A:
 f
 bar
-g "1 2" bam baz
+g
+
+
 
+ "1 2"
+ bam baz
 */
 
 glue (EMPTY 4, 4) EMPTY;
@@ -49,7 +66,9 @@ f (g) str
    { dg-final { if \{ [grep spacing1.i "B Q B Q A Q A:"] != "" \}     \{  } }
    { dg-final { if \{ [grep spacing1.i "f.*bar"] == "" \} \{              } }
    { dg-final { if \{ [grep spacing1.i "^bar"] != "" \}   \{              } }
-   { dg-final { if \{ [grep spacing1.i "g \"1 2\" bam baz"] != "" \} \{   } }
-   { dg-final { return \} \} \} \} \}                                     } }
+   { dg-final { if \{ [grep spacing1.i "g"] != "" \} \{                   } }
+   { dg-final { if \{ [grep spacing1.i " \"1 2\""] != "" \} \{            } }
+   { dg-final { if \{ [grep spacing1.i " bam baz"] != "" \} \{            } }
+   { dg-final { return \} \} \} \} \} \} \}                               } }
    { dg-final { fail "spacing1.c: spacing and new-line preservation"      } }
 */
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]