| Summary: | Massif allocation tree missing with gcc -Og flag | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Nikolaos Chatzikonstantinou <nchatz314> |
| Component: | massif | Assignee: | Nicholas Nethercote <njn> |
| Status: | RESOLVED NOT A BUG | ||
| Severity: | minor | CC: | pjfloyd |
| Priority: | NOR | ||
| Version First Reported In: | 3.19.0 | ||
| Target Milestone: | --- | ||
| Platform: | Fedora RPMs | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Nikolaos Chatzikonstantinou
2022-06-05 05:25:11 UTC
We can't do anything in Valgrind for stuff that gets optimized away by the compiler. The example is trivial and would need modifying to work with optimization. On Linux amd64 I see, in the objdump -d disassembly output 0000000000401146 <g>: 401146: c3 ret 0000000000401147 <f>: 401147: c3 ret The calls to malloc that do not use the return value have been optimized away, which affects the massif output. On Tue, Jun 7, 2022 at 5:07 PM Paul Floyd <bugzilla_noreply@kde.org> wrote: > We can't do anything in Valgrind for stuff that gets optimized away by the > compiler. The example is trivial and would need modifying to work with > optimization. > > On Linux amd64 I see, in the objdump -d disassembly output > > 0000000000401146 <g>: > 401146: c3 ret > > 0000000000401147 <f>: > 401147: c3 ret > > The calls to malloc that do not use the return value have been optimized away, > which affects the massif output. I'm surprised that -Og optimizes away the code in f() and g(). I had misread the gcc manual. Thanks for the help! |