[Bug 94129] Mesa's compiler should warn about undefined values

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Feb 24 11:31:19 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=94129

--- Comment #7 from Alejandro Piñeiro (freenode IRC: apinheiro) <apinheiro at igalia.com> ---
After some extra code checking on both AST and IR.

(In reply to Timothy Arceri from comment #4)
> The AST is a bit awkward to work with beyond basic validation. You would
> likely find it easier to add this in GLSL IR somewhere.

There is another reason to try to do this on the ast_to_hir pass. As in the NIR
case, at GLSL IR we don't have available the source location. This is needed if
we want to add additional information, for example, in which source line:column
number the uninitialized value is being used. All the error/warnings raised at
GLSL IR (not a lot) doesn't provide that info, and need to provide a fake
location. For example:
   memset(&loc, 0, sizeof(loc));
   _mesa_glsl_error(&loc, state,
            "function `%s' has static recursion",
            proto);

I guess that for this case, a message "var %s used initialized" is better that
nothing, but I think that is more useful if it points to the line:column number
as other warnings/errors (like undeclared variable).

(And sorry for the previous not finished comment, pressed the wrong key)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20160224/dd3f1992/attachment.html>


More information about the intel-3d-bugs mailing list