Commit 23bd99ae by Richard Kenner

(optimize_bit_field_compare, decode_field_reference): Pass new arg to

get_inner_reference.

From-SVN: r13188
parent 839c4796
...@@ -2312,6 +2312,7 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs) ...@@ -2312,6 +2312,7 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs)
enum machine_mode lmode, rmode, lnmode, rnmode; enum machine_mode lmode, rmode, lnmode, rnmode;
int lunsignedp, runsignedp; int lunsignedp, runsignedp;
int lvolatilep = 0, rvolatilep = 0; int lvolatilep = 0, rvolatilep = 0;
int alignment;
tree linner, rinner; tree linner, rinner;
tree mask; tree mask;
tree offset; tree offset;
...@@ -2320,7 +2321,7 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs) ...@@ -2320,7 +2321,7 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs)
if the same as the size of the underlying object, we aren't doing an if the same as the size of the underlying object, we aren't doing an
extraction at all and so can do nothing. */ extraction at all and so can do nothing. */
linner = get_inner_reference (lhs, &lbitsize, &lbitpos, &offset, &lmode, linner = get_inner_reference (lhs, &lbitsize, &lbitpos, &offset, &lmode,
&lunsignedp, &lvolatilep); &lunsignedp, &lvolatilep, &alignment);
if (linner == lhs || lbitsize == GET_MODE_BITSIZE (lmode) || lbitsize < 0 if (linner == lhs || lbitsize == GET_MODE_BITSIZE (lmode) || lbitsize < 0
|| offset != 0) || offset != 0)
return 0; return 0;
...@@ -2329,8 +2330,8 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs) ...@@ -2329,8 +2330,8 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs)
{ {
/* If this is not a constant, we can only do something if bit positions, /* If this is not a constant, we can only do something if bit positions,
sizes, and signedness are the same. */ sizes, and signedness are the same. */
rinner = get_inner_reference (rhs, &rbitsize, &rbitpos, &offset, rinner = get_inner_reference (rhs, &rbitsize, &rbitpos, &offset, &rmode,
&rmode, &runsignedp, &rvolatilep); &runsignedp, &rvolatilep, &alignment);
if (rinner == rhs || lbitpos != rbitpos || lbitsize != rbitsize if (rinner == rhs || lbitpos != rbitpos || lbitsize != rbitsize
|| lunsignedp != runsignedp || offset != 0) || lunsignedp != runsignedp || offset != 0)
...@@ -2503,6 +2504,7 @@ decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp, ...@@ -2503,6 +2504,7 @@ decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp,
tree mask, inner, offset; tree mask, inner, offset;
tree unsigned_type; tree unsigned_type;
int precision; int precision;
int alignment;
/* All the optimizations using this function assume integer fields. /* All the optimizations using this function assume integer fields.
There are problems with FP fields since the type_for_size call There are problems with FP fields since the type_for_size call
...@@ -2523,7 +2525,7 @@ decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp, ...@@ -2523,7 +2525,7 @@ decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp,
inner = get_inner_reference (exp, pbitsize, pbitpos, &offset, pmode, inner = get_inner_reference (exp, pbitsize, pbitpos, &offset, pmode,
punsignedp, pvolatilep); punsignedp, pvolatilep, &alignment);
if ((inner == exp && and_mask == 0) if ((inner == exp && and_mask == 0)
|| *pbitsize < 0 || offset != 0) || *pbitsize < 0 || offset != 0)
return 0; return 0;
......
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