Not So Fast: Understanding and Mitigating Negative Impacts of Compiler Optimizations on Code Reuse G
summary
Study compares 1,187 variants of 20 benchmarks compiled with GCC and Clang using the gadget analyzer GSA, and finds compiler optimizations massively change gadget sets: two thirds of gadgets in O1–O3 are new versus O0, single-optimization introduction averages ~25% (82% for some Clang transforms), expressivity rises ~37% and quality ~74%. Root causes include GPI duplication, code-layout churn and tail-call elimination. Mitigation via post-production binary recompilation (binary-level passes that merge GPIs, fix layout, reorder) removes many gadgets with negligible (~0.2%) average slowdown; disabling tail-call elimination costs ~14% slowdown.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 0:42Motivation
- 1:18Motivation Questions
- 1:30Terminology
- 3:08Gadget Set Analyzer
- 4:00Motivations
- 5:06Results
- 5:47Lowgrade increases
- 6:24Motivation question
- 7:09Gadget Set metrics
- 7:27Differential binary analysis
- 7:48Duplication of gadgetproducing instructions
- 8:39Mitigation strategy
- 9:26Transformation induced gadget introduction
- 10:36Machine dependent and endemic
- 11:06Special purpose gadgets
- 12:10Gadget introduction
- 13:21Performance cost
- 13:49TCE mitigation
- 14:21Summary
related talks
52mUnderstanding Compiler Optimization
29mEmpirical Observations about Profile-Guided Optimizations for Mainstream C/C++ Compilers
19mExploiting Undefined Behavior in C/C++ Programs for Optimization: A Study on the(…)
45mA Few Effective gcc/clang Optimizations for Embedded Systems
59mCompilers can be surprising
54mGCC/Clang Optimizations for Embedded Linux
01h 30mDangerous Optimizations in C and C++ Programming Languages
01h 27mDangerous Optimizations! in C++ - Part Deux
