This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47153] g++ with -O3 enters infinite loop


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]