GLSL Compiler Bug using textureQueryLod (566.36)

I am developing a shader that uses the glsl function textureQueryLod using glsl 4.6 core. This function works but seems to be easily optimized away by the glsl compiler. The incorrect behavior can be observed but clamping the return value between 0.0, and 1.0.

I’ve already confirmed that this function does operate normally and gives values within the expected ranges.

Ive already unrolled everything to individual lines and doing so doesn’t change anything.

Examples:

textureQueryLod(sampler, coords); // This is okay
clamp(textureQueryLod(sampler, coords), 0.0, 1.0); // ALWAYS 0.0, textureQueryLod was optimized out
clamp(textureQueryLod(sampler, coords) * 1.00001, 0.0, 1.0); // Hacky solution to avoid compiler from optimizing this away

This seems to be an identical issue: