Commit 5c7cd663 by Andrew Haley Committed by Andrew Haley

fold-const.c (fold): Don't transform (a0 op compound(a1,a2)) to (compound(a1,a0 op a2)) if...

2002-11-05  Andrew Haley  <aph@redhat.com>

        * fold-const.c (fold): Don't transform (a0 op compound(a1,a2))
        to (compound(a1,a0 op a2)) if a0 or a1 have side effects.

From-SVN: r58822
parent 97ab1175
2002-11-05 Andrew Haley <aph@redhat.com>
* fold-const.c (fold): Don't transform (a0 op compound(a1,a2))
to (compound(a1,a0 op a2)) if a0 or a1 have side effects.
2002-11-05 Richard Sandiford <rsandifo@redhat.com> 2002-11-05 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.h (CANNOT_CHANGE_MODE_CLASS): Move comment to... * config/mips/mips.h (CANNOT_CHANGE_MODE_CLASS): Move comment to...
......
...@@ -4783,7 +4783,9 @@ fold (expr) ...@@ -4783,7 +4783,9 @@ fold (expr)
else if (TREE_CODE_CLASS (code) == '2' else if (TREE_CODE_CLASS (code) == '2'
|| TREE_CODE_CLASS (code) == '<') || TREE_CODE_CLASS (code) == '<')
{ {
if (TREE_CODE (arg1) == COMPOUND_EXPR) if (TREE_CODE (arg1) == COMPOUND_EXPR
&& ! TREE_SIDE_EFFECTS (TREE_OPERAND (arg1, 0))
&& ! TREE_SIDE_EFFECTS (arg0))
return build (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0), return build (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0),
fold (build (code, type, fold (build (code, type,
arg0, TREE_OPERAND (arg1, 1)))); arg0, TREE_OPERAND (arg1, 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