* [PATCH] Fix PR41654
@ 2009-10-10 15:06 Richard Guenther
0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2009-10-10 15:06 UTC (permalink / raw)
To: gcc-patches
This fixes PR41654 - we should, as in other places, use
canonicalize_cond_expr_cond before trying to make a GIMPLE_COND
from it.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2009-10-10 Richard Guenther <rguenther@suse.de>
PR tree-optimization/41654
* tree-ssa-ifcombine.c (ifcombine_ifandif): Properly canonicalize
a cond expr before calling gimple_cond_set_condition_from_tree.
(ifcombine_iforif): Likewise.
* gfortran.fortran-torture/compile/pr41654.f90: New testcase.
Index: gcc/tree-ssa-ifcombine.c
===================================================================
*** gcc/tree-ssa-ifcombine.c (revision 152615)
--- gcc/tree-ssa-ifcombine.c (working copy)
*************** ifcombine_ifandif (basic_block inner_con
*** 340,345 ****
--- 340,348 ----
t2 = force_gimple_operand_gsi (&gsi, t2, true, NULL_TREE,
true, GSI_SAME_STMT);
t = fold_build2 (EQ_EXPR, boolean_type_node, t2, t);
+ t = canonicalize_cond_expr_cond (t);
+ if (!t)
+ return false;
gimple_cond_set_condition_from_tree (inner_cond, t);
update_stmt (inner_cond);
*************** ifcombine_iforif (basic_block inner_cond
*** 488,493 ****
--- 491,499 ----
true, GSI_SAME_STMT);
t = fold_build2 (NE_EXPR, boolean_type_node, t,
build_int_cst (TREE_TYPE (t), 0));
+ t = canonicalize_cond_expr_cond (t);
+ if (!t)
+ return false;
gimple_cond_set_condition_from_tree (inner_cond, t);
update_stmt (inner_cond);
Index: gcc/testsuite/gfortran.fortran-torture/compile/pr41654.f90
===================================================================
*** gcc/testsuite/gfortran.fortran-torture/compile/pr41654.f90 (revision 0)
--- gcc/testsuite/gfortran.fortran-torture/compile/pr41654.f90 (revision 0)
***************
*** 0 ****
--- 1,15 ----
+ SUBROUTINE SCANBUFR (LBUFRIGNOREERROR, LBOPRPRO, LLSPLIT)
+ LOGICAL :: LBUFRIGNOREERROR, LBOPRPRO, LLSPLIT
+ INTEGER :: IBOTYP, IBSTYP
+ IF ((IBOTYP.eq.0).AND.(IBSTYP.eq.1)) GO TO 251
+ IF ((IBOTYP.eq.0).AND.(IBSTYP.eq.3)) GO TO 251
+ IF(LBUFRIGNOREERROR) THEN
+ goto 360
+ ENDIF
+ 251 CONTINUE
+ IF(LBOPRPRO.AND.LLSPLIT) THEN
+ CALL OBSCREEN
+ ENDIF
+ 360 CONTINUE
+ END SUBROUTINE SCANBUFR
+
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-10-10 14:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-10 15:06 [PATCH] Fix PR41654 Richard Guenther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).