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: PATCH to split up cpp_read_main_file


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);
}

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