fold-const.c (fold): Replace sign-extension of a zero extended value by a single zero extension.
* fold-const.c (fold): Replace sign-extension of a zero extended value by a single zero extension. From-SVN: r18713
This commit is contained in:
parent
6e1f1f930b
commit
ba3ad5e002
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Mar 19 20:30:31 1998 Philippe De Muyter <phdm@macqel.be>
|
||||||
|
|
||||||
|
* fold-const.c (fold): Replace sign-extension of a zero extended
|
||||||
|
value by a single zero extension.
|
||||||
|
|
||||||
Thu Mar 19 00:58:07 1998 Jason Merrill <jason@yorick.cygnus.com>
|
Thu Mar 19 00:58:07 1998 Jason Merrill <jason@yorick.cygnus.com>
|
||||||
|
|
||||||
* except.c (init_eh): Do nothing.
|
* except.c (init_eh): Do nothing.
|
||||||
|
|
|
@ -4101,6 +4101,13 @@ fold (expr)
|
||||||
&& ! final_ptr)
|
&& ! final_ptr)
|
||||||
return convert (final_type, TREE_OPERAND (TREE_OPERAND (t, 0), 0));
|
return convert (final_type, TREE_OPERAND (TREE_OPERAND (t, 0), 0));
|
||||||
|
|
||||||
|
/* If we have a sign-extension of a zero-extended value, we can
|
||||||
|
replace that by a single zero-extension. */
|
||||||
|
if (inside_int && inter_int && final_int
|
||||||
|
&& inside_prec < inter_prec && inter_prec < final_prec
|
||||||
|
&& inside_unsignedp && !inter_unsignedp)
|
||||||
|
return convert (final_type, TREE_OPERAND (TREE_OPERAND (t, 0), 0));
|
||||||
|
|
||||||
/* Two conversions in a row are not needed unless:
|
/* Two conversions in a row are not needed unless:
|
||||||
- some conversion is floating-point (overstrict for now), or
|
- some conversion is floating-point (overstrict for now), or
|
||||||
- the intermediate type is narrower than both initial and
|
- the intermediate type is narrower than both initial and
|
||||||
|
|
Loading…
Reference in New Issue