diff options
| -rw-r--r-- | gcc/ChangeLog | 9 | ||||
| -rw-r--r-- | gcc/cselib.c | 7 | ||||
| -rw-r--r-- | gcc/cselib.h | 2 | ||||
| -rw-r--r-- | gcc/gcse.c | 3 |
4 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d0f87c0..beaa6ea 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +Tue Jan 7 22:29:56 CET 2003 Jan Hubicka <jh@suse.cz> + + * cselib.c (cselib_current_insn_in_libcall): New static variable. + (new_elt_loc_list, cselib_process_insn, cselib_init): Keep track on whether + we are inside libcall. + * cselib.h (elt_loc_list): Add in_libcall. + * gcse.c (do_local_cprop): Do not copy propagate using insns + in libcalls. + 2003-01-07 David Edelsohn <edelsohn@gnu.org> * doc/tm.texi (TARGET_SCHED_VARIABLE_ISSUE): CLOBBER and USE do diff --git a/gcc/cselib.c b/gcc/cselib.c index 2ef4c57..63fab22 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -85,6 +85,7 @@ static GTY((param_is (cselib_val))) htab_t hash_table; /* This is a global so we don't have to pass this through every function. It is used in new_elt_loc_list to set SETTING_INSN. */ static rtx cselib_current_insn; +static bool cselib_current_insn_in_libcall; /* Every new unknown value gets a unique number. */ static unsigned int next_unknown_value; @@ -165,6 +166,7 @@ new_elt_loc_list (next, loc) el->next = next; el->loc = loc; el->setting_insn = cselib_current_insn; + el->in_libcall = cselib_current_insn_in_libcall; return el; } @@ -1310,6 +1312,10 @@ cselib_process_insn (insn) int i; rtx x; + if (find_reg_note (insn, REG_LIBCALL, NULL)) + cselib_current_insn_in_libcall = true; + if (find_reg_note (insn, REG_RETVAL, NULL)) + cselib_current_insn_in_libcall = false; cselib_current_insn = insn; /* Forget everything at a CODE_LABEL, a volatile asm, or a setjmp. */ @@ -1409,6 +1415,7 @@ cselib_init () hash_table = htab_create_ggc (31, get_value_hash, entry_and_rtx_equal_p, NULL); clear_table (1); + cselib_current_insn_in_libcall = false; } /* Called when the current user is done with cselib. */ diff --git a/gcc/cselib.h b/gcc/cselib.h index 8cb2e6b..f29ee8d 100644 --- a/gcc/cselib.h +++ b/gcc/cselib.h @@ -49,6 +49,8 @@ struct elt_loc_list GTY(()) rtx loc; /* The insn that made the equivalence. */ rtx setting_insn; + /* True when setting insn is inside libcall. */ + bool in_libcall; }; /* A list of cselib_val structures. */ @@ -4274,6 +4274,9 @@ do_local_cprop (x, insn, alter_jumps, libcall_sp) rtx this_rtx = l->loc; rtx note; + if (l->in_libcall) + continue; + if (CONSTANT_P (this_rtx)) newcnst = this_rtx; if (REG_P (this_rtx) && REGNO (this_rtx) >= FIRST_PSEUDO_REGISTER |
