<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Mesa freezes when the GLSL shader contains a `for` loop with an uninitialized `i` index/counter variable"
href="https://bugs.freedesktop.org/show_bug.cgi?id=105755#c11">Comment # 11</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Mesa freezes when the GLSL shader contains a `for` loop with an uninitialized `i` index/counter variable"
href="https://bugs.freedesktop.org/show_bug.cgi?id=105755">bug 105755</a>
from <span class="vcard"><a class="email" href="mailto:imirkin@alum.mit.edu" title="Ilia Mirkin <imirkin@alum.mit.edu>"> <span class="fn">Ilia Mirkin</span></a>
</span></b>
<pre>As an aside... there's no compilation bug here. Perhaps $other driver happens
to get you a value of 0, but nothing guarantees that. Could just be luck in
precisely how they do RA. Certainly nothing in the spec.
And there are legitimate situations where a variable might be uninitialized
prior to (compiler-proven) use, e.g.
int x;
int y = 0;
loop {
if (a)
y += x;
if (b)
x = 5;
}
The compiler couldn't reasonably prove that a never happens before b does
(except in some circumstances).
Would it be the end of the world if one were to add code to zero-initialize all
variables? No - but it'd add unnecessary code to otherwise functioning shaders.
Mesa tends to stick to what's required by the spec.
(You could argue that the "shader has gone into infinite loop" case should be
handled better, with some success, but that's obviously a very
driver-backend-specific issue.)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>