Commit 848e0190 by Jan Hubicka Committed by Jan Hubicka

cse.c (cse_main): Converts ifdefs on PIC_OFFSET_TABLE_REGNUM to conditionals.

	* cse.c (cse_main): Converts ifdefs on PIC_OFFSET_TABLE_REGNUM to
	conditionals.
	* defaults.h (PIC_OFFSET_TABLE_REGNUM): Default to INVALID_REGNUM.
	* emit-rtl.c (init_emit_once): Convert ifdefs to conditionals.
	* flow.c (mark_regs_live_at_end): Likewise.
	(calculate_global_regs_live): Likewise.
	* gcse.c (compute_hash_table): Likewise.
	(compute_kill_rd): Likewise.
	* resource.c (mark_target_live_regs): Likewise.
	* rtl.h (INVALID_REGNUM): New macro.

From-SVN: r39643
parent b1675dbd
Tue Feb 13 21:09:11 CET 2001 Jan Hubicka <jh@suse.cz>
* cse.c (cse_main): Converts ifdefs on PIC_OFFSET_TABLE_REGNUM to
conditionals.
* defaults.h (PIC_OFFSET_TABLE_REGNUM): Default to INVALID_REGNUM.
* emit-rtl.c (init_emit_once): Convert ifdefs to conditionals.
* flow.c (mark_regs_live_at_end): Likewise.
(calculate_global_regs_live): Likewise.
* gcse.c (compute_hash_table): Likewise.
(compute_kill_rd): Likewise.
* resource.c (mark_target_live_regs): Likewise.
* rtl.h (INVALID_REGNUM): New macro.
Tue Feb 13 20:59:22 CET 2001 Jan Hubicka <jh@suse.cz> Tue Feb 13 20:59:22 CET 2001 Jan Hubicka <jh@suse.cz>
* i386.md (fixsfsi2, fixdfdi2): Fix previous patch. * i386.md (fixsfsi2, fixdfdi2): Fix previous patch.
......
...@@ -7119,7 +7119,7 @@ cse_main (f, nregs, after_loop, file) ...@@ -7119,7 +7119,7 @@ cse_main (f, nregs, after_loop, file)
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM #if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (i == ARG_POINTER_REGNUM && fixed_regs[i]) && ! (i == ARG_POINTER_REGNUM && fixed_regs[i])
#endif #endif
#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED) #if !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
&& ! (i == PIC_OFFSET_TABLE_REGNUM && flag_pic) && ! (i == PIC_OFFSET_TABLE_REGNUM && flag_pic)
#endif #endif
) )
......
...@@ -296,6 +296,10 @@ do { \ ...@@ -296,6 +296,10 @@ do { \
#define BUILD_VA_LIST_TYPE(X) ((X) = ptr_type_node) #define BUILD_VA_LIST_TYPE(X) ((X) = ptr_type_node)
#endif #endif
#ifndef PIC_OFFSET_TABLE_REGNUM
#define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
#endif
/* By default, the preprocessor should be invoked the same way in C++ /* By default, the preprocessor should be invoked the same way in C++
as in C. */ as in C. */
#ifndef CPLUSPLUS_CPP_SPEC #ifndef CPLUSPLUS_CPP_SPEC
......
...@@ -4197,9 +4197,8 @@ init_emit_once (line_numbers) ...@@ -4197,9 +4197,8 @@ init_emit_once (line_numbers)
#endif #endif
#endif #endif
#ifdef PIC_OFFSET_TABLE_REGNUM if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
pic_offset_table_rtx = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM); pic_offset_table_rtx = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
#endif
ggc_add_rtx_root (&pic_offset_table_rtx, 1); ggc_add_rtx_root (&pic_offset_table_rtx, 1);
ggc_add_rtx_root (&struct_value_rtx, 1); ggc_add_rtx_root (&struct_value_rtx, 1);
......
...@@ -3345,15 +3345,14 @@ mark_regs_live_at_end (set) ...@@ -3345,15 +3345,14 @@ mark_regs_live_at_end (set)
#endif #endif
} }
#ifdef PIC_OFFSET_TABLE_REGNUM
#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED #ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
/* Many architectures have a GP register even without flag_pic. /* Many architectures have a GP register even without flag_pic.
Assume the pic register is not in use, or will be handled by Assume the pic register is not in use, or will be handled by
other means, if it is not fixed. */ other means, if it is not fixed. */
if (fixed_regs[PIC_OFFSET_TABLE_REGNUM]) if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
&& fixed_regs[PIC_OFFSET_TABLE_REGNUM])
SET_REGNO_REG_SET (set, PIC_OFFSET_TABLE_REGNUM); SET_REGNO_REG_SET (set, PIC_OFFSET_TABLE_REGNUM);
#endif #endif
#endif
/* Mark all global registers, and all registers used by the epilogue /* Mark all global registers, and all registers used by the epilogue
as being live at the end of the function since they may be as being live at the end of the function since they may be
...@@ -3484,12 +3483,11 @@ calculate_global_regs_live (blocks_in, blocks_out, flags) ...@@ -3484,12 +3483,11 @@ calculate_global_regs_live (blocks_in, blocks_out, flags)
SET_REGNO_REG_SET (new_live_at_end, ARG_POINTER_REGNUM); SET_REGNO_REG_SET (new_live_at_end, ARG_POINTER_REGNUM);
#endif #endif
#ifdef PIC_OFFSET_TABLE_REGNUM
/* Any constant, or pseudo with constant equivalences, may /* Any constant, or pseudo with constant equivalences, may
require reloading from memory using the pic register. */ require reloading from memory using the pic register. */
if (fixed_regs[PIC_OFFSET_TABLE_REGNUM]) if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
&& fixed_regs[PIC_OFFSET_TABLE_REGNUM])
SET_REGNO_REG_SET (new_live_at_end, PIC_OFFSET_TABLE_REGNUM); SET_REGNO_REG_SET (new_live_at_end, PIC_OFFSET_TABLE_REGNUM);
#endif
} }
/* Regs used in phi nodes are not included in /* Regs used in phi nodes are not included in
......
...@@ -2208,7 +2208,7 @@ compute_hash_table (set_p) ...@@ -2208,7 +2208,7 @@ compute_hash_table (set_p)
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM #if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno]) && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
#endif #endif
#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED) #if !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
&& ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic) && ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
#endif #endif
...@@ -2641,7 +2641,7 @@ compute_kill_rd () ...@@ -2641,7 +2641,7 @@ compute_kill_rd ()
&& ! (regno == ARG_POINTER_REGNUM && ! (regno == ARG_POINTER_REGNUM
&& fixed_regs[regno]) && fixed_regs[regno])
#endif #endif
#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED) #if !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
&& ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic) && ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
#endif #endif
&& regno != FRAME_POINTER_REGNUM) && regno != FRAME_POINTER_REGNUM)
......
...@@ -1029,7 +1029,7 @@ mark_target_live_regs (insns, target, res) ...@@ -1029,7 +1029,7 @@ mark_target_live_regs (insns, target, res)
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM #if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (i == ARG_POINTER_REGNUM && fixed_regs[i]) && ! (i == ARG_POINTER_REGNUM && fixed_regs[i])
#endif #endif
#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED) #if !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
&& ! (i == PIC_OFFSET_TABLE_REGNUM && flag_pic) && ! (i == PIC_OFFSET_TABLE_REGNUM && flag_pic)
#endif #endif
) )
......
...@@ -1606,6 +1606,9 @@ extern rtx gen_rtx_MEM PARAMS ((enum machine_mode, rtx)); ...@@ -1606,6 +1606,9 @@ extern rtx gen_rtx_MEM PARAMS ((enum machine_mode, rtx));
#define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 4) #define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 4)
/* REGNUM never really appearing in the INSN stream. */
#define INVALID_REGNUM (~(unsigned int)0)
extern rtx find_next_ref PARAMS ((rtx, rtx)); extern rtx find_next_ref PARAMS ((rtx, rtx));
extern rtx *find_single_use PARAMS ((rtx, rtx, rtx *)); extern rtx *find_single_use PARAMS ((rtx, rtx, rtx *));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment