This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: Fix pch/system-1.c failures for systems with non-trivial BUILD_VA_LIST_TYPE
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 02 Jun 2003 22:23:07 +0100
- Subject: RFA: Fix pch/system-1.c failures for systems with non-trivial BUILD_VA_LIST_TYPE
- Organization: SuperH UK Ltd.
I have found that pch/system-1.c fails on sh-elf because
the function that is called by BUILD_VA_LIST_TYPE generates
some declarations which end up in the debugging output for
this testcase. toplev.c has previously set the input filename
to that of the main file - which is different when you compile
a header than when you do an ordinary source compilation.
This causes an anadorned "system-1.h" to be considered among
the source files in the pch case (even though it does nothing
but include other header files). When dwarf2out sees an input
file without a dir separator, it puts the current working directory
in the list of directories to search.
--
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658
2003-06-02 J"orn Rennecke <joern.rennecke@superh.com>
* c-decl.c (c_init_decl_processing): Clear input_file_name
while building common nodes.
* dwarf2out.c (gen_compile_unit_die, dwarf2out_finish):
Don't add working directory for <built-in> .
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.390
diff -p -r1.390 c-decl.c
*** c-decl.c 22 May 2003 19:39:13 -0000 1.390
--- c-decl.c 2 Jun 2003 21:08:58 -0000
*************** c_init_decl_processing ()
*** 2266,2271 ****
--- 2266,2272 ----
{
tree endlink;
tree ptr_ftype_void, ptr_ftype_ptr;
+ const char *save_input_filename;
/* Adds some ggc roots, and reserved words for c-parse.in. */
c_parse_init ();
*************** c_init_decl_processing ()
*** 2278,2283 ****
--- 2279,2289 ----
/* Make the binding_level structure for global names. */
pushlevel (0);
global_binding_level = current_binding_level;
+ /* Declarations from c_common_nodes_and_builtins must not be associated
+ with this input file, lest we get differences between using and not
+ using preprocessed headers. */
+ save_input_filename = input_filename;
+ input_filename = NULL;
build_common_tree_nodes (flag_signed_char);
*************** c_init_decl_processing ()
*** 2304,2309 ****
--- 2310,2317 ----
ptr_ftype_ptr
= build_function_type (ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node, endlink));
+
+ input_filename = save_input_filename;
pedantic_lvalues = pedantic;
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.426
diff -p -r1.426 dwarf2out.c
*** dwarf2out.c 20 May 2003 01:49:11 -0000 1.426
--- dwarf2out.c 2 Jun 2003 21:08:59 -0000
*************** gen_compile_unit_die (filename)
*** 11491,11497 ****
if (filename)
{
add_name_attribute (die, filename);
! if (filename[0] != DIR_SEPARATOR)
add_comp_dir_attribute (die);
}
--- 11491,11497 ----
if (filename)
{
add_name_attribute (die, filename);
! if (filename[0] != DIR_SEPARATOR && strcmp (filename, "<built-in>") != 0)
add_comp_dir_attribute (die);
}
*************** dwarf2out_finish (filename)
*** 13082,13088 ****
{
size_t i;
for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
! if (VARRAY_CHAR_PTR (file_table, i)[0] != DIR_SEPARATOR)
{
add_comp_dir_attribute (comp_unit_die);
break;
--- 13082,13089 ----
{
size_t i;
for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
! if (VARRAY_CHAR_PTR (file_table, i)[0] != DIR_SEPARATOR
! && strcmp (VARRAY_CHAR_PTR (file_table, i), "<built-in>") != 0)
{
add_comp_dir_attribute (comp_unit_die);
break;