Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-fstack-usage prints incorrect source file names #69889

Closed
sinelaw opened this issue Oct 22, 2023 · 0 comments · Fixed by #69896
Closed

-fstack-usage prints incorrect source file names #69889

sinelaw opened this issue Oct 22, 2023 · 0 comments · Fixed by #69896
Assignees

Comments

@sinelaw
Copy link

sinelaw commented Oct 22, 2023

Instead of printing include file names, it always prints the main source file names. This is inconsistent with gcc and makes the output ambiguous.

// test.inc:
void foo(void); void foo(void) { }

// test.c:
#include "test.inc"

gcc:

echo 'void foo(void); void foo(void) { }' > test.inc && echo '#include "test.inc"' > test.c && gcc -fstack-usage -c test.c -o test.o && cat test.su

output: test.inc:1:22:foo 16 static

clang:

echo 'void foo(void); void foo(void) { }' > test.inc && echo '#include "test.inc"' > test.c && clang-15 -fstack-usage -c test.c -o test.o && cat test.su

output: test.c:1:foo 8 static

@sinelaw sinelaw changed the title -fstack-usage print incorrect source file names -fstack-usage prints incorrect source file names Oct 22, 2023
@MaskRay MaskRay self-assigned this Oct 23, 2023
MaskRay added a commit to MaskRay/llvm-project that referenced this issue Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants