[Bug tree-optimization/59892] out of bounds array access is misoptimized

2014-01-21 Thread lukasz.dorau at intel dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59892

--- Comment #3 from Lukasz Dorau  ---
(In reply to Markus Trippelsdorf from comment #2)
> When v.hosts[0] or v.hosts[1] is NULL the loop is fine, so there is
> no reason for a warning.
> The testcase is obviously invalid.
>
But v.hosts[0] and v.hosts[1] do not have to be NULL. What's more, they are
supposed not to be NULL. So why is it invalid?
I understand that the loop is erroneous, but I do not understand why
misoptimizing the code by dropping 'id < 2' loop condition is a right thing to
do? And even without any warning?


[Bug tree-optimization/59892] out of bounds array access is misoptimized

2014-01-21 Thread lukasz.dorau at intel dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59892

--- Comment #5 from Lukasz Dorau  ---
I see. Now I understand. Thanks!