<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Spurious “used uninitialized” warning"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103895">103895</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Spurious “used uninitialized” warning
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>17.2
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Drivers/DRI/i965
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sgunderson@bigfoot.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>