aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2017-01-06 03:34:37 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2017-01-06 03:34:37 +0000
commite1d070a4f7128f98c1d5aa504ec44f41d0ac1a5a (patch)
tree7b466ed0799e625e763641ce9cfaf53ee9cde2eb /gcc/ada
parent435f3f7adf6c1ae34547c4859205f4ec7beb8a93 (diff)
downloadgcc-e1d070a4f7128f98c1d5aa504ec44f41d0ac1a5a.zip
gcc-e1d070a4f7128f98c1d5aa504ec44f41d0ac1a5a.tar.gz
gcc-e1d070a4f7128f98c1d5aa504ec44f41d0ac1a5a.tar.bz2
[bootstrap-O3,fortran] silence warning in simplify_transformation_to_array
simplify_transformation_to_array had the nested loop unrolled 7 times, which is reasonable given that it iterates over arrays of size GFC_MAX_DIMENSIONS == 7. The problem is that the last iteration increments the index, tests that it's less than result->rank, and then accesses the arrays with the incremented index. We did not optimize out that part in the 7th iteration, so VRP flagged the unreachable code as accessing arrays past the end. It couldn't possibly know that we'd never reach that part, since the test was on result->rank, and it's not obvious (for the compiler) that result->rank <= GFC_MAX_DIMENSIONS. Even an assert to that effect before the enclosing loop didn't avoid the warning turned to error, though; I suppose there might be some aliasing at play, because moving the assert into the loop does. An assert on the index itself would also work, even more efficiently, but we're just silencing the warning instead. for gcc/fortran/ChangeLog * simplify.c (simplify_transformation_to_array): Silence array bounds warning. Fix whitespace. From-SVN: r244122
Diffstat (limited to 'gcc/ada')
0 files changed, 0 insertions, 0 deletions