emit-rtl.c (init_derived_machine_modes): New functionm, split out from...

gcc/
	* emit-rtl.c (init_derived_machine_modes): New functionm, split
	out from...
	(init_emit_once): ...here.
	* rtl.h (init_derived_machine_modes): Declare.
	* toplev.c (do_compile): Call it even if no_backend.

From-SVN: r210118
This commit is contained in:
Richard Sandiford 2014-05-06 17:44:15 +00:00 committed by Richard Sandiford
parent 1d60af0867
commit aa3a12d66e
4 changed files with 36 additions and 30 deletions

View File

@ -1,3 +1,11 @@
2014-05-06 Richard Sandiford <rdsandiford@googlemail.com>
* emit-rtl.c (init_derived_machine_modes): New functionm, split
out from...
(init_emit_once): ...here.
* rtl.h (init_derived_machine_modes): Declare.
* toplev.c (do_compile): Call it even if no_backend.
2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
Mike Stump <mikestump@comcast.net>
Richard Sandiford <rdsandiford@googlemail.com>

View File

@ -5720,6 +5720,30 @@ init_emit_regs (void)
}
}
/* Initialize global machine_mode variables. */
void
init_derived_machine_modes (void)
{
byte_mode = VOIDmode;
word_mode = VOIDmode;
for (enum machine_mode mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
{
if (GET_MODE_BITSIZE (mode) == BITS_PER_UNIT
&& byte_mode == VOIDmode)
byte_mode = mode;
if (GET_MODE_BITSIZE (mode) == BITS_PER_WORD
&& word_mode == VOIDmode)
word_mode = mode;
}
ptr_mode = mode_for_size (POINTER_SIZE, GET_MODE_CLASS (Pmode), 0);
}
/* Create some permanent unique rtl objects shared between all functions. */
void
@ -5747,36 +5771,6 @@ init_emit_once (void)
reg_attrs_htab = htab_create_ggc (37, reg_attrs_htab_hash,
reg_attrs_htab_eq, NULL);
/* Compute the word and byte modes. */
byte_mode = VOIDmode;
word_mode = VOIDmode;
double_mode = VOIDmode;
for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
{
if (GET_MODE_BITSIZE (mode) == BITS_PER_UNIT
&& byte_mode == VOIDmode)
byte_mode = mode;
if (GET_MODE_BITSIZE (mode) == BITS_PER_WORD
&& word_mode == VOIDmode)
word_mode = mode;
}
for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
{
if (GET_MODE_BITSIZE (mode) == DOUBLE_TYPE_SIZE
&& double_mode == VOIDmode)
double_mode = mode;
}
ptr_mode = mode_for_size (POINTER_SIZE, GET_MODE_CLASS (Pmode), 0);
#ifdef INIT_EXPANDERS
/* This is to initialize {init|mark|free}_machine_status before the first
call to push_function_context_to. This is needed by the Chill front
@ -5799,6 +5793,8 @@ init_emit_once (void)
else
const_true_rtx = gen_rtx_CONST_INT (VOIDmode, STORE_FLAG_VALUE);
double_mode = mode_for_size (DOUBLE_TYPE_SIZE, MODE_FLOAT, 0);
real_from_integer (&dconst0, double_mode, 0, SIGNED);
real_from_integer (&dconst1, double_mode, 1, SIGNED);
real_from_integer (&dconst2, double_mode, 2, SIGNED);

View File

@ -2734,6 +2734,7 @@ extern int get_max_insn_count (void);
extern int in_sequence_p (void);
extern void init_emit (void);
extern void init_emit_regs (void);
extern void init_derived_machine_modes (void);
extern void init_emit_once (void);
extern void push_topmost_sequence (void);
extern void pop_topmost_sequence (void);

View File

@ -1891,6 +1891,7 @@ do_compile (void)
predefined macros, such as __LDBL_MAX__, for targets using non
default FP formats. */
init_adjust_machine_modes ();
init_derived_machine_modes ();
/* Set up the back-end if requested. */
if (!no_backend)