Patch for PR rtl-optimization/22472 (Critical HPPA bug)

Steve Ellcey sje@cup.hp.com
Wed Jul 20 17:47:00 GMT 2005


I am not entirely convinced this patch is complete, but it does fix PR
22472, and I think that defining HARD_REGNO_RENAME_OK is the right thing
to do.  hppa currently has no definition for it at all.  But I wonder if
we need a more extensive defintion (something that might involve not
renaming the stack pointer and/or frame pointer, etc.

The specific problem in this test was with r2, the definition of the
return instruction and the hppa_can_use_return_insn_p predicate which
wants r2 to have not been live (renaming something to r2 made it live).

Anyway, I tested this on hppa1.1-hp-hpux11.00 with no regressions and
verified it fixed gcc.c-torture/compile/930621-1.c.  What do people
think?  Are there more hard registers that should not be renamed?

Steve Ellcey
sje@cup.hp.com

2005-07-20  Steve Ellcey  <sje@cup.hp.com>

	PR rtl-optimization/22472
	* config/pa/pa.h (HARD_REGNO_RENAME_OK): Define.


*** gcc.orig/gcc/config/pa/pa.h	Wed Jul 20 10:37:07 2005
--- gcc/gcc/config/pa/pa.h	Wed Jul 20 10:37:15 2005
*************** typedef struct machine_function GTY(())
*** 358,363 ****
--- 358,368 ----
  #define FRAME_POINTER_REQUIRED \
    (current_function_calls_alloca)
  
+ /* Don't allow hard registers to be renamed into r2.
+    ??? Are there other registers that we shouldn't rename.  */
+ 
+ #define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) (NEW_REG != 2)
+ 
  /* C statement to store the difference between the frame pointer
     and the stack pointer values immediately after the function prologue.
  



More information about the Gcc-patches mailing list