what every c++ programmer should know about modern compilers (w/o comments, accu 2016)
TRANSCRIPT
![Page 1: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/1.jpg)
WHAT EVERY C++ PROGRAMMER SHOULDKNOW ABOUT MODERN COMPILERS
SŁAWOMIR ZBOROWSKIACCU 2016, BRISTOL, UK
![Page 2: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/2.jpg)
SŁAWEK ZBOROWSKIWROCŁAW, POLAND
![Page 3: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/3.jpg)
OUTLINEoverviewarchitecture, inputs, targets
standard, compilers and realityundefined behavior
optimizationsoutsmarting compiler
ecosystemtooling, further optimizations
![Page 4: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/4.jpg)
OUTLINEoverviewarchitecture, inputs, targets
standard, compilers and realityundefined behavior
optimizationsoutsmarting compiler
ecosystemtooling, further optimizations
![Page 5: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/5.jpg)
![Page 6: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/6.jpg)
![Page 7: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/7.jpg)
![Page 8: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/8.jpg)
![Page 9: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/9.jpg)
![Page 10: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/10.jpg)
![Page 11: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/11.jpg)
![Page 12: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/12.jpg)
![Page 13: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/13.jpg)
h t t p : / / l e a n i n g t e c h . c o m / c h e e r p /
![Page 14: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/14.jpg)
ARCHITECTURE OVERVIEW
![Page 15: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/15.jpg)
h t t p s : / / d e v h u m o r . c o m / c o n t e n t / u p l o a d s / / i m a g e s / O c t o b e r 2 0 1 5 / F r o n t - e n d - x - B a c k - e n d . j p g
![Page 16: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/16.jpg)
FLAGS Newbie -o
Junior -c, -Wl,-shared, -Wl,-static, …
Average -Wall, -Wextra, -Werror, -O2, …
Expert -finline-limit, -ftemplate-depth, …
Ninja -B, -nostdlib, …
![Page 17: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/17.jpg)
![Page 18: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/18.jpg)
OUTLINEoverviewarchitecture, inputs, targets
standard, compilers and realityundefined behavior
optimizationsoutsmarting compiler
ecosystemtooling, further optimizations
![Page 19: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/19.jpg)
![Page 20: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/20.jpg)
h t t p : / / c o m m u n i t y . f a n s s h a r e . c o m / p i c 1 0 8 / w / t r a d u c i a n i s m / 1 2 0 0 / 1 7 5 2 _ c a u t i o n _ t h i s _ i s _ s p a r t a _ j e x . j p g
![Page 21: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/21.jpg)
![Page 22: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/22.jpg)
![Page 23: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/23.jpg)
h t t p : / / f a c s t a f f . c b u . e d u / s e i s e n / C a d F a 0 9 1 3 _ f i l e s / i m a g e 0 3 2 . j p g
![Page 24: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/24.jpg)
UNDEFINEDBEHAVIORSANITIZER
![Page 25: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/25.jpg)
h t t p s : / / w w w . y o u t u b e . c o m / w a t c h ? v = H f - z n K i V w y k
![Page 26: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/26.jpg)
OUTLINEoverviewarchitecture, inputs, targets
standard, compilers and realityundefined behavior
optimizationsoutsmarting compiler
ecosystemtooling, further optimizations
![Page 27: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/27.jpg)
OPTIMIZATIONS
![Page 28: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/28.jpg)
OUTSMARTING COMPILER1 auto tmp = a;2 a = b;3 b = tmp;
1 a ̂= b;2 b ̂= a;3 a ̂= b;
h t t p s : / / w w w . y o u t u b e . c o m / w a t c h ? v = b S 5 P _ L A q i V g
![Page 29: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/29.jpg)
![Page 30: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/30.jpg)
COMPILER'S KNOWLEDGECPU CACHES
CPU EXTENSIONSCPU PERFORMANCE BUGS
INSTRUCTION SIZES (IN BINARY)…
![Page 31: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/31.jpg)
OUTLINEoverviewarchitecture, inputs, targets
standard, compilers and realityundefined behavior
optimizationsoutsmarting compiler
ecosystemtooling, further optimizations
![Page 32: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/32.jpg)
INSTRUMENTALIZATIONADDRESS SANITIZERMEMORY SANITIZERCONTROL FLOW SANITIZERTHREAD SANITIZEREFFICIENCY SANITIZER…
h t t p s : / / b o u r n e t o c o d e . c o m / p r o j e c t s / G C S E _ C o m p u t i n g _ F u n d a m e n t a l s / p a g e s / i m g / R A M . j p g
h t t p : / / c r e a t e . p r o / b l o g / w p - c o n t e n t / u p l o a d s / 2 0 1 4 / 1 2 / M a c - P r o - M u l t i - C o r e - P r o c e s s o r - 3 -e 1 4 1 8 6 5 8 6 8 9 8 7 8 . j p g
![Page 33: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/33.jpg)
CLANG TOOLSCLANG-FORMATCLANG-TIDYCLANG-COMPLETECLANG-ANALYZER…
h t t p s : / / u p l o a d . w i k i m e d i a . o r g / w i k i p e d i a / e n / 4 / 4 c / L L V M _ L o g o . s v g
![Page 34: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/34.jpg)
TEMPLIGHT / TEMPLATOR
h t t p s : / / g i t h u b . c o m / m i k a e l - s - p e r s s o n / t e m p l i g h t - t o o l s
![Page 35: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/35.jpg)
SYNTH
![Page 36: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/36.jpg)
STOKEStochastic optimizer (x86_64)
![Page 37: What every C++ programmer should know about modern compilers (w/o comments, ACCU 2016)](https://reader030.vdocument.in/reader030/viewer/2022012323/587bded01a28ab834d8b7133/html5/thumbnails/37.jpg)
THANKS!!