register tree t;
register int length;
register int i;
+ int fro;
VA_START (p, tt);
length = tree_code_length[(int) code];
TREE_TYPE (t) = tt;
+ /* Below, we automatically set TREE_SIDE_EFFECTS and TREE_RAISED for
+ the result based on those same flags for the arguments. But, if
+ the arguments aren't really even `tree' expressions, we shouldn't
+ be trying to do this. */
+ fro = first_rtl_op (code);
+
if (length == 2)
{
/* This is equivalent to the loop below, but faster. */
register tree arg1 = va_arg (p, tree);
TREE_OPERAND (t, 0) = arg0;
TREE_OPERAND (t, 1) = arg1;
- if ((arg0 && TREE_SIDE_EFFECTS (arg0))
- || (arg1 && TREE_SIDE_EFFECTS (arg1)))
- TREE_SIDE_EFFECTS (t) = 1;
- TREE_RAISES (t)
- = (arg0 && TREE_RAISES (arg0)) || (arg1 && TREE_RAISES (arg1));
+ if (arg0 && fro > 0)
+ {
+ if (TREE_SIDE_EFFECTS (arg0))
+ TREE_SIDE_EFFECTS (t) = 1;
+ if (TREE_RAISES (arg0))
+ TREE_RAISES (t) = 1;
+ }
+ if (arg1 && fro > 1)
+ {
+ if (TREE_SIDE_EFFECTS (arg1))
+ TREE_SIDE_EFFECTS (t) = 1;
+ if (TREE_RAISES (arg1))
+ TREE_RAISES (t) = 1;
+ }
}
else if (length == 1)
{
if (TREE_CODE_CLASS (code) != 's')
abort ();
TREE_OPERAND (t, 0) = arg0;
- if (arg0 && TREE_SIDE_EFFECTS (arg0))
- TREE_SIDE_EFFECTS (t) = 1;
- TREE_RAISES (t) = (arg0 && TREE_RAISES (arg0));
+ if (fro > 0)
+ {
+ if (arg0 && TREE_SIDE_EFFECTS (arg0))
+ TREE_SIDE_EFFECTS (t) = 1;
+ TREE_RAISES (t) = (arg0 && TREE_RAISES (arg0));
+ }
}
else
{
{
register tree operand = va_arg (p, tree);
TREE_OPERAND (t, i) = operand;
- if (operand)
+ if (operand && fro > i)
{
if (TREE_SIDE_EFFECTS (operand))
TREE_SIDE_EFFECTS (t) = 1;
TREE_PERMANENT (t) = 1;
TREE_OPERAND (t, 0) = node;
- if (node)
+ if (node && first_rtl_op (code) != 0)
{
if (TREE_SIDE_EFFECTS (node))
TREE_SIDE_EFFECTS (t) = 1;