On Mon, 28 Nov 2011, Andrew MacLeod wrote: > OK, here's a reworked patch. This bootstraps but there is a regression... one > set of PCH tests fail in a very odd way. I've investigated it and it turns out > that for some reason, ptr_type_node doesn't always have it size set if code > isn't being generated (all the other nodes do)... in particular I can > reproduce it on a small test case on my x86-64 machine where size is 8 when > generating code, and 0 if -E is used to output pre-processed source. I'm > looking into that today.
That would be why cppbuiltin.c, defining __SIZEOF_POINTER__, needs to use the POINTER_SIZE macro instead of directly using ptr_type_node. You may need to do something similar. /* ptr_type_node can't be used here since ptr_mode is only set when toplev calls backend_init which is not done with -E switch. */ cpp_define_formatted (pfile, "__SIZEOF_POINTER__=%d", POINTER_SIZE / BITS_PER_UNIT); > Question, the purpose of the testcase in the patch macros.c... is it to > simply test for standard compliance, or to test both compliance PLUS what we > expect? I made the change assuming the latter. We will always generate a 1 > or a 2 for the macros, and we also want the macros to now be compile time > satisfied so they can be used in #if statements like bkoz was trying to do. Yes, test that the macros do what we expect. -- Joseph S. Myers jos...@codesourcery.com