This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47153] g++ with -O3 enters infinite loop
- From: "zsojka at seznam dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 3 Jan 2011 02:36:34 +0000
- Subject: [Bug c++/47153] g++ with -O3 enters infinite loop
- Auto-submitted: auto-generated
- References: <bug-47153-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47153
--- Comment #5 from Zdenek Sojka <zsojka at seznam dot cz> 2011-01-03 02:36:27 UTC ---
You are accessing an array out of bounds:
--- sudoku_solver_single.cpp 2011-01-03 03:30:35.000000000 +0100
+++ sudoku_solver_single2.cpp 2011-01-03 03:33:28.000000000 +0100
@@ -159,6 +159,7 @@
for(x = left_box; x < left_box + 3; x++)
for(y = up_box; y < up_box + 3; y++) {
if(solved[x][y]) {
+ if (!resolve(x, y)) __builtin_abort();
status[resolve(x, y) - 1] = 2;
continue;
}
aborts