Commit fa139765 by Richard Guenther Committed by Richard Biener

re PR middle-end/32152 (omp lowering creates mismatched types)

2007-05-30  Richard Guenther  <rguenther@suse.de>

	PR middle-end/32152
	* gimplify.c (gimplify_omp_atomic_pipeline): Use correct
	types for comparison.
	* fold-const.c (fold_comparison): Call maybe_canonicalize_comparison
	with original typed arguments.
	* config/i386/i386.c (ix86_gimplify_va_arg): Fix type mismatches.

From-SVN: r125187
parent 722ba5ee
2007-05-30 Richard Guenther <rguenther@suse.de>
PR middle-end/32152
* gimplify.c (gimplify_omp_atomic_pipeline): Use correct
types for comparison.
* fold-const.c (fold_comparison): Call maybe_canonicalize_comparison
with original typed arguments.
* config/i386/i386.c (ix86_gimplify_va_arg): Fix type mismatches.
2007-05-30 Jakub Jelinek <jakub@redhat.com> 2007-05-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/31769 PR tree-optimization/31769
......
...@@ -4912,7 +4912,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) ...@@ -4912,7 +4912,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
if (needed_intregs) if (needed_intregs)
{ {
/* int_addr = gpr + sav; */ /* int_addr = gpr + sav; */
t = fold_convert (ptr_type_node, gpr); t = fold_convert (ptr_type_node, fold_convert (size_type_node, gpr));
t = build2 (PLUS_EXPR, ptr_type_node, sav, t); t = build2 (PLUS_EXPR, ptr_type_node, sav, t);
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, int_addr, t); t = build2 (GIMPLE_MODIFY_STMT, void_type_node, int_addr, t);
gimplify_and_add (t, pre_p); gimplify_and_add (t, pre_p);
...@@ -4920,7 +4920,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) ...@@ -4920,7 +4920,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
if (needed_sseregs) if (needed_sseregs)
{ {
/* sse_addr = fpr + sav; */ /* sse_addr = fpr + sav; */
t = fold_convert (ptr_type_node, fpr); t = fold_convert (ptr_type_node, fold_convert (size_type_node, fpr));
t = build2 (PLUS_EXPR, ptr_type_node, sav, t); t = build2 (PLUS_EXPR, ptr_type_node, sav, t);
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, sse_addr, t); t = build2 (GIMPLE_MODIFY_STMT, void_type_node, sse_addr, t);
gimplify_and_add (t, pre_p); gimplify_and_add (t, pre_p);
...@@ -4958,12 +4958,12 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) ...@@ -4958,12 +4958,12 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
} }
src_addr = fold_convert (addr_type, src_addr); src_addr = fold_convert (addr_type, src_addr);
src_addr = fold_build2 (PLUS_EXPR, addr_type, src_addr, src_addr = fold_build2 (PLUS_EXPR, addr_type, src_addr,
size_int (src_offset)); build_int_cst (addr_type, src_offset));
src = build_va_arg_indirect_ref (src_addr); src = build_va_arg_indirect_ref (src_addr);
dest_addr = fold_convert (addr_type, addr); dest_addr = fold_convert (addr_type, addr);
dest_addr = fold_build2 (PLUS_EXPR, addr_type, dest_addr, dest_addr = fold_build2 (PLUS_EXPR, addr_type, dest_addr,
size_int (INTVAL (XEXP (slot, 1)))); build_int_cst (addr_type, INTVAL (XEXP (slot, 1))));
dest = build_va_arg_indirect_ref (dest_addr); dest = build_va_arg_indirect_ref (dest_addr);
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, dest, src); t = build2 (GIMPLE_MODIFY_STMT, void_type_node, dest, src);
......
...@@ -8542,7 +8542,7 @@ fold_comparison (enum tree_code code, tree type, tree op0, tree op1) ...@@ -8542,7 +8542,7 @@ fold_comparison (enum tree_code code, tree type, tree op0, tree op1)
return fold_build2 (cmp_code, type, variable1, const2); return fold_build2 (cmp_code, type, variable1, const2);
} }
tem = maybe_canonicalize_comparison (code, type, arg0, arg1); tem = maybe_canonicalize_comparison (code, type, op0, op1);
if (tem) if (tem)
return tem; return tem;
......
...@@ -5308,7 +5308,8 @@ gimplify_omp_atomic_pipeline (tree *expr_p, tree *pre_p, tree addr, ...@@ -5308,7 +5308,8 @@ gimplify_omp_atomic_pipeline (tree *expr_p, tree *pre_p, tree addr,
floating point. This allows the atomic operation to properly floating point. This allows the atomic operation to properly
succeed even with NaNs and -0.0. */ succeed even with NaNs and -0.0. */
x = build3 (COND_EXPR, void_type_node, x = build3 (COND_EXPR, void_type_node,
build2 (NE_EXPR, boolean_type_node, oldival, oldival2), build2 (NE_EXPR, boolean_type_node,
fold_convert (itype, oldival), oldival2),
build1 (GOTO_EXPR, void_type_node, label), NULL); build1 (GOTO_EXPR, void_type_node, label), NULL);
gimplify_and_add (x, pre_p); gimplify_and_add (x, pre_p);
......
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