This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch committed] Fix build failure on SH
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 08 Jun 2010 07:17:46 +0900 (JST)
- Subject: [patch committed] Fix build failure on SH
SH fails to build after revision 160347 with
/exp/ldroot/dodes/xsh-gcc-orig/./gcc/xgcc -shared-libgcc -B/exp/ldroot/dodes/xsh-gcc-orig/./gcc -nostdinc++ -L/exp/ldroot/dodes/xsh-gcc-orig/sh4-unknown-linux-gnu/libstdc++-v3/src -L/exp/ldroot/dodes/xsh-gcc-orig/sh4-unknown-linux-gnu/libstdc++-v3/src/.libs -B/usr/local/sh4-unknown-linux-gnu/bin/ -B/usr/local/sh4-unknown-linux-gnu/lib/ -isystem /usr/local/sh4-unknown-linux-gnu/include -isystem /usr/local/sh4-unknown-linux-gnu/sys-include -x c++-header -g -O2 -D_GNU_SOURCE -I/exp/ldroot/dodes/xsh-gcc-orig/sh4-unknown-linux-gnu/libstdc++-v3/include/sh4-unknown-linux-gnu -I/exp/ldroot/dodes/xsh-gcc-orig/sh4-unknown-linux-gnu/libstdc++-v3/include -I/exp/ldroot/dodes/ORIG/trunk/libstdc++-v3/libsupc++ -O2 -g -std=gnu++0x /exp/ldroot/dodes/ORIG/trunk/libstdc++-v3/include/precompiled/stdc++.h \
-o sh4-unknown-linux-gnu/bits/stdc++.h.gch/O2ggnu++0x.gch
In file included from /exp/ldroot/dodes/xsh-gcc-orig/sh4-unknown-linux-gnu/libstdc++-v3/include/cstdarg:44:0,
from /exp/ldroot/dodes/ORIG/trunk/libstdc++-v3/include/precompiled/stdc++.h:45:
/exp/ldroot/dodes/xsh-gcc-orig/./gcc/include/stdarg.h:40:27: internal compiler error: Segmentation fault
A one liner
typedef __builtin_va_list __gnuc_va_list;
is a reduced test case. It seems that sh_build_builtin_va_list
returns a tree without setting its type name and it makes
the generic dwarf code added at 160347 unhappy. The attached
patch is to fix the above build failure with setting that type
name correctly. Applied on trunk.
Regards,
kaz
--
2010-06-07 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (sh_build_builtin_va_list): Set tree type
name of RECORD.
diff -up ORIG/trunk/gcc/config/sh/sh.c trunk/gcc/config/sh/sh.c
--- ORIG/trunk/gcc/config/sh/sh.c 2010-05-22 07:48:21.000000000 +0900
+++ trunk/gcc/config/sh/sh.c 2010-06-07 18:21:21.000000000 +0900
@@ -7636,13 +7636,15 @@ static tree
sh_build_builtin_va_list (void)
{
tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
- tree record;
+ tree record, type_decl;
if (TARGET_SH5 || (! TARGET_SH2E && ! TARGET_SH4)
|| TARGET_HITACHI || sh_cfun_attr_renesas_p ())
return ptr_type_node;
record = (*lang_hooks.types.make_type) (RECORD_TYPE);
+ type_decl = build_decl (BUILTINS_LOCATION,
+ TYPE_DECL, get_identifier ("__va_list_tag"), record);
f_next_o = build_decl (BUILTINS_LOCATION,
FIELD_DECL, get_identifier ("__va_next_o"),
@@ -7668,6 +7670,8 @@ sh_build_builtin_va_list (void)
DECL_FIELD_CONTEXT (f_next_fp_limit) = record;
DECL_FIELD_CONTEXT (f_next_stack) = record;
+ TREE_CHAIN (record) = type_decl;
+ TYPE_NAME (record) = type_decl;
TYPE_FIELDS (record) = f_next_o;
TREE_CHAIN (f_next_o) = f_next_o_limit;
TREE_CHAIN (f_next_o_limit) = f_next_fp;