bug in eliminate_regs

Ulrich Drepper drepper@cygnus.com
Fri Nov 6 10:35:00 GMT 1998


The function eliminate_regs in reload1.c is sometimes called without
reload been running.  The call in my case happens to come from
dbxout.c:1936.  But this leaves the variable `reg_eliminate'
uninitialized.

After adding the following patch things are fine again.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: reload1.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/reload1.c,v
retrieving revision 1.94
diff -d -u -p -r1.94 reload1.c
--- reload1.c	1998/11/04 21:24:53	1.94
+++ reload1.c	1998/11/06 18:11:23
@@ -2625,6 +2625,9 @@ eliminate_regs (x, mem_mode, insn)
   char *fmt;
   int copied = 0;
 
+  if (reg_eliminate == NULL)
+    init_elim_table ();
+
   switch (code)
     {
     case CONST_INT:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------



More information about the Gcc-bugs mailing list