diff options
author | Paul Berry <[email protected]> | 2013-11-28 11:11:17 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2013-12-09 10:54:23 -0800 |
commit | 97d8b770549584a2cd6b14956f15beeef0d83cad (patch) | |
tree | e39f794628a4d404f4ab59725c01ed87e47986da /src/mesa | |
parent | cb38a0dc0aaa0a5cbc2a5345ecee3c17d9d46987 (diff) |
glsl: In loop analysis, handle unconditional second assignment.
Previously, loop analysis would set
this->conditional_or_nested_assignment based on the most recently
visited assignment to the variable. As a result, if a vaiable was
assigned to more than once in a loop, the flag might be set
incorrectly. For example, in a loop like this:
int x;
for (int i = 0; i < 3; i++) {
if (i == 0)
x = 10;
...
x = 20;
...
}
loop analysis would have incorrectly concluded that all assignments to
x were unconditional.
In practice this was a benign bug, because
conditional_or_nested_assignment is only used to disqualify variables
from being considered as loop induction variables or loop constant
variables, and having multiple assignments also disqualifies a
variable from being considered as either of those things.
Still, we should get the analysis correct to avoid future confusion.
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa')
0 files changed, 0 insertions, 0 deletions