OSDN Git Service

* reload1.c (eliminate_regs): Do not lose if eliminate_regs is called
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Nov 1998 02:46:22 +0000 (02:46 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Nov 1998 02:46:22 +0000 (02:46 +0000)
        without reload having been called earlier.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23748 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/reload1.c

index 5f2ef26..3d51ad0 100644 (file)
@@ -1,5 +1,8 @@
 Sat Nov 21 22:12:09 1998  Jeffrey A Law  (law@cygnus.com)
 
+       * reload1.c (eliminate_regs): Do not lose if eliminate_regs is called
+       without reload having been called earlier.
+
        * v850.c (ep_memory_operand): Offsets < 0 are not valid for EP
        addressing modes.
        (v850_reorg): Similarly.
index c6f81fa..5610b22 100644 (file)
@@ -2646,6 +2646,12 @@ eliminate_regs (x, mem_mode, insn)
   char *fmt;
   int copied = 0;
 
+  /* We can reach here without reload being run if we have an variable
+     definition in a file with no functions (for exmaple).  Ensure we
+     have a valid elimination table in such cases.  */
+  if (reg_eliminate == NULL)
+    init_elim_table ();
+
   switch (code)
     {
     case CONST_INT: