The code that calculated the canonical index for a multi-dimensional array access did not correctly estimate the index expression width in the case that the first index value was a constant zero. This patch fixes the problem, and, in passing, also makes the expression calculation more efficient if any of the indices are constant zeroes.
Also attached is an extended version of the regression test attached to the bug report. This test doesn't need any special compiler flags or a gold file.
Log in to post a comment.