Commit 2a79f8e4 by Uros Bizjak

re PR target/38288 (i386/i386.c: 7 * set but not used variables)

	PR target/38288
	From David Binderman <dcb314@hotmail.com>:
	* gcc/config/i386/i386.c (ix86_function_regparm): Remove useless
	local variable f.  Remove stale comments.
	(ix86_compute_frame_layout): Remove useless local variable total_size.
	Remove #if 0'd code.
	(legitimate_address_p): Remove useless local variables
	reason_rtx and reason.
	(ix86_split_copysign_const): Remove useless local variable op1.
	(scale_counter): Remove useless local variable piece_size_mask.

From-SVN: r151854
parent 6465b6a7
2009-09-18 Uros Bizjak <ubizjak@gmail.com>
PR target/38288
From David Binderman <dcb314@hotmail.com>:
* gcc/config/i386/i386.c (ix86_function_regparm): Remove useless
local variable f. Remove stale comments.
(ix86_compute_frame_layout): Remove useless local variable total_size.
Remove #if 0'd code.
(legitimate_address_p): Remove useless local variables
reason_rtx and reason.
(ix86_split_copysign_const): Remove useless local variable op1.
(scale_counter): Remove useless local variable piece_size_mask.
2009-09-18 Jakub Jelinek <jakub@redhat.com> 2009-09-18 Jakub Jelinek <jakub@redhat.com>
* stmt.c (expand_asm_operands): Set REG_ATTRS on the temporary from * stmt.c (expand_asm_operands): Set REG_ATTRS on the temporary from
...@@ -126,7 +139,7 @@ ...@@ -126,7 +139,7 @@
(ipa_early_sra_gate): New function. (ipa_early_sra_gate): New function.
(pass_early_ipa_sra): New variable. (pass_early_ipa_sra): New variable.
* Makefile.in (tree-sra.o): Add cgraph.h to dependencies. * Makefile.in (tree-sra.o): Add cgraph.h to dependencies.
2009-09-17 Michael Matz <matz@suse.de> 2009-09-17 Michael Matz <matz@suse.de>
PR middle-end/41347 PR middle-end/41347
...@@ -203,7 +216,7 @@ ...@@ -203,7 +216,7 @@
* config/sh/sh.c (output_stack_adjust): Add new argument frame_p. * config/sh/sh.c (output_stack_adjust): Add new argument frame_p.
(sh_expand_prologue): Update calls to output_stack_adjust. (sh_expand_prologue): Update calls to output_stack_adjust.
(sh_expand_epilogue): Likewise. (sh_expand_epilogue): Likewise.
2009-09-15 Adam Nemet <anemet@caviumnetworks.com> 2009-09-15 Adam Nemet <anemet@caviumnetworks.com>
...@@ -272,8 +285,8 @@ ...@@ -272,8 +285,8 @@
2009-09-15 Christian Bruel <christian.bruel@st.com> 2009-09-15 Christian Bruel <christian.bruel@st.com>
* regrename.c (do_replace): Update REG_DEAD notes. * regrename.c (do_replace): Update REG_DEAD notes.
2009-09-15 Revital Eres <eres@il.ibm.com> 2009-09-15 Revital Eres <eres@il.ibm.com>
* doc/tm.texi (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Document. * doc/tm.texi (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Document.
......
...@@ -4516,7 +4516,6 @@ ix86_function_regparm (const_tree type, const_tree decl) ...@@ -4516,7 +4516,6 @@ ix86_function_regparm (const_tree type, const_tree decl)
if (i && i->local) if (i && i->local)
{ {
int local_regparm, globals = 0, regno; int local_regparm, globals = 0, regno;
struct function *f;
/* Make sure no regparm register is taken by a /* Make sure no regparm register is taken by a
fixed register variable. */ fixed register variable. */
...@@ -4531,16 +4530,7 @@ ix86_function_regparm (const_tree type, const_tree decl) ...@@ -4531,16 +4530,7 @@ ix86_function_regparm (const_tree type, const_tree decl)
&& !DECL_NO_STATIC_CHAIN (decl)) && !DECL_NO_STATIC_CHAIN (decl))
local_regparm = 2; local_regparm = 2;
/* If the function realigns its stackpointer, the prologue will /* Each fixed register usage increases register pressure,
clobber %ecx. If we've already generated code for the callee,
the callee DECL_STRUCT_FUNCTION is gone, so we fall back to
scanning the attributes for the self-realigning property. */
f = DECL_STRUCT_FUNCTION (decl);
/* Since current internal arg pointer won't conflict with
parameter passing regs, so no need to change stack
realignment and adjust regparm number.
Each fixed register usage increases register pressure,
so less registers should be used for argument passing. so less registers should be used for argument passing.
This functionality can be overriden by an explicit This functionality can be overriden by an explicit
regparm value. */ regparm value. */
...@@ -7822,7 +7812,6 @@ ix86_builtin_setjmp_frame_value (void) ...@@ -7822,7 +7812,6 @@ ix86_builtin_setjmp_frame_value (void)
static void static void
ix86_compute_frame_layout (struct ix86_frame *frame) ix86_compute_frame_layout (struct ix86_frame *frame)
{ {
HOST_WIDE_INT total_size;
unsigned int stack_alignment_needed; unsigned int stack_alignment_needed;
HOST_WIDE_INT offset; HOST_WIDE_INT offset;
unsigned int preferred_alignment; unsigned int preferred_alignment;
...@@ -7830,7 +7819,6 @@ ix86_compute_frame_layout (struct ix86_frame *frame) ...@@ -7830,7 +7819,6 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
frame->nregs = ix86_nsaved_regs (); frame->nregs = ix86_nsaved_regs ();
frame->nsseregs = ix86_nsaved_sseregs (); frame->nsseregs = ix86_nsaved_sseregs ();
total_size = size;
stack_alignment_needed = crtl->stack_alignment_needed / BITS_PER_UNIT; stack_alignment_needed = crtl->stack_alignment_needed / BITS_PER_UNIT;
preferred_alignment = crtl->preferred_stack_boundary / BITS_PER_UNIT; preferred_alignment = crtl->preferred_stack_boundary / BITS_PER_UNIT;
...@@ -7976,26 +7964,6 @@ ix86_compute_frame_layout (struct ix86_frame *frame) ...@@ -7976,26 +7964,6 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
frame->red_zone_size = 0; frame->red_zone_size = 0;
frame->to_allocate -= frame->red_zone_size; frame->to_allocate -= frame->red_zone_size;
frame->stack_pointer_offset -= frame->red_zone_size; frame->stack_pointer_offset -= frame->red_zone_size;
#if 0
fprintf (stderr, "\n");
fprintf (stderr, "size: %ld\n", (long)size);
fprintf (stderr, "nregs: %ld\n", (long)frame->nregs);
fprintf (stderr, "nsseregs: %ld\n", (long)frame->nsseregs);
fprintf (stderr, "padding0: %ld\n", (long)frame->padding0);
fprintf (stderr, "alignment1: %ld\n", (long)stack_alignment_needed);
fprintf (stderr, "padding1: %ld\n", (long)frame->padding1);
fprintf (stderr, "va_arg: %ld\n", (long)frame->va_arg_size);
fprintf (stderr, "padding2: %ld\n", (long)frame->padding2);
fprintf (stderr, "to_allocate: %ld\n", (long)frame->to_allocate);
fprintf (stderr, "red_zone_size: %ld\n", (long)frame->red_zone_size);
fprintf (stderr, "frame_pointer_offset: %ld\n", (long)frame->frame_pointer_offset);
fprintf (stderr, "hard_frame_pointer_offset: %ld\n",
(long)frame->hard_frame_pointer_offset);
fprintf (stderr, "stack_pointer_offset: %ld\n", (long)frame->stack_pointer_offset);
fprintf (stderr, "current_function_is_leaf: %ld\n", (long)current_function_is_leaf);
fprintf (stderr, "cfun->calls_alloca: %ld\n", (long)cfun->calls_alloca);
fprintf (stderr, "x86_current_function_calls_tls_descriptor: %ld\n", (long)ix86_current_function_calls_tls_descriptor);
#endif
} }
/* Emit code to save registers in the prologue. */ /* Emit code to save registers in the prologue. */
...@@ -9609,14 +9577,10 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -9609,14 +9577,10 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
struct ix86_address parts; struct ix86_address parts;
rtx base, index, disp; rtx base, index, disp;
HOST_WIDE_INT scale; HOST_WIDE_INT scale;
const char *reason = NULL;
rtx reason_rtx = NULL_RTX;
if (ix86_decompose_address (addr, &parts) <= 0) if (ix86_decompose_address (addr, &parts) <= 0)
{ /* Decomposition failed. */
reason = "decomposition failed"; return false;
goto report_error;
}
base = parts.base; base = parts.base;
index = parts.index; index = parts.index;
...@@ -9632,7 +9596,6 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -9632,7 +9596,6 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
if (base) if (base)
{ {
rtx reg; rtx reg;
reason_rtx = base;
if (REG_P (base)) if (REG_P (base))
reg = base; reg = base;
...@@ -9642,23 +9605,17 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -9642,23 +9605,17 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
<= UNITS_PER_WORD) <= UNITS_PER_WORD)
reg = SUBREG_REG (base); reg = SUBREG_REG (base);
else else
{ /* Base is not a register. */
reason = "base is not a register"; return false;
goto report_error;
}
if (GET_MODE (base) != Pmode) if (GET_MODE (base) != Pmode)
{ /* Base is not in Pmode. */
reason = "base is not in Pmode"; return false;
goto report_error;
}
if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg)) if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg))
|| (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (reg))) || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (reg)))
{ /* Base is not valid. */
reason = "base is not valid"; return false;
goto report_error;
}
} }
/* Validate index register. /* Validate index register.
...@@ -9668,7 +9625,6 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -9668,7 +9625,6 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
if (index) if (index)
{ {
rtx reg; rtx reg;
reason_rtx = index;
if (REG_P (index)) if (REG_P (index))
reg = index; reg = index;
...@@ -9678,47 +9634,34 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -9678,47 +9634,34 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
<= UNITS_PER_WORD) <= UNITS_PER_WORD)
reg = SUBREG_REG (index); reg = SUBREG_REG (index);
else else
{ /* Index is not a register. */
reason = "index is not a register"; return false;
goto report_error;
}
if (GET_MODE (index) != Pmode) if (GET_MODE (index) != Pmode)
{ /* Index is not in Pmode. */
reason = "index is not in Pmode"; return false;
goto report_error;
}
if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg)) if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg))
|| (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (reg))) || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (reg)))
{ /* Index is not valid. */
reason = "index is not valid"; return false;
goto report_error;
}
} }
/* Validate scale factor. */ /* Validate scale factor. */
if (scale != 1) if (scale != 1)
{ {
reason_rtx = GEN_INT (scale);
if (!index) if (!index)
{ /* Scale without index. */
reason = "scale without index"; return false;
goto report_error;
}
if (scale != 2 && scale != 4 && scale != 8) if (scale != 2 && scale != 4 && scale != 8)
{ /* Scale is not a valid multiplier. */
reason = "scale is not a valid multiplier"; return false;
goto report_error;
}
} }
/* Validate displacement. */ /* Validate displacement. */
if (disp) if (disp)
{ {
reason_rtx = disp;
if (GET_CODE (disp) == CONST if (GET_CODE (disp) == CONST
&& GET_CODE (XEXP (disp, 0)) == UNSPEC && GET_CODE (XEXP (disp, 0)) == UNSPEC
&& XINT (XEXP (disp, 0), 1) != UNSPEC_MACHOPIC_OFFSET) && XINT (XEXP (disp, 0), 1) != UNSPEC_MACHOPIC_OFFSET)
...@@ -9732,8 +9675,9 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -9732,8 +9675,9 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
gcc_assert (flag_pic); gcc_assert (flag_pic);
if (!TARGET_64BIT) if (!TARGET_64BIT)
goto is_legitimate_pic; goto is_legitimate_pic;
reason = "64bit address unspec";
goto report_error; /* 64bit address unspec. */
return false;
case UNSPEC_GOTPCREL: case UNSPEC_GOTPCREL:
gcc_assert (flag_pic); gcc_assert (flag_pic);
...@@ -9747,8 +9691,8 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -9747,8 +9691,8 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
break; break;
default: default:
reason = "invalid address unspec"; /* Invalid address unspec. */
goto report_error; return false;
} }
else if (SYMBOLIC_CONST (disp) else if (SYMBOLIC_CONST (disp)
...@@ -9771,16 +9715,12 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -9771,16 +9715,12 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
|| !CONST_INT_P (XEXP (XEXP (disp, 0), 1)) || !CONST_INT_P (XEXP (XEXP (disp, 0), 1))
|| (XINT (XEXP (XEXP (disp, 0), 0), 1) != UNSPEC_DTPOFF || (XINT (XEXP (XEXP (disp, 0), 0), 1) != UNSPEC_DTPOFF
&& XINT (XEXP (XEXP (disp, 0), 0), 1) != UNSPEC_NTPOFF)) && XINT (XEXP (XEXP (disp, 0), 0), 1) != UNSPEC_NTPOFF))
{ /* Non-constant pic memory reference. */
reason = "non-constant pic memory reference"; return false;
goto report_error;
}
} }
else if (! legitimate_pic_address_disp_p (disp)) else if (! legitimate_pic_address_disp_p (disp))
{ /* Displacement is an invalid pic construct. */
reason = "displacement is an invalid pic construct"; return false;
goto report_error;
}
/* This code used to verify that a symbolic pic displacement /* This code used to verify that a symbolic pic displacement
includes the pic_offset_table_rtx register. includes the pic_offset_table_rtx register.
...@@ -9810,23 +9750,16 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -9810,23 +9750,16 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
|| !legitimate_constant_p (disp)) || !legitimate_constant_p (disp))
&& (GET_CODE (disp) != SYMBOL_REF && (GET_CODE (disp) != SYMBOL_REF
|| !legitimate_constant_p (disp))) || !legitimate_constant_p (disp)))
{ /* Displacement is not constant. */
reason = "displacement is not constant"; return false;
goto report_error;
}
else if (TARGET_64BIT else if (TARGET_64BIT
&& !x86_64_immediate_operand (disp, VOIDmode)) && !x86_64_immediate_operand (disp, VOIDmode))
{ /* Displacement is out of range. */
reason = "displacement is out of range"; return false;
goto report_error;
}
} }
/* Everything looks valid. */ /* Everything looks valid. */
return TRUE; return true;
report_error:
return FALSE;
} }
/* Determine if a given RTX is a valid constant address. */ /* Determine if a given RTX is a valid constant address. */
...@@ -14123,11 +14056,10 @@ void ...@@ -14123,11 +14056,10 @@ void
ix86_split_copysign_const (rtx operands[]) ix86_split_copysign_const (rtx operands[])
{ {
enum machine_mode mode, vmode; enum machine_mode mode, vmode;
rtx dest, op0, op1, mask, x; rtx dest, op0, mask, x;
dest = operands[0]; dest = operands[0];
op0 = operands[1]; op0 = operands[1];
op1 = operands[2];
mask = operands[3]; mask = operands[3];
mode = GET_MODE (dest); mode = GET_MODE (dest);
...@@ -16998,7 +16930,6 @@ static rtx ...@@ -16998,7 +16930,6 @@ static rtx
scale_counter (rtx countreg, int scale) scale_counter (rtx countreg, int scale)
{ {
rtx sc; rtx sc;
rtx piece_size_mask;
if (scale == 1) if (scale == 1)
return countreg; return countreg;
...@@ -17006,7 +16937,6 @@ scale_counter (rtx countreg, int scale) ...@@ -17006,7 +16937,6 @@ scale_counter (rtx countreg, int scale)
return GEN_INT (INTVAL (countreg) / scale); return GEN_INT (INTVAL (countreg) / scale);
gcc_assert (REG_P (countreg)); gcc_assert (REG_P (countreg));
piece_size_mask = GEN_INT (scale - 1);
sc = expand_simple_binop (GET_MODE (countreg), LSHIFTRT, countreg, sc = expand_simple_binop (GET_MODE (countreg), LSHIFTRT, countreg,
GEN_INT (exact_log2 (scale)), GEN_INT (exact_log2 (scale)),
NULL, 1, OPTAB_DIRECT); NULL, 1, OPTAB_DIRECT);
......
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