summaryrefslogtreecommitdiff
path: root/gcc/dce.c
diff options
context:
space:
mode:
authoriverbin <iverbin@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-23 16:52:11 +0000
committeriverbin <iverbin@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-23 16:52:11 +0000
commit0d1f9fde351b98d9a4ae86cc537bb0055666a99f (patch)
tree762dafe16440a2ac39820ecedae967e46f1e97ff /gcc/dce.c
parent2981340f1d61ceb73d71a7b90d883922bfb05f8e (diff)
downloadgcc-0d1f9fde351b98d9a4ae86cc537bb0055666a99f.tar.gz
PR target/63534
PR target/63618 gcc/ * cse.c (delete_trivially_dead_insns): Consider PIC register is used while it is pseudo. * dse.c (deletable_insn_p): Likewise. gcc/testsuite/ * gcc.target/i386/pr63618.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216596 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dce.c')
-rw-r--r--gcc/dce.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/dce.c b/gcc/dce.c
index 5b7d36ee156..a52a59c604d 100644
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -127,6 +127,10 @@ deletable_insn_p (rtx_insn *insn, bool fast, bitmap arg_stores)
if (HARD_REGISTER_NUM_P (DF_REF_REGNO (def))
&& global_regs[DF_REF_REGNO (def)])
return false;
+ /* Initialization of pseudo PIC register should never be removed. */
+ else if (DF_REF_REG (def) == pic_offset_table_rtx
+ && REGNO (pic_offset_table_rtx) >= FIRST_PSEUDO_REGISTER)
+ return false;
body = PATTERN (insn);
switch (GET_CODE (body))