freedreno/ir3: Fix uninit var warning.
authorEric Anholt <eric@anholt.net>
Wed, 8 Jul 2020 20:49:31 +0000 (13:49 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 14 Jul 2020 03:38:53 +0000 (03:38 +0000)
It's a decent bit of analysis to see that the initialization will always
happen, and my compiler isn't doing so in at least one configuration.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5834>

src/freedreno/ir3/ir3_shader.c

index 9771c66faf6f4136ad4cde45d8cf1de68c94ed9a..6ecce8fb2904a6ca47ebdfeb6dbacd28ec926629 100644 (file)
@@ -400,7 +400,7 @@ trim_constlens(unsigned *constlens,
       cur_total += constlens[i];
    }
 
-   unsigned max_stage;
+   unsigned max_stage = 0;
    unsigned max_const = 0;
    uint32_t trimmed = 0;