[Bug tree-optimization/54136] Compiling phoronix/dcraw with gcc 4.8 trunk causes infinite execution.

2012-07-31 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54136

--- Comment #1 from Andrew Pinski pinskia at gcc dot gnu.org 2012-07-31 
09:01:54 UTC ---
cam_xyz[0][j] = table[i].trans[j]

How are those two arrays (cam_xyz[0] and trans) defined?


[Bug tree-optimization/54136] Compiling phoronix/dcraw with gcc 4.8 trunk causes infinite execution.

2012-07-31 Thread venkataramanan.kumar at amd dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54136

--- Comment #2 from Venkataramanan venkataramanan.kumar at amd dot com 
2012-07-31 09:02:34 UTC ---
Created attachment 27904
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=27904
Simplied test case


[Bug tree-optimization/54136] Compiling phoronix/dcraw with gcc 4.8 trunk causes infinite execution.

2012-07-31 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54136

Andrew Pinski pinskia at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID

--- Comment #3 from Andrew Pinski pinskia at gcc dot gnu.org 2012-07-31 
09:06:55 UTC ---
 double cam_xyz[4][3];

 cam_xyz[0][j] 

Yes you are going past the array bounds of cam_xyz[0] .Rewrite the loop like:
  for (j0=0; j0  4; j0++)
  for (j=0; j  3; j++)

cam_xyz[j0][j] = table[i].trans[j0*3+j] / 1.0;

Instead of change cam_xyz to be array of size 12.


[Bug tree-optimization/54136] Compiling phoronix/dcraw with gcc 4.8 trunk causes infinite execution.

2012-07-31 Thread venkataramanan.kumar at amd dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54136

--- Comment #4 from Venkataramanan venkataramanan.kumar at amd dot com 
2012-07-31 09:22:47 UTC ---
Ok thanks will adjust the test case. 

So compiler can generate infinite loop incase of array out of bound acess?


[Bug tree-optimization/54136] Compiling phoronix/dcraw with gcc 4.8 trunk causes infinite execution.

2012-07-31 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54136

--- Comment #5 from Richard Guenther rguenth at gcc dot gnu.org 2012-07-31 
09:24:56 UTC ---
(In reply to comment #4)
 Ok thanks will adjust the test case. 
 
 So compiler can generate infinite loop incase of array out of bound acess?

Yes, anything can happen when you invoke undefined behavior like this.