News for hackers. Stuff that matters.
Re:Own Constant Folder in C/C++ by vbezhenar on Saturday June 22, 2024 @03:45PM (#40761602)
Also I learned recently that there's `-Og` which enables optimizations suitable for debug build.
Re:Own Constant Folder in C/C++ by vlovich123 on Saturday June 22, 2024 @04:15PM (#40761818)
In practice I’ve had limited success with that flag. It still seems to enable optimizations that make debugging difficult.
Re:Own Constant Folder in C/C++ by senkora on Saturday June 22, 2024 @11:15PM (#40764471)
Agreed. I like to compile most translation units with -O3 and then only compile the translation units that I want to debug with -O0. That way I can often end up with a binary that's reasonably fast but still debuggable for the parts that I care about.
Re:Own Constant Folder in C/C++ by vlovich123 on Monday June 24, 2024 @12:00AM (#40772567)
Yup that’s what I’ve resorted to (in Rust I do it at the crate level instead of translation unit). The only downside is forgetting about it and then wondering why stepping through is failing to work properly.