This is an archive of the discontinued LLVM Phabricator instance.

[flang] Runtime API for data pointers
ClosedPublic

Authored by klausler on Jul 16 2021, 11:14 AM.

Details

Summary

Define and implement an API for use by lowering to
implement operations on pointers.

Diff Detail

Event Timeline

klausler created this revision.Jul 16 2021, 11:14 AM
klausler requested review of this revision.Jul 16 2021, 11:14 AM
This revision is now accepted and ready to land.Jul 19 2021, 2:22 AM
This revision was landed with ongoing or failed builds.Jul 19 2021, 8:23 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2021, 8:23 AM
DavidSpickett added a subscriber: DavidSpickett.EditedJul 20 2021, 2:19 AM

This change has broken the flang build on our latest-gcc bot:
https://lab.llvm.org/buildbot/#/builders/160/builds/3224

../llvm-project/flang/runtime/descriptor.h:52:22: error: array subscript ‘Fortran::runtime::Dimension[1]’ is partly outside array bounds of ‘Fortran::runtime::StaticDescriptor<0, true> [1]’ [-Werror=array-bounds]
   52 |     raw_.lower_bound = lower;
      |     ~~~~~~~~~~~~~~~~~^~~~~~~
../llvm-project/flang/runtime/descriptor-io.cpp:35:31: note: while referencing ‘statDesc’
   35 |     StaticDescriptor<0, true> statDesc;
      |                               ^~~~~~~~

Though it has gone through latest-clang fine: https://lab.llvm.org/buildbot/#/builders/180/builds/440

So could be gcc being pessimistic or clang missing something.

Can you please investigate?

Edit: "latest" gcc is 11

-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0

Fix has been pushed, and I'll keep an eye on the buildbots to make sure that they go/stay green. The warning was legitimate and I'm glad it was caught.

Bots are green.

I want to check if clang should have warned here and raise a bug if so, it does support array-bounds. Is it possible to make a small example that represents what was going on?