aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/reload1.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5f2ef26..3d51ad0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/reload1.c b/gcc/reload1.c
index c6f81fa..5610b22 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -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: