[flang-commits] [flang] [flang][debug] Add support for common blocks. (PR #112398)

via flang-commits flang-commits at lists.llvm.org
Thu Jan 23 05:02:54 PST 2025


jeanPerier wrote:

>> Can you give an example, I think a common block global without common linkage is most likely a bug (which is possible).
> Here is the example code and the generated fir.

I never replied to that, thanks for the example. It is actually correct and expected to not give the "common" attribute to global symbols for common block with an initial value because it is _the_ definition of the symbol (in other compilation units, it cannot be given initial values and will have the common linkage).

LLVM IR actually forbids common linkage on a global with a non zero initial value (from [LLVM ref manual](https://llvm.org/docs/LangRef.html#linkage-types): _common symbols may not have an explicit section, must have a zero initializer, and may not be marked constant_.)



https://github.com/llvm/llvm-project/pull/112398


More information about the flang-commits mailing list