Move misplaced assignment in num_sign_bit_copies1
The old assignment to bitwidth was before we handled VOIDmode with: if (mode == VOIDmode) mode = GET_MODE (x); so when VOIDmode was specified we would always use: if (bitwidth < GET_MODE_PRECISION (GET_MODE (x))) { num0 = cached_num_sign_bit_copies (x, GET_MODE (x), known_x, known_mode, known_ret); return MAX (1, num0 - (int) (GET_MODE_PRECISION (GET_MODE (x)) - bitwidth)); } For a zero bitwidth this always returns 1 (which is the most pessimistic result). gcc/ 2016-11-15 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * rtlanal.c (num_sign_bit_copies1): Calculate bitwidth after handling VOIDmode. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r242440
This commit is contained in:
parent
8e4d2ca469
commit
89e64bc030
@ -1,3 +1,10 @@
|
||||
2016-11-15 Richard Sandiford <richard.sandiford@arm.com>
|
||||
Alan Hayward <alan.hayward@arm.com>
|
||||
David Sherwood <david.sherwood@arm.com>
|
||||
|
||||
* rtlanal.c (num_sign_bit_copies1): Calculate bitwidth after
|
||||
handling VOIDmode.
|
||||
|
||||
2016-11-15 Matthias Klose <doko@ubuntu.com>
|
||||
|
||||
* doc/install.texi: Remove references to gcj/libjava.
|
||||
|
@ -4795,7 +4795,6 @@ num_sign_bit_copies1 (const_rtx x, machine_mode mode, const_rtx known_x,
|
||||
unsigned int known_ret)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
unsigned int bitwidth = GET_MODE_PRECISION (mode);
|
||||
machine_mode inner_mode;
|
||||
int num0, num1, result;
|
||||
unsigned HOST_WIDE_INT nonzero;
|
||||
@ -4811,7 +4810,8 @@ num_sign_bit_copies1 (const_rtx x, machine_mode mode, const_rtx known_x,
|
||||
|| VECTOR_MODE_P (GET_MODE (x)) || VECTOR_MODE_P (mode))
|
||||
return 1;
|
||||
|
||||
/* For a smaller object, just ignore the high bits. */
|
||||
/* For a smaller mode, just ignore the high bits. */
|
||||
unsigned int bitwidth = GET_MODE_PRECISION (mode);
|
||||
if (bitwidth < GET_MODE_PRECISION (GET_MODE (x)))
|
||||
{
|
||||
num0 = cached_num_sign_bit_copies (x, GET_MODE (x),
|
||||
|
Loading…
Reference in New Issue
Block a user