summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index ecd6961daf6..5db36c2a5eb 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -55,6 +55,10 @@ Boston, MA 02111-1307, USA. */
extern void free PROTO((void *));
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
@@ -2605,10 +2609,10 @@ substitute_in_expr (exp, f, r)
op0 = (TREE_CHAIN (exp) == 0
? 0 : substitute_in_expr (TREE_CHAIN (exp), f, r));
op1 = substitute_in_expr (TREE_VALUE (exp), f, r);
- if (op0 == TREE_CHAIN (exp) || op1 == TREE_VALUE (exp))
+ if (op0 == TREE_CHAIN (exp) && op1 == TREE_VALUE (exp))
return exp;
- return tree_cons (TREE_PURPOSE (exp), op0, op1);
+ return tree_cons (TREE_PURPOSE (exp), op1, op0);
}
abort ();
@@ -4361,7 +4365,7 @@ get_unwidened (op, for_type)
if (TREE_CODE (op) == COMPONENT_REF
/* Since type_for_size always gives an integer type. */
&& TREE_CODE (type) != REAL_TYPE
- /* Don't crash if field not layed out yet. */
+ /* Don't crash if field not laid out yet. */
&& DECL_SIZE (TREE_OPERAND (op, 1)) != 0)
{
unsigned innerprec = TREE_INT_CST_LOW (DECL_SIZE (TREE_OPERAND (op, 1)));