Updated the code in light of the feedback from the GCC bug

This commit is contained in:
Neil Brown 2009-01-22 11:41:43 +00:00
parent fdeab43b3c
commit 0d2ea4c920
2 changed files with 6 additions and 2 deletions

View File

@ -164,6 +164,10 @@ CFLAGS="$CFLAGS -fno-strict-overflow -fno-tree-vrp"
# when compiled with -O2. One mitigation I have found is to turn off these # when compiled with -O2. One mitigation I have found is to turn off these
# particular optimisations. Since GCC 4.3.2 will be around for a long time, # particular optimisations. Since GCC 4.3.2 will be around for a long time,
# we have to leave in -fno-tree-vrp and -fno-strict-overflow for a long time too. # we have to leave in -fno-tree-vrp and -fno-strict-overflow for a long time too.
# UPDATE: According to my GCC bug, http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38929
# this problem can be fixed instead by changing my x++ into x+=1 in my code. I've done
# that, but I'm also leaving these flags in so that any other code (for example,
# that Tock might spit out) that uses increments doesn't have the same issue.
common_cflags="-Wall -ggdb3 -Isupport -fno-strict-aliasing" common_cflags="-Wall -ggdb3 -Isupport -fno-strict-aliasing"

View File

@ -37,8 +37,8 @@ int g_stopped;
} while (0) } while (0)
#define test_commutative(t,f) \ #define test_commutative(t,f) \
do {int done_x = 0; for (t x = 0; !(x == 0 && done_x == 1);x++) { done_x = 1;\ do {int done_x = 0; for (t x = 0; !(x == 0 && done_x == 1);x+=1) { done_x = 1;\
int done_y = 0; for (t y = 0; !(y == x && done_y == 1);y++) { done_y = 1;\ int done_y = 0; for (t y = 0; !(y == x && done_y == 1);y+=1) { done_y = 1;\
g_stopped = 0; \ g_stopped = 0; \
const t r0 = f(x,y,""); \ const t r0 = f(x,y,""); \
const int stopped_earlier = g_stopped; \ const int stopped_earlier = g_stopped; \