From 21a427cca1eaaf8757782354be2f0917a89fea25 Mon Sep 17 00:00:00 2001 From: Alex Samuel Date: Wed, 22 Sep 1999 05:51:44 +0000 Subject: Various fixes for problems discovered stress-testing GC. * config/i386/i386.c (pic_label_name): Change to char pointer. (global_offset_table): New variable. (load_pic_register): Fill global_offset_table if it hasn't already been done. Allocate pic_label_name dynamically. * ggc.h (empty_string): New variable. * ggc-simple.c (empty_string): Likewise. (init_ggc): Allocate empty_string and add as root. * stmt.c (digit_strings): New variable. (init_stmt): Add last_block_end_note as root. Allocate and initialize digit_strings. (expand_asm_operands): Use empty_string and digit_string instead of string constants. * profile.c (init_arc_profiler): Allocate with ggc_alloc_string instead of xmalloc. (output_func_start_profiler): Likewise. * c-typeck.c (digest_init): Check if init is error_mark_node. From-SVN: r29575 --- gcc/stmt.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'gcc/stmt.c') diff --git a/gcc/stmt.c b/gcc/stmt.c index 6483da5..f2180bf 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -401,6 +401,9 @@ struct stmt_status /* Non-zero if we are using EH to handle cleanus. */ static int using_eh_for_cleanups_p = 0; +/* Character strings, each containing a single decimal digit. */ +static char *digit_strings[10]; + static int n_occurrences PROTO((int, const char *)); static void expand_goto_internal PROTO((tree, rtx, rtx)); @@ -592,7 +595,17 @@ mark_stmt_status (p) void init_stmt () { + int i; + gcc_obstack_init (&stmt_obstack); + ggc_add_rtx_root (&last_block_end_note, 1); + + for (i = 0; i < 10; i++) + { + digit_strings[i] = ggc_alloc_string (NULL, 1); + digit_strings[i][0] = '0' + i; + } + ggc_add_string_root (digit_strings, 10); } void @@ -1547,9 +1560,9 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) argvec = rtvec_alloc (ninputs); constraints = rtvec_alloc (ninputs); - body = gen_rtx_ASM_OPERANDS (VOIDmode, - TREE_STRING_POINTER (string), "", 0, argvec, - constraints, filename, line); + body = gen_rtx_ASM_OPERANDS (VOIDmode, TREE_STRING_POINTER (string), + empty_string, 0, argvec, constraints, + filename, line); MEM_VOLATILE_P (body) = vol; @@ -1717,14 +1730,12 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) /* For in-out operands, copy output rtx to input rtx. */ for (i = 0; i < ninout; i++) { - static char match[9+1][2] - = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; int j = inout_opnum[i]; XVECEXP (body, 3, ninputs - ninout + i) /* argvec */ = output_rtx[j]; XVECEXP (body, 4, ninputs - ninout + i) /* constraints */ - = gen_rtx_ASM_INPUT (inout_mode[i], match[j]); + = gen_rtx_ASM_INPUT (inout_mode[i], digit_strings[j]); } /* Now, for each output, construct an rtx -- cgit v1.1