Commit ac1fdb22 by Richard Henderson Committed by Richard Henderson

fold-const.c (fold): Even with otherwise constant trees...

        * fold-const.c (fold): Even with otherwise constant trees, look for
        opportunities to combine integer constants.

From-SVN: r20392
parent 1c5d60f5
Tue Jun 9 22:05:34 1998 Richard Henderson <rth@cygnus.com>
* fold-const.c (fold): Even with otherwise constant trees, look for
opportunities to combine integer constants.
Wed Jun 3 23:41:24 EDT 1998 John Wehle (john@feith.com) Wed Jun 3 23:41:24 EDT 1998 John Wehle (john@feith.com)
* i386.md (movsfcc, movdfcc, movxfcc): The floating point * i386.md (movsfcc, movdfcc, movxfcc): The floating point
......
...@@ -4433,9 +4433,12 @@ fold (expr) ...@@ -4433,9 +4433,12 @@ fold (expr)
return convert (TREE_TYPE (t), con); return convert (TREE_TYPE (t), con);
/* If ARG0 is a constant, don't change things around; /* If ARG0 is a constant, don't change things around;
instead keep all the constant computations together. */ instead keep all the constant computations together.
Notice, however, if we can merge integer constants. */
if (TREE_CONSTANT (arg0)) if (TREE_CONSTANT (arg0)
&& !(TREE_CODE (con) == INTEGER_CST
&& TREE_CODE (arg1) == INTEGER_CST))
return t; return t;
/* Otherwise return (CON +- ARG1) - VAR. */ /* Otherwise return (CON +- ARG1) - VAR. */
...@@ -4450,9 +4453,12 @@ fold (expr) ...@@ -4450,9 +4453,12 @@ fold (expr)
return convert (TREE_TYPE (t), con); return convert (TREE_TYPE (t), con);
/* If ARG0 is a constant, don't change things around; /* If ARG0 is a constant, don't change things around;
instead keep all the constant computations together. */ instead keep all the constant computations together.
Notice, however, if we can merge integer constants. */
if (TREE_CONSTANT (arg0)) if (TREE_CONSTANT (arg0)
&& !(TREE_CODE (con) == INTEGER_CST
&& TREE_CODE (arg1) == INTEGER_CST))
return t; return t;
/* Otherwise return VAR +- (ARG1 +- CON). */ /* Otherwise return VAR +- (ARG1 +- CON). */
...@@ -4481,7 +4487,13 @@ fold (expr) ...@@ -4481,7 +4487,13 @@ fold (expr)
if (split_tree (arg1, code, &var, &con, &varsign)) if (split_tree (arg1, code, &var, &con, &varsign))
{ {
if (TREE_CONSTANT (arg1)) /* If ARG1 is a constant, don't change things around;
instead keep all the constant computations together.
Notice, however, if we can merge integer constants. */
if (TREE_CONSTANT (arg1)
&& !(TREE_CODE (con) == INTEGER_CST
&& TREE_CODE (arg0) == INTEGER_CST))
return t; return t;
if (varsign == -1) if (varsign == -1)
......
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