rs6000.c (print_operand): Revise code that unsafely relied on signed overflow behavior.
2012-05-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * config/rs6000/rs6000.c (print_operand): Revise code that unsafely relied on signed overflow behavior. From-SVN: r187657
This commit is contained in:
parent
a4293fa661
commit
9c68125ebc
|
@ -1,3 +1,8 @@
|
|||
2012-05-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
|
||||
|
||||
* config/rs6000/rs6000.c (print_operand): Revise code that unsafely
|
||||
relied on signed overflow behavior.
|
||||
|
||||
2012-05-18 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/53346
|
||||
|
|
|
@ -14679,7 +14679,6 @@ void
|
|||
print_operand (FILE *file, rtx x, int code)
|
||||
{
|
||||
int i;
|
||||
HOST_WIDE_INT val;
|
||||
unsigned HOST_WIDE_INT uval;
|
||||
|
||||
switch (code)
|
||||
|
@ -15120,34 +15119,17 @@ print_operand (FILE *file, rtx x, int code)
|
|||
|
||||
case 'W':
|
||||
/* MB value for a PowerPC64 rldic operand. */
|
||||
val = (GET_CODE (x) == CONST_INT
|
||||
? INTVAL (x) : CONST_DOUBLE_HIGH (x));
|
||||
|
||||
if (val < 0)
|
||||
i = -1;
|
||||
else
|
||||
for (i = 0; i < HOST_BITS_PER_WIDE_INT; i++)
|
||||
if ((val <<= 1) < 0)
|
||||
break;
|
||||
i = clz_hwi (GET_CODE (x) == CONST_INT
|
||||
? INTVAL (x) : CONST_DOUBLE_HIGH (x));
|
||||
|
||||
#if HOST_BITS_PER_WIDE_INT == 32
|
||||
if (GET_CODE (x) == CONST_INT && i >= 0)
|
||||
if (GET_CODE (x) == CONST_INT && i > 0)
|
||||
i += 32; /* zero-extend high-part was all 0's */
|
||||
else if (GET_CODE (x) == CONST_DOUBLE && i == 32)
|
||||
{
|
||||
val = CONST_DOUBLE_LOW (x);
|
||||
|
||||
gcc_assert (val);
|
||||
if (val < 0)
|
||||
--i;
|
||||
else
|
||||
for ( ; i < 64; i++)
|
||||
if ((val <<= 1) < 0)
|
||||
break;
|
||||
}
|
||||
i = clz_hwi (CONST_DOUBLE_LOW (x)) + 32;
|
||||
#endif
|
||||
|
||||
fprintf (file, "%d", i + 1);
|
||||
fprintf (file, "%d", i);
|
||||
return;
|
||||
|
||||
case 'x':
|
||||
|
|
Loading…
Reference in New Issue