diff options
author | Jan Hubicka <jh@suse.cz> | 2001-07-18 18:36:33 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2001-07-18 16:36:33 +0000 |
commit | f06fbeea0d00173bf64cda5eb6b96f1df55d5fd8 (patch) | |
tree | af5b08ba96e4f3b1c859fcd07bd5e1691888f31b /gcc/cse.c | |
parent | 222f7ba9a4fc02e6573a85c3dab19108a200aba0 (diff) | |
download | gcc-f06fbeea0d00173bf64cda5eb6b96f1df55d5fd8.zip gcc-f06fbeea0d00173bf64cda5eb6b96f1df55d5fd8.tar.gz gcc-f06fbeea0d00173bf64cda5eb6b96f1df55d5fd8.tar.bz2 |
cse.c (delete_trivially_dead_insns): Delete the libcall block when return value is unused.
* cse.c (delete_trivially_dead_insns): Delete the libcall block
when return value is unused.
From-SVN: r44112
Diffstat (limited to 'gcc/cse.c')
-rw-r--r-- | gcc/cse.c | 32 |
1 files changed, 27 insertions, 5 deletions
@@ -7488,7 +7488,7 @@ count_reg_usage (x, counts, dest, incr) static bool set_live_p (set, insn, counts) rtx set; - rtx insn; + rtx insn ATTRIBUTE_UNUSED; int *counts; { #ifdef HAVE_cc0 @@ -7630,8 +7630,19 @@ delete_trivially_dead_insns (insns, nreg, preserve_basic_blocks) if (find_reg_note (insn, REG_RETVAL, NULL_RTX)) { in_libcall = 1; - live_insn = 1; - dead_libcall = dead_libcall_p (insn); + /* If the insn storing return value is dead, whole libcall is dead. + Otherwise attempt to eliminate libcall by doing an direct + operation. */ + if (!insn_live_p (insn, counts)) + { + live_insn = 0; + dead_libcall = 1; + } + else + { + live_insn = 1; + dead_libcall = dead_libcall_p (insn); + } } else if (in_libcall) live_insn = ! dead_libcall; @@ -7671,8 +7682,19 @@ delete_trivially_dead_insns (insns, nreg, preserve_basic_blocks) if (find_reg_note (insn, REG_RETVAL, NULL_RTX)) { in_libcall = 1; - live_insn = 1; - dead_libcall = dead_libcall_p (insn); + /* If the insn storing return value is dead, whole libcall is dead. + Otherwise attempt to eliminate libcall by doing an direct + operation. */ + if (!insn_live_p (insn, counts)) + { + live_insn = 0; + dead_libcall = 1; + } + else + { + live_insn = 1; + dead_libcall = dead_libcall_p (insn); + } } else if (in_libcall) live_insn = ! dead_libcall; |