question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LLVM-MCA spews "unknown sub-directive" errors with GCC versions > 9.2

See original GitHub issue

https://godbolt.org/z/svnn4xEsG

This is how the MCA output looks like with GCC versions after 9.2:

<source>:12:14: error: unknown sub-directive in '.loc' directive
        .loc 1 4 86 view -0
                    ^
<source>:14:13: error: unknown sub-directive in '.loc' directive
        .loc 1 5 5 view .LVU1
                   ^
<source>:15:13: error: unknown sub-directive in '.loc' directive
        .loc 1 6 5 view .LVU2
                   ^
<source>:16:13: error: unknown sub-directive in '.loc' directive
        .loc 1 7 5 view .LVU3
...

Looks like a probable bug in MCA to me, but could be CE specific.

Edit: GCC 11.2 and current trunk appear to work at first glance, but if you scroll down to the end of the MCA output, the errors are still there: https://godbolt.org/z/4hhW64753

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
adibiagiocommented, Mar 3, 2022

Hi,

Apologies for the very late reply.

I found the following options from https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html

-gas-locview-support
Inform the compiler that the assembler supports view assignment and reset assertion checking in .loc directives.

This option will be enabled by default if, at GCC configure time, the assembler was found to support them.

-gno-as-locview-support
Force GCC to assign view numbers internally, if -gvariable-location-views are explicitly requested.

Strictly speaking, I don’t think this is an llvm-mca issue. It is more like llvm libraries don’t know how to parse these new “view assignment and reset assertion checking in .loc directives”.

As a workaround, you can pass -gno-as-locview-support to the command line for the gcc build (in your godbolt link). That should generate .loc directives that are compatible with what the llvm asm parser expects to see.

I hope it helps.

Again, apologies for the very late reply.

-Andrea

0reactions
TiborGYcommented, Jan 7, 2022

Scratch that, the errors still appear with the latest GCC versions, but for whatever reason they are displayed after the MCA output

Read more comments on GitHub >

github_iconTop Results From Across the Web

llvm-mca - LLVM Machine Code Analyzer
The main goal of this tool is not just to predict the performance of the code when run on the target, but also...
Read more >
gcc versions - ms.fr.edu.vn Search
This is how the MCA output looks like with GCC versions after 9.2: <source>:12:14: error: unknown sub-directive in '.loc' directive .loc ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found