X-Git-Url: https://gitweb.dragonflybsd.org/~polachok/dragonfly.git/blobdiff_plain/144812d8c03dff8dba6ac3d0c622ccbff87024d4..1378ea41ccecbea1d5148234c9b6bac3c6147143:/contrib/gcc-3.4/gcc/fold-const.c diff --git a/contrib/gcc-3.4/gcc/fold-const.c b/contrib/gcc-3.4/gcc/fold-const.c index bcc7dcdebb..cc2698da09 100644 --- a/contrib/gcc-3.4/gcc/fold-const.c +++ b/contrib/gcc-3.4/gcc/fold-const.c @@ -8142,7 +8142,12 @@ fold (tree expr) if (INTEGRAL_TYPE_P (type) && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST - && TREE_CODE (arg2) == INTEGER_CST) + && TREE_CODE (arg2) == INTEGER_CST + /* ??? We somehow can end up here with + (unsigned int)1 == 1 ? 1U : 2U + for which we won't make any progress but recurse + indefinitely. Just stop here in this case. */ + && TREE_CODE (arg1) != INTEGER_CST) switch (comp_code) { case EQ_EXPR: @@ -8199,8 +8204,9 @@ fold (tree expr) /* If the second operand is simpler than the third, swap them since that produces better jump optimization results. */ - if (tree_swap_operands_p (TREE_OPERAND (t, 1), - TREE_OPERAND (t, 2), false)) + if (truth_value_p (TREE_CODE (arg0)) + && tree_swap_operands_p (TREE_OPERAND (t, 1), + TREE_OPERAND (t, 2), false)) { /* See if this can be inverted. If it can't, possibly because it was a floating-point inequality comparison, don't do @@ -8436,7 +8442,7 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht) { void **slot; enum tree_code code; - char buf[sizeof (struct tree_decl)]; + struct tree_decl buf; int i, len; if (sizeof (struct tree_exp) + 5 * sizeof (tree) @@ -8453,23 +8459,23 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht) if (code == SAVE_EXPR && SAVE_EXPR_NOPLACEHOLDER (expr)) { /* Allow SAVE_EXPR_NOPLACEHOLDER flag to be modified. */ - memcpy (buf, expr, tree_size (expr)); - expr = (tree) buf; + memcpy (&buf, expr, tree_size (expr)); + expr = (tree) &buf; SAVE_EXPR_NOPLACEHOLDER (expr) = 0; } else if (TREE_CODE_CLASS (code) == 'd' && DECL_ASSEMBLER_NAME_SET_P (expr)) { /* Allow DECL_ASSEMBLER_NAME to be modified. */ - memcpy (buf, expr, tree_size (expr)); - expr = (tree) buf; + memcpy (&buf, expr, tree_size (expr)); + expr = (tree) &buf; SET_DECL_ASSEMBLER_NAME (expr, NULL); } else if (TREE_CODE_CLASS (code) == 't' && (TYPE_POINTER_TO (expr) || TYPE_REFERENCE_TO (expr))) { /* Allow TYPE_POINTER_TO and TYPE_REFERENCE_TO to be modified. */ - memcpy (buf, expr, tree_size (expr)); - expr = (tree) buf; + memcpy (&buf, expr, tree_size (expr)); + expr = (tree) &buf; TYPE_POINTER_TO (expr) = NULL; TYPE_REFERENCE_TO (expr) = NULL; }