This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix vector cshift runtime with non zero lower bounds
ClosedPublic

Authored by jeanPerier on Nov 11 2021, 2:56 AM.

Details

Summary

The source index should not be compared to zero after applying the
shift with the modulo, it must be compared to the lower bound.
Otherwise, the extent is not added in case it should and the computed
source index may be less than the lower bound, causing invalid results.

Diff Detail

Event Timeline

jeanPerier created this revision.Nov 11 2021, 2:56 AM
jeanPerier requested review of this revision.Nov 11 2021, 2:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2021, 2:56 AM
klausler accepted this revision.Nov 11 2021, 9:23 AM

Can you please also take a quick look at EOSHIFT and check my similar logic there?

This revision is now accepted and ready to land.Nov 11 2021, 9:23 AM

Can you please also take a quick look at EOSHIFT and check my similar logic there?

Sure. The code looks OK, but I will check this with a test and add this here.

Add an test with non zero lower bound for EOSHIFT too (the code was OK).