IA MCU psABI support: changes to libraries
[gcc.git] / gcc / dce.c
index 5b7d36ee15671911190917b443058862a375b749..0f7d35e7182f07e9df47db97cf9d8573abcfb292 100644 (file)
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -1,5 +1,5 @@
 /* RTL dead code elimination.
-   Copyright (C) 2005-2014 Free Software Foundation, Inc.
+   Copyright (C) 2005-2015 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -20,14 +20,22 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "hashtab.h"
 #include "tm.h"
 #include "rtl.h"
+#include "alias.h"
+#include "symtab.h"
 #include "tree.h"
 #include "regs.h"
 #include "hard-reg-set.h"
 #include "flags.h"
 #include "except.h"
+#include "dominance.h"
+#include "cfg.h"
+#include "cfgrtl.h"
+#include "cfgbuild.h"
+#include "cfgcleanup.h"
+#include "predict.h"
+#include "basic-block.h"
 #include "df.h"
 #include "cselib.h"
 #include "dce.h"
@@ -127,6 +135,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))