PR tree-optimization/32694
2006-11-08 Roger Sayle <roger@eyesopen.com>
* tree-ssa-propagate.c (set_rhs): Verify tcc_comparison the same way
as tcc_binary.
* tree-ssa-ccp.c (fold_stmt_r) <COND_EXPR>: Use set_rhs to modify
the condition after calling fold_binary.
* gcc.c-torture/compile/
20070925-1.c: New test.
From-SVN: r128766
+2007-09-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/32694
+ 2006-11-08 Roger Sayle <roger@eyesopen.com>
+ * tree-ssa-propagate.c (set_rhs): Verify tcc_comparison the same way
+ as tcc_binary.
+ * tree-ssa-ccp.c (fold_stmt_r) <COND_EXPR>: Use set_rhs to modify
+ the condition after calling fold_binary.
+
2007-09-24 Jakub Jelinek <jakub@redhat.com>
PR debug/33316
+2007-09-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/32694
+ * gcc.c-torture/compile/20070925-1.c: New test.
+
2007-09-24 Jakub Jelinek <jakub@redhat.com>
PR debug/33316
--- /dev/null
+/* PR tree-optimization/32694 */
+
+typedef signed long long int WordS64;
+typedef unsigned long long int Word64;
+
+int
+foo (Word64 * p)
+{
+ while (1)
+ {
+ WordS64 c = 0x1llu;
+ WordS64 x = *p;
+ if (c >= 0)
+ {
+ if (x > (WordS64) 0x7FFFFFFFFFFFFFFFll - c)
+ return 6;
+ }
+ else if (x < (WordS64) 0x8000000000000000ll - c)
+ return 7;
+ p++;
+ }
+}
tem = fold_binary (TREE_CODE (op0), TREE_TYPE (op0),
TREE_OPERAND (op0, 0),
TREE_OPERAND (op0, 1));
- set = tem && is_gimple_condexpr (tem);
+ set = tem && set_rhs (expr_p, tem);
fold_undefer_overflow_warnings (set, fold_stmt_r_data->stmt, 0);
if (set)
- TREE_OPERAND (expr, 0) = tem;
- t = expr;
- break;
+ {
+ t = *expr_p;
+ break;
+ }
}
default:
ssa_op_iter iter;
/* Verify the constant folded result is valid gimple. */
- if (TREE_CODE_CLASS (code) == tcc_binary)
+ if (TREE_CODE_CLASS (code) == tcc_binary
+ || TREE_CODE_CLASS (code) == tcc_comparison)
{
if (!is_gimple_val (TREE_OPERAND (expr, 0))
|| !is_gimple_val (TREE_OPERAND (expr, 1)))