This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to split up cpp_read_main_file
- From: Per Bothner <per at bothner dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 06 Aug 2003 14:53:51 -0700
- Subject: Re: PATCH to split up cpp_read_main_file
- References: <1A7C2D25-C770-11D7-B015-000393A6D2F2@physics.uc.edu>
Andrew Pinski wrote:
It was not working before his patch any way.
It was broken by <http://gcc.gnu.org/ml/gcc-patches/2003-08/msg00081.html>.
Here is a test-case that might be easier (certainly faster)
than bootsrapping with --enable-intermodule.
Just do:
cc1 Csrc1.c Csrc2.c -o Ctest.s
gcc -o Ctest Ctest.s
./Ctest
This should work. It doesn't with the current head, at least with my
(un-checked-in) patch. (It is possible the fault is my patch, but I
think Zack's patch is more likely to blame.)
If it doesn't work, running gdb on cc1 should be relatively easy.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
#ifndef CHDR1_H
#define CHDR1_H
#define INT int
typedef long Long;
extern Long twice(INT);
/*inline char* get_format1() { return "twice(12) is %ld\n"; }*/
#define get_format1() "twice(12) is %ld\n"
#ifndef IS_SRC_1
extern int twelve;
#endif
#endif
#define IS_SRC_1 1
#include "Chdr1.h"
int twelve = 12;
static int two = 2;
char *
dummy()
{
return get_format1();
}
Long twice(INT x)
{
return two * x;
}
int INT = 10;
#include "Chdr1.h"
/*#include <stdio.h>*/
static int two = -1;
int main()
{
INT i12 = twelve;
Long t12 = twice (i12) + two + 1;
printf (get_format1(), t12);
}