Committed: Fix distribute_loop
Richard Guenther
richard.guenther@gmail.com
Sat Jan 23 13:36:00 GMT 2010
On Sat, Jan 23, 2010 at 1:30 PM, Joern Rennecke <amylaar@spamcop.net> wrote:
> 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.
Ugh. I wonder if we should use _Bool instead of int
if the host compiler supports it.
Richard.
> 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;
>
>
More information about the Gcc-patches
mailing list