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]

new allocator: df must use FRAME_POINTER_REQUIRED



df.c calculate incorrect lr_in/lr_out info for functions like
printf (char fmt, ...) {...}
My target (avr) uses -fomit-frame-pointer by default.
For printf (char fmt, ...) I need in frame pointer only for restore stack.
So, frame pointer not used or defined inside the rtl function body.
Only FRAME_POINTER_REQUIRED can give correct info. Patch below.

Another think: on any target which really have only two operands
in instruction we have a hidden move inside rtl patterns like
addMM,subMM, ...

Example:
(set (reg:HI 44)
     (plus:HI (reg/v:HI 41)
              (const_int 48 [0x30])))

??? Must be translated to ???:
(set (reg:HI 44) (reg/v:HI 41))
(set (reg:HI 44)
     (plus:HI (reg/v:HI 44)
              (const_int 48 [0x30])))

Such a hidden move will be extracted by reload - it's not good.
May be better to use optimistic coalescing ?

(Daniel, I'm worry about my previous patches.)

Mon Feb  5 22:53:47 2001  Denis Chertykov  <denisc@overta.ru>

	* df.c (df_lr_global_compute): Use FRAME_POINTER_REQUIRED for
          computing lr_in/lr_out.
	  #include "tm_p.h" added.


Index: df.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Attic/df.c,v
retrieving revision 1.1.2.2
diff -c -3 -p -r1.1.2.2 df.c
*** df.c	2001/01/30 04:52:48	1.1.2.2
--- df.c	2001/02/05 20:27:55
***************
*** 1,5 ****
  /* Dataflow support routines.
!    Copyright (C) 1999, 2000 Free Software Foundation, Inc.
     Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz,
                                      mhayes@redhat.com)
  
--- 1,5 ----
  /* Dataflow support routines.
!    Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
     Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz,
                                      mhayes@redhat.com)
  
*************** Perhaps there should be a bitmap argumen
*** 166,173 ****
  #include "basic-block.h"
  #include "df.h"
  #include "sbitmap.h"
  
- 
  #define FOR_ALL_BBS(BB, CODE)					\
  do {								\
    int node_;							\
--- 166,173 ----
  #include "basic-block.h"
  #include "df.h"
  #include "sbitmap.h"
+ #include "tm_p.h"
  
  #define FOR_ALL_BBS(BB, CODE)					\
  do {								\
    int node_;							\
*************** df_lr_global_compute (df, blocks)
*** 1682,1687 ****
--- 1682,1697 ----
  
        /* Calculate union of successor ins.  */
        sbitmap_zero (bb_info->lr_out);
+ 
+       if (FRAME_POINTER_REQUIRED)
+ 	for (i = 0; i < POINTER_SIZE / BITS_PER_WORD; ++i)
+ 	  {
+ 	    SET_BIT (bb_info->lr_out, i + FRAME_POINTER_REGNUM);
+ #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM	    
+ 	    SET_BIT (bb_info->lr_out, i + HARD_FRAME_POINTER_REGNUM);
+ #endif
+ 	  }
+       
        for (e = bb->succ; e != 0; e = e->succ_next)
  	{
  	  struct bb_info *succ_refs = DF_BB_INFO (df, e->dest);


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