From dc12b70ef2ff960820c183f4911c9d426e34eac3 Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Wed, 31 Mar 2010 02:44:10 +0000 Subject: re PR other/43562 (GCC ICE on optimize attribute) PR 43562 * reload.h (caller_save_initialized_p): Declare. * toplev.c (backend_init_target): Don't call init_caller_save but set caller_save_initialized_p to false. * caller-save.c (caller_save_initialized_p): Define. (init_caller_save): Check caller_save_initialized_p. * ira.c (ira): Call init_caller_save if flag_caller_saves. testsuite/ PR 43562 * gcc.dg/pr43562.c: New test. From-SVN: r157849 --- gcc/caller-save.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/caller-save.c') diff --git a/gcc/caller-save.c b/gcc/caller-save.c index dbfd42a..7a00dbd 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -40,6 +40,9 @@ along with GCC; see the file COPYING3. If not see #include "df.h" #include "ggc.h" +/* True if caller-save has been initialized. */ +bool caller_save_initialized_p; + /* Call used hard registers which can not be saved because there is no insn for this. */ HARD_REG_SET no_caller_save_reg_set; @@ -208,6 +211,11 @@ init_caller_save (void) rtx address; int i, j; + if (caller_save_initialized_p) + return; + + caller_save_initialized_p = true; + CLEAR_HARD_REG_SET (no_caller_save_reg_set); /* First find all the registers that we need to deal with and all the modes that they can have. If we can't find a mode to use, -- cgit v1.1