From 6728ee79872ffd3dbcf858dab076c96c71ec95e5 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 8 Oct 2009 16:03:11 +0000 Subject: re PR middle-end/41573 (segfault in trunk related to strings) PR middle-end/41573 * builtins.c (fold_builtin_isascii): Use fold_build2. (fold_builtin_isdigit): Ditto. * except.c (duplicate_eh_regions_1): Tolerate NULL labels. * tree-cfg.c (struct rus_data, remove_useless_stmts_warn_notreached, remove_useless_stmts_cond, remove_useless_stmts_tf, remove_useless_stmts_tc, remove_useless_stmts_bind, remove_useless_stmts_goto, remove_useless_stmts_label, remove_useless_stmts_1, remove_useless_stmts, pass_remove_useless_stmts): Remove. * tree-pass.h (pass_remove_useless_stmts): Don't declare. * passes.c (init_optimization_passes): Don't add pass_remove_useless_stmts. * tree-eh.c (lower_eh_constructs_2): Handle empty cleanups. * tree.c (free_lang_data_in_decl): Don't clear DECL_INITIAL of static constants. * lto-symtab.c (lto_symtab_register_decl): Accepts DECL_INITIAL for static constants. * lto-streamer-out.c (output_gimple_stmt): Handle GIMPLE_NOP. * lto-streamer-in.c (input_gimple_stmt): Handle GIMPLE_NOP. testsuite/ * gcc.dg/tree-ssa/foldstring-1.c: Use fre dump. * gcc.dg/tree-ssa/useless-1.c: Use gimple dump. * gcc.dg/pr41573.c: New test. From-SVN: r152563 --- gcc/lto-symtab.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/lto-symtab.c') diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index 7d304484..2a0783a 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -323,8 +323,10 @@ lto_symtab_register_decl (tree decl, && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL) && DECL_ASSEMBLER_NAME_SET_P (decl)); - if (TREE_CODE (decl) == VAR_DECL) - gcc_assert (!(DECL_EXTERNAL (decl) && DECL_INITIAL (decl))); + if (TREE_CODE (decl) == VAR_DECL + && DECL_INITIAL (decl)) + gcc_assert (!DECL_EXTERNAL (decl) + || (TREE_STATIC (decl) && TREE_READONLY (decl))); if (TREE_CODE (decl) == FUNCTION_DECL) gcc_assert (!DECL_ABSTRACT (decl)); -- cgit v1.1