This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

fix execute/nest-stdar-1.c on alpha


The problem here is clear_const_double_mem.  It's called by the
nested function f, which leaves 1.0 on main's const_double_chain
with a cleared CONST_DOUBLE_MEM.  We later put 1.0 back on to 
the const_double_chain, creating a loop.


r~


        * varasm.c (restore_varasm_status): New.
        * function.h: Declare it.
        * function.c (pop_function_context_from): Call it.

Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.311
diff -c -p -d -r1.311 function.c
*** function.c	2001/10/01 11:00:44	1.311
--- function.c	2001/10/08 16:44:30
*************** pop_function_context_from (context)
*** 386,391 ****
--- 386,392 ----
    reg_renumber = 0;
  
    restore_emit_status (p);
+   restore_varasm_status (p);
  
    if (restore_lang_status)
      (*restore_lang_status) (p);
Index: function.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.h,v
retrieving revision 1.67
diff -c -p -d -r1.67 function.h
*** function.h	2001/09/03 20:50:33	1.67
--- function.h	2001/10/08 16:44:30
*************** extern void free_after_parsing		PARAMS (
*** 592,597 ****
--- 592,598 ----
  extern void free_after_compilation	PARAMS ((struct function *));
  
  extern void init_varasm_status		PARAMS ((struct function *));
+ extern void restore_varasm_status	PARAMS ((struct function *));
  extern void free_varasm_status		PARAMS ((struct function *));
  extern void free_emit_status		PARAMS ((struct function *));
  extern void free_stmt_status            PARAMS ((struct function *));
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.211
diff -c -p -d -r1.211 varasm.c
*** varasm.c	2001/09/29 00:26:02	1.211
--- varasm.c	2001/10/08 16:44:30
*************** init_varasm_status (f)
*** 3493,3498 ****
--- 3493,3515 ----
    p->x_const_double_chain = 0;
  }
  
+ /* Nested functions diddle with our const_double_chain via
+    clear_const_double_mem and const_tiny_rtx.  Remove these
+    entries from our const_double_chain.  */
+ 
+ void
+ restore_varasm_status (f)
+      struct function *f;
+ {
+   rtx *p = &f->varasm->x_const_double_chain;
+ 
+   while (*p)
+     if (CONST_DOUBLE_MEM (*p) == cc0_rtx)
+       *p = CONST_DOUBLE_CHAIN (*p);
+     else
+       p = &CONST_DOUBLE_CHAIN (*p);
+ }
+ 
  /* Mark PC for GC.  */
  
  static void


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]