[PATCH] D54327: Adding debug info to support Fortran (part 3)

Eric Schweitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 11:46:03 PDT 2019


schweitz added a comment.

In D54327#1425054 <https://reviews.llvm.org/D54327#1425054>, @aprantl wrote:

> You can simulate the relevant effect of LTO by producing two .ll files and running llvm-link on them. Alternatively you can also run llvm-lto/llvm-lto2 on them for a more complete simulation.


We admit that we're not entirely sure what we're looking for exactly, and we are not familiar with llvm-lto.  However, we conducted an experiment using llvm-lto as follows.

1. We wrote a Fortran program using separate source files.  2 of these files contained subroutines that have COMMON /foo/ specifications.  These COMMON blocks define a series of variables under different names.  (For example, variable a1 and a2 map to the same memory location in the same /foo/ COMMON block but each is from a different SUBROUTINE scopes.)

2. We ran llvm-lto on the resulting .bc files with -O3 and -O0.

3. Debugging the resulting program, we see that the variables in one subroutine are present and can be queried.  The variables in the second subroutine are present but have no location information.  We see the same behavior regardless of the optimization level.

This is a different result than we obtain when we do not manually intervene with LTO.  When compiling with our Fortran compiler and no LTO, we can set breakpoints in both of the aforementioned routines and all the expected COMMON variables are present, can be queried as to value, and have location information in the DWARF.

We are not clear if this is a problem versus working as intended, and if it is the former what, if anything, we ought to do about it.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54327/new/

https://reviews.llvm.org/D54327





More information about the llvm-commits mailing list