This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Committed: Fix distribute_loop
- From: Joern Rennecke <amylaar at spamcop dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 23 Jan 2010 07:30:57 -0500
- Subject: Committed: Fix distribute_loop
distribute_loop uses the variable "res" to compute the result
before returning it. The return type is int, but the variable
res was declared "bool". When configuring with
--enable-build-with-cxx, this code is compiled with g++, which
takes bool more seriously; an assignment of 2 to a bool variable
would result in true, binary representation 00000001, so that
the return value would then be 1. Therefore, the ldist pass
would not work at all when configuring with --enable-build-with-cxx.
Fixed with the attached patch.
Committed as obvious.
2010-01-23 Joern Rennecke <amylaar@spamcop.net>
* tree-loop-distribution.c (distribute_loop): Fix declaration and
initialization of variable res to agree with return type.
Index: tree-loop-distribution.c
===================================================================
--- tree-loop-distribution.c (revision 156172)
+++ tree-loop-distribution.c (working copy)
@@ -1120,7 +1120,7 @@ ldist_gen (struct loop *loop, struct gra
static int
distribute_loop (struct loop *loop, VEC (gimple, heap) *stmts)
{
- bool res = false;
+ int res = 0;
struct graph *rdg;
gimple s;
unsigned i;