https://bugs.winehq.org/show_bug.cgi?id=38327
Bug ID: 38327 Summary: Uninitialized matrix Product: Wine Version: 1.7.39 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: isakov-sl@bk.ru Distribution: ---
I got warning ----- glsl_shader.c: In function ‘shader_glsl_load_constants’: glsl_shader.c:799: warning: ‘temp._44’ is used uninitialized in this function glsl_shader.c:744: note: ‘temp._44’ was declared here glsl_shader.c:799: warning: ‘temp._43’ is used uninitialized in this function glsl_shader.c:744: note: ‘temp._43’ was declared here glsl_shader.c:799: warning: ‘temp._42’ is used uninitialized in this function glsl_shader.c:744: note: ‘temp._42’ was declared here glsl_shader.c:799: warning: ‘temp._41’ is used uninitialized in this function glsl_shader.c:744: note: ‘temp._41’ was declared here glsl_shader.c:799: warning: ‘temp._34’ is used uninitialized in this function glsl_shader.c:744: note: ‘temp._34’ was declared here glsl_shader.c:799: warning: ‘temp._24’ is used uninitialized in this function glsl_shader.c:744: note: ‘temp._24’ was declared here glsl_shader.c:799: warning: ‘temp._14’ is used uninitialized in this function glsl_shader.c:744: note: ‘temp._14’ was declared here ---- this is a function --- /* Taken and adapted from Mesa. */ static BOOL invert_matrix_3d(struct wined3d_matrix *out, const struct wined3d_matrix *in) { float pos, neg, t, det; struct wined3d_matrix temp; ... *out = temp; --- The function is for matrix 3x3 while wined3d_matrix is 4x4. But local variable (temp) is not initialized and may contain arbitrary values. Should the matrix to be zeroed explicitly or there must be function to invert 4x4 matrix?
https://bugs.winehq.org/show_bug.cgi?id=38327
Matteo Bruni matteo.mystral@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |matteo.mystral@gmail.com
--- Comment #1 from Matteo Bruni matteo.mystral@gmail.com --- Those values are not really used so it doesn't matter in practice. I don't get those warnings, what compiler / version are you using?
https://bugs.winehq.org/show_bug.cgi?id=38327
--- Comment #2 from Sergey Isakov isakov-sl@bk.ru --- (In reply to Matteo Bruni from comment #1)
Those values are not really used so it doesn't matter in practice. I don't get those warnings, what compiler / version are you using?
Apple's gcc-4.2.1 with -Os optimization. Without optimization there are no such warning. (?) Anyway those values are influences on inverted matrix. If you want I can write invert_matrix_4x4.
https://bugs.winehq.org/show_bug.cgi?id=38327
Matteo Bruni matteo.mystral@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- OS|Linux |Mac OS X
--- Comment #3 from Matteo Bruni matteo.mystral@gmail.com --- (In reply to Sergey Isakov from comment #2)
(In reply to Matteo Bruni from comment #1)
Those values are not really used so it doesn't matter in practice. I don't get those warnings, what compiler / version are you using?
Apple's gcc-4.2.1 with -Os optimization. Without optimization there are no such warning. (?)
What does happen with the default -O2?
Anyway those values are influences on inverted matrix. If you want I can write invert_matrix_4x4.
They are ignored on purpose, I'm following the GL behavior. I just thought about one testcase which should confirm that D3D does the same, I'm going to test that and send a fix if I'm wrong.
https://bugs.winehq.org/show_bug.cgi?id=38327
--- Comment #4 from Sergey Isakov isakov-sl@bk.ru --- Yes, I see really 3x3 used.
https://bugs.winehq.org/show_bug.cgi?id=38327
--- Comment #5 from Sergey Isakov isakov-sl@bk.ru --- (In reply to Matteo Bruni from comment #3)
(In reply to Sergey Isakov from comment #2)
(In reply to Matteo Bruni from comment #1)
Those values are not really used so it doesn't matter in practice. I don't get those warnings, what compiler / version are you using?
Apple's gcc-4.2.1 with -Os optimization. Without optimization there are no such warning. (?)
What does happen with the default -O2?
I see in WIKI --- J. Huk: [feb 10] "-O2" is consider safe for most software "-O3" is not - from my experience, wine will [crash] with most apps, when compiled with "-O3" ---
But this is very old advice. For me -Os works fine in all cases.
https://bugs.winehq.org/show_bug.cgi?id=38327
--- Comment #6 from Matteo Bruni matteo.mystral@gmail.com --- I'm just asking if you still get warnings with the default -O2.
https://bugs.winehq.org/show_bug.cgi?id=38327
--- Comment #7 from Sergey Isakov isakov-sl@bk.ru --- Never saw before
https://bugs.winehq.org/show_bug.cgi?id=38327
Sergey Isakov isakov-sl@bk.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |WONTFIX
--- Comment #8 from Sergey Isakov isakov-sl@bk.ru --- Not important
https://bugs.winehq.org/show_bug.cgi?id=38327
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED Resolution|WONTFIX |INVALID
--- Comment #9 from Nikolay Sivov bunglehead@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=38327
--- Comment #10 from Sergey Isakov isakov-sl@bk.ru --- I think status of this bug must be WONT FIX because compiler warnings present.