PR tree-optimization/36978
* tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Do not fold
the generated condition.
* gcc.dg/torture/pr36978.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138415
138bc75d-0d04-0410-961f-
82ee72b054a4
2008-07-31 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/36978
+ * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Do not fold
+ the generated condition.
+
+2008-07-31 Richard Guenther <rguenther@suse.de>
+
* passes.c (init_optimization_passes): Always call
pass_early_warn_uninitialized.
* opts.c (decode_options): Do not warn about -Wuninitialized
+2008-07-31 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36978
+ * gcc.dg/torture/pr36978.c: New testcase.
+
2008-07-31 Arnaud Charlet <charlet@adacore.com>
* gnat.dg/sync_iface_test.ad[s,b]: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-funswitch-loops" } */
+
+unsigned short status;
+void foo (const _Bool flag)
+{
+ if (status == 2 || status == 7)
+ {
+ while (status != 2 && (status != 7 || !flag))
+ {
+ }
+ }
+}
+
return NULL_TREE;
}
- cond = fold_build2 (gimple_cond_code (stmt), boolean_type_node,
- gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+ cond = build2 (gimple_cond_code (stmt), boolean_type_node,
+ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
/* To keep the things simple, we do not directly remove the conditions,
but just replace tests with 0/1. Prevent the infinite loop where we