Bug 103895 - Spurious “used uninitialized” warning
Summary: Spurious “used uninitialized” warning
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: 17.2
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-24 20:16 UTC by Steinar H. Gunderson
Modified: 2019-09-18 19:45 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steinar H. Gunderson 2017-11-24 20:16:16 UTC
Hi,

When compiling this GLSL compute shader:

===
#version 430

layout(local_size_x = 1) in;
uniform restrict writeonly image2D outbuf;

vec4 CS_OUTPUT_VAL;

vec4 func() {
        return CS_OUTPUT_VAL;
}

void main()
{       
        CS_OUTPUT_VAL = vec4(0.0, 0.0, 0.0, 1.0);
        vec4 val = func(); 
        imageStore(outbuf, ivec2(0, 0), val);
}
===

I get this warning:

Shader compile log: 0:9(9): warning: `CS_OUTPUT_VAL' used uninitialized

If I move func() below main() (with a forward declaration), the warning goes away.
Comment 1 GitLab Migration User 2019-09-18 19:45:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/814.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.