SlideShare ist ein Scribd-Unternehmen logo
1 von 82
Downloaden Sie, um offline zu lesen
How it's madeC++ compilers
Createdby SławomirZborowski
- MariuszMax Kolonko
Average journalistdocuments whathas happened. Good journalist
explains why thathappened.
Agenda
GCC
Preprocessor
Compiler
Front-end, AST
Middle-end, optimization passes
Back-end, RTL
Linker
Tests
GCC - compilation controller
WhyGCC?
Because we use it
Multiple languages:C, C++, Fortran, Java, Mercury, …
Multiple architectures:ARM, MN10300, PDP-10, AVR32, …
Before we go
Whathappens when developers design a logo?
"Do whatyou do bestand outsource the rest"
GCC - compilation controller
cc1- preprocessor and compiler
Output→ AT&T/Intel assembler file (*.s)
Use ­Eflag to preprocess only
Use ­Sflag to preprocess and compile
as- assembler (from binutils)
Output→ objectfile (*.o)
Use ­cflag to ignore the linker
collect2- linker
Output→ shared object/ELF(*.so, *)
The preprocessor
Entry-point
Almostno safety
C++ standard defines interresting requirements
Min. #includenesting levels - 15
Min. number of macros in one translation unit- 4095
Min. number of character in line - 4096
GCC preprocessor is limited bymemory
Preprocessor on steroids
People use preprocessor to do varietyof things
Usually, itis justbad habit
Some people uses more than one preprocessor :-)
@Gynvael Coldwind
1floatfast_sin(intdeg){
2 staticconstfloatsin_table[]={<?php
3 for($i=0;$i<359;$i++)
4 echo(sin($i).",");
5 echo(sin($i));
6 ?>};
7 returnsin_table[deg%360];
8};
php my.c | gcc ­x c ­
Hmm... good idea, butkind of naïve. Surelywe can do better!
Let's replace the preprocessor
Example motivation:diab &#pragma once
Time to hack
1#!/usr/bin/envpython
2importrandom,re,subprocess,sys;x=sys.argv
3
4try:
5 i,o=x[x.index('-D_GNU_SOURCE')+1],x[x.index('-o')+1]+'_'
6 ifnotre.search('.hp?p?$',i):raiseRuntimeError
7 g='_{0}_{1}'.format(random.randrange(2**32),i.replace('.','_'))
8 withopen(i)ash,open(o,'w')asf:
9 f.write('#ifndef{0}n#define{0}n{1}n#endif'.format(
10 g,h.read().replace('#pragmaonce','')))
11 n=[[e,o][e==i]foreinx[1:]]
12except(ValueError,RuntimeError):n=x[1:][:]
13p=subprocess.Popen(['/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1plus']+n)
14p.communicate();sys.exit(p.returncode)
Let's use it!
g++ ­no­integrated­cpp ­std=c++11 ­
B/path/to/script example.cpp
1#ifndef_3121294961_example_cpp
2#define_3121294961_example_cpp
3
4template<typenameT>
5Tadd(Ta,Tb){returna+b;}
6
7#endif
8
9intmain(void){returnadd(1,2);}
Okay, getback to the topic
cc1 - From input to output
IN → Front-end → Middle-end → Back-end → OUT
Frontend overview
C/C++ → AST → Generic
Itallstarts with lexer &parser
Immediate representation - AST
Atthe end - language-independent
Parsing
Simple example:
Basic lexers base on regular expressions
Statements are tokenized
x can be mapped to {id, 1}, where 1 is an index in symbol
table
a, b → {id, 2}, {id, 3}
+, *can be mapped to token table
3 can be mapped to constanttable
The lexer does notdefine anyorder
It's justtokenization
1x=a+b*3;
AST
Eventuallyparser emits AST
AST stands for AbstractSyntax Tree
Example expression:a + (b * 3)
AST
AST
AST
AST
AST
AST
AST
AST
AST
AST
AST
AST
AST
AST
AST
Semantic analysis
Compiler needs to check syntax tree with language definition
This analysis saves type information in symboltable
Type checking is also performed (e.g. array[1.f]is ill-
formed)
Implicitconversions are likelyto happen
Symbol table
GCC mustrecord variables in so-called symboltable
Itcontains information abouttype, storage, scope, etc.
Itis builtincrementallybyanalysing phases
Scopes are veryimportant
Generic
The code is correctin regards to syntax &language semantics
Itis also stored as AST
Although AST is abstract, itis notgeneric enough
Language-specific AST nodes are replaced
Rightfrom now, middle-end kicks in
Middle-end overview
→ GIMPLE → SSA → Optimize → RTL →
Generic → GIMPLE
SSAtransformation
Optimization passes
Un-SSAtransformation
RTL, suitable for back-end
GIMPLE
Modified GENERIC form
Only3 operands per expression
Why3? Three-address instructions
Function calls are exception
No nested function calls
Some controlstructures are represented with ifs and gotos
GIMPLE
Too complex expressions are breaked down to expression
temporaries
Example:
a = b + c + d
becomes
T1 = b + c
a = T1 + d
GIMPLE
Another example:
a = b ? c : d
becomes
if (b == 1)
  T1 = c
else
  T1 = d
a = T1
GIMPLE instruction set
GIMPLE_ASM GIMPLE_ASSIGN GIMPLE_BIND
GIMPLE_CALL GIMPLE_CATCH GIMPLE_COND
GIMPLE_DEBUG GIMPLE_EH_FILTER GIMPLE_GOTO
GIMPLE_LABEL GIMPLE_NOP GIMPLE_PHI
GIMPLE_RESX GIMPLE_RETURN GIMPLE_SWITCH
GIMPLE_TRY GIMPLE_OMP_* …
Static Single Assignment (SSA)
Everyvariable is assigned onlyonce
Can be used as a read-onlyvalue multiple times
In ifstatemens merging takes place
PHIfunction
GCC performs over 20 optimizations on SSAtree
GIMPLE vs SSA
1a=3;
2b=9;
3c=a+b;
4a=b+1;
5d=a+c;
6returnd;
1a_1=3;
2b_2=9;
3c_3=a_1+b_2;
4a_4=b_2+1;
5d_5=a_4+c_3;
6_6=d_5;
7return_6;
Optimizations
Whyoptimize?
Whyin this phase?
Requirements
Optimization mustnotchange program behaviour
Itmustimprove program overallperformance
Compilation time mustbe keptreasonable
Engineering efforthas to be feasible
Optimizations & middle-end
Dead code ellimination
Constantpropagation
Strength reduction
Tailrecursion ellimination
Inlining
Vectorization
Dead code elimination
The task is simple:simplyremove unreachable code
Simplifyif statements with constantconditions
Remove exception handling constructs surrounding non-
throwing code
…
Constant propagation
1a_1=3;
2b_2=9;
3c_3=a_1+b_2;
4a_4=b_2+1;
5d_5=a_4+c_3;
6_6=d_5;
7return_6;
1a_1=3;
2b_2=9;
3c_3=12;
4a_4=b_2+1;
5d_5=a_4+c_3;
6_6=d_5;
7return_6;
1a_1=3;
2b_2=9;
3c_3=12;
4a_4=10;
5d_5=a_4+c_3;
6_6=d_5;
7return_6;
1a_1=3;
2b_2=9;
3c_3=12;
4a_4=10;
5d_5=22;
6_6=d_5;
7return_6;
Itcould justbe
SSAhelps here a lot
1return22;
Strength reduction
Goal:reduce the strength of an expression
Example:
1unsignedfoo(unsigneda){
2 returna/4;
3}
1shrl $2,%edi
…and less intuitive one:
1unsignedbar(unsigneda){
2 returna*9+17;
3}
1leal 17(%rdi,%rdi,8),%eax
Tail recursion elimination
1intfactorial(intx){
2 return(x>1)
3 ?x*factorial(x-1)
4 :1;
5}
1intfactorial(intx){
2 intresult=1;
3 while(x>1){
4 result*=x--;
5 }
6 returnresult;
7}
Why? Recursion running in constantspace.
Inlining
Based on mem-space/time costs
Notpossible when:
­fno­inlineswitch is used
conflicting __attribute__`s
Forbidden when:
callto alloca, setjmp, or longjmp
non-localgoto instruction
recursion
variadic argumentlist
Vectorization
One of GCC's concurrencymodel
Compiler uses sse, sse2, sse3, …to make program faster
Enabled by­O3or ­ftree­vectorize
There are more than 25 cases where vectorization can be
done
e.g. backward access, multidimensionalarrays, conditions,
nested loops, …
With ­ftree­vectorizer­verbose=Nswitch,
vectorization can be debugged
Vectorization
1inta[256],b[256],c[256];
2voidfoo(){
3 for(inti=0;i<256;i++){
4 a[i]=b[i]+c[i];
5 }
6}
Scalar:
1.L3:
2 movl -4(%rbp),%eax
3 cltq
4 movl b(,%rax,4),%edx
5 movl -4(%rbp),%eax
6 cltq
7 movl c(,%rax,4),%eax
8 addl %eax,%edx
9 movl -4(%rbp),%eax
10 cltq
11 movl %edx,a(,%rax,4)
12 addl $1,-4(%rbp)
Vectorized:
1.L3:
2 movdqa b(%rax),%xmm0
3 addq $16,%rax
4 paddd c-16(%rax),%xmm0
5 movdqa %xmm0,a-16(%rax)
6 cmpq $1024,%rax
7 jne .L3
Outsmarting GCC
1unsignedintfoo(unsignedchari){
2 returni|(i<<8)|(i<<16)|(i<<24);
3}//3*SHL,3*OR
Human
GCC
5unsignedintbar(unsignedchari){
6 unsignedintj=i|(i<<8);
7 returnj|(j<<16);
8}//2*SHL,2*OR
10unsignedintbaz(unsignedchari){
11 returni*0x01010101;
12}//1*IMUL
Outsmarting GCC
1intfsincos_(doublearg){
2 returnsin(arg)+cos(arg);
3}
1leaq 8(%rsp),%rdi
2movq %rsp,%rsi
3call sincos
4movsd 8(%rsp),%xmm0
5addsd (%rsp),%xmm0
6addq $24,%rsp
7cvttsd2si %xmm0,%eax
Onlyon architectures with FPU
Actually, this is FPU+ SSE
Outsmarting GCC
Which wayis the bestto resetaccumulator?
1mov $0,%eax
2add $0,%eax
3sub %eax,%eax
4xor %eax,%eax
#b800000000
#83e000
#2900
#3100
Answer:sub. Did you know it? GCCdid.
Outsmarting GCC
Compilers are gootatoptimization
Letthem optimize
Programmer should focus on writing readable code
Back-end
Register Transfer Language
(RTL)
Inspired byLisp
Itdescribes instructions to be output
GIMPLE → RTL
GIMPLE:
1unsignedintbaz(unsignedchar)(unsignedchari){
2 unsignedintD.2202;
3 intD.2203;
4 intD.2204;
5
6 D.2203=(int)i;
7 D.2204=D.2203*16843009;
8 D.2202=(unsignedint)D.2204;
9 returnD.2202;
10}
RTL:
(insn#002(parallel[
(set(reg:SI0ax[orig:60D.2207][60])
(mult:SI(reg:SI0ax[orig:59D.2207][59])
(const_int16843009[0x1010101])))
(clobber(reg:CC17flags))
])rtl.cpp:2#{*mulsi3_1}
(expr_list:REG_DEAD(reg:SI0ax[orig:59D.2207][59])
(expr_list:REG_UNUSED(reg:CC17flags)
(nil))))
RTL Objects
There are multiple types of RTLobjects:
Expressions
Integers, wide integers
Strings
Vectors
RTL Classes
There are few categories of RTLexpressions
RTX_UNARY: NOT, SQRT, ABS
RTX_OBJ: MEM, REG, VALUE
RTX_COMPARE: GE, LT
RTX_COMM_COMPARE: EQ, NE
RTX_COMM_ARITH: PLUS, MULT
…
Register allocation
The task:ensure thatmachine resources (registers) are used
optimally.
There are two types of register allocators:
LocalRegister Allocator
GlobalRegister Allocator
Since GCC 4.8 messyreload.c was replaced with LRA
Register allocation
The problem:interference-graph-coloring
Colors == registers
Assign registers (colors) to temporaries
Finding k-coloring graph is NP-complete, so GCC uses
heurestic method
In case of failure some of variables are stored in memory
Two variables can share registers onlywhen onlyone of them
live atanypointof the program
Register allocation - example
Instructions Live variables
a
b = a + 2
b, a
c = b *b
a, c
b = c + 1
a, b
return a *b
We can mess with compiler
1registerintvariableasm("rbx");
However…this is nota good idea (unless you have a verygood
reason)
Variable can be optimized
Register stillcan be used byother variables
Instruction scheduling
Goal:minimize length of the criticalpath
Goal:maximize parallelism opportunities
How does itwork?
1. Build the data dependence graph
2. Calculate priorities for each instruction
3. Iterativelyschedule readyinstructions
Used before and after register allocation
Instruction scheduling
Works wellin case of unrelated expressions
1a=x+1;
2b=y+2;
3c=z+3;
IF RF EX ME WB
Software pipelining
IF RF EX ME WB
IF RF EX ME WB
Instruction selection
GCC picks instruction from the setavailable for given target
Each instruction has its cost
Addressing mode is also selected
RTL → ASM
Registers - allocated
Expressions - ordered
Instructions - selected
RTL Optimizations
Optimizations performed on RTLform
Rematerialization
Re-compute value of particular variable multiple times
Smaller register pressure, more CPUwork
Should happen onlywhen time of the computation is lesser
than load
Expression mustnothave side effects
Experimentalresults show 1-6%execution performance _
Common Subexpression
Elimination
Finds subexpressions thatoccurs in multiple places
Decides whether additionaltemporarywould make program
faster
Example:
Becomes:
CSE works also with functions
1k=i+j+10;
2r=i+j+30;
1movl 8(%rsp), %esi
2addl 12(%rsp),%esi
3xorl %eax, %eax
4leal 30(%rsi),%edx
5addl $10, %esi
Loop-invariant code motion
Move variables thatdo notdepend on the loop outside its
body
Benefits:less calculations &constants in registers
Example:
Becomes:
Can introduce high register pressure → rematerialization
1for(inti=0;i<n;i++){
2 x=y+z;
3 a[i]=6*i+x*x;
4}
1x=y+z;
2t1=x*x;
3for(inti=0;i<n;i++){
4 a[i]=6*i+t1;
5}
More RTL optimizations
Jump bypassing
Controlflow graph cleanup
Loop optimizations
Instruction combination
…
Linker (collect2)
collect2reallyuses ld
Performs consolidation of multiple objectfiles
gold- better linker, butonlyfor ELF
Link time optimizations
GCC optimizations are constrained to single translation unit
When LTO is enabled objectfiles include GIMPLE trees
Localoptimizations are applied globally:
Dead code ellimination
Constantpropagation
…
GCC test suites
Gcc is tested byover 19k of tests
Testsuites employDejaGnu, Tcl, and expecttools
Each testis a C file with specialcomments
Testresults are
PASS:the testpassed as expected
XPASS:the testunexpectedlypassed
FAIL:the testunexpectedlyfailed
XFAIL:the testfailed as expected
ERROR:the testsuite detected an error
WARNING:the testsuite detected a possible problem
UNSUPPORTED:the testis notsupported on this platform
string-1.C
1//Testlocationofdiagnosticsforinterpretingstrings. Bug17964.
2//Origin:JosephMyers<joseph@codesourcery.com>
3//{dg-docompile}
4
5constchar*s="q";//{dg-error"unknownescapesequence"}
6
7constchar*t=" ";//{dg-error"unknownescapesequence"}
8
9constchar*u="";
ambig2.C
1//PRc++/57948
2
3structBase{ };
4structDerived:Base
5{
6 structDerived2:Base
7 {
8 structConvertibleToBothDerivedRef
9 {
10 operatorDerived&();
11 operatorDerived2&();
12 voidbind_lvalue_to_conv_lvalue_ambig(ConvertibleToBothDerivedRef
both)
13 {
14 Base&br1=both;//{dg-error"ambiguous"}
15 }
16 };
17 };
18};
dependend-name3.C
1//{dg-docompile}
2
3//Dependentarraysofinvalidsizegenerateappropriateerrormessages
4
5template<intI>structA
6{
7 staticconstintzero=0;
8 staticconstintminus_one=-1;
9};
10
11template<intN>structB
12{
13 intx[A<N>::zero]; //{dg-error"zero"}
14 inty[A<N>::minus_one]; //{dg-error"negative"}
15};
16
17B<0>b;
DG commands
dg­do
preprocess, compile, assemble, link, run
dg­options
dg­error
dg­warning
dg­bogus
…
Auxilliary tools
Tools everydeveloper should be aware of…
nm- helps examinating symbols in objectfiles
objdump- displays information from objectfiles
c++filt- demangles C++ symbols
addr2line- converts offsets to lines and filenames
…, see binutils
Bonus slide
Which came first, the chicken or the egg?
Firstcompilers were written in…assembly
Itwas challenging because of poor hardware resources
Itis believed thatfirstcompiler was created byGrace Hopper,
for A-0
Firstcomplete compiler - FORTRAN, IBM, 1957
Firstmulti-architecture compiler - COBOL, 1960
Register Allocation - Graph coloring
Compilers - Principles, Techniques &Tools
Resources
Fromsources tobinary,RedHat mag
GCC:howtopreparea test case
Parallel Programming andOptimizationwithGCC
Sourcecodeoptimization
RegisterrematerializationinGCC
[1] [2] [3]
TreegionInstructionScheduling inGCC
Introductiontoinstructionscheduling
Addressing modeselectioninGCC
Link TimeOptimizationinGCC
[1]
areThereAnyQuestions()
? pleaseAsk()
: thankYouForYourAttention();

Weitere ähnliche Inhalte

Was ist angesagt?

Instruction Combine in LLVM
Instruction Combine in LLVMInstruction Combine in LLVM
Instruction Combine in LLVMWang Hsiangkai
 
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例National Cheng Kung University
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDBLinaro
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Geeks Anonymes
 
LLVM Backend Porting
LLVM Backend PortingLLVM Backend Porting
LLVM Backend PortingShiva Chen
 
Integrated Register Allocation introduction
Integrated Register Allocation introductionIntegrated Register Allocation introduction
Integrated Register Allocation introductionShiva Chen
 
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBshimosawa
 
Q4.11: NEON Intrinsics
Q4.11: NEON IntrinsicsQ4.11: NEON Intrinsics
Q4.11: NEON IntrinsicsLinaro
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machineAlexei Starovoitov
 
LLVM Instruction Selection
LLVM Instruction SelectionLLVM Instruction Selection
LLVM Instruction SelectionShiva Chen
 

Was ist angesagt? (20)

Instruction Combine in LLVM
Instruction Combine in LLVMInstruction Combine in LLVM
Instruction Combine in LLVM
 
What Can Compilers Do for Us?
What Can Compilers Do for Us?What Can Compilers Do for Us?
What Can Compilers Do for Us?
 
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
 
GCC LTO
GCC LTOGCC LTO
GCC LTO
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
from Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Worksfrom Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Works
 
LLVM Backend Porting
LLVM Backend PortingLLVM Backend Porting
LLVM Backend Porting
 
Integrated Register Allocation introduction
Integrated Register Allocation introductionIntegrated Register Allocation introduction
Integrated Register Allocation introduction
 
LLVM
LLVMLLVM
LLVM
 
Linux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKBLinux Kernel Booting Process (2) - For NLKB
Linux Kernel Booting Process (2) - For NLKB
 
Klee and angr
Klee and angrKlee and angr
Klee and angr
 
Q4.11: NEON Intrinsics
Q4.11: NEON IntrinsicsQ4.11: NEON Intrinsics
Q4.11: NEON Intrinsics
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Gcc porting
Gcc portingGcc porting
Gcc porting
 
LLVM Instruction Selection
LLVM Instruction SelectionLLVM Instruction Selection
LLVM Instruction Selection
 

Andere mochten auch

GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005Saleem Ansari
 
GEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions FrameworkGEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions FrameworkAlexey Smirnov
 
Principles of compiler design
Principles of compiler designPrinciples of compiler design
Principles of compiler designJanani Parthiban
 
NetBeans para Java, C, C++
NetBeans para Java, C, C++NetBeans para Java, C, C++
NetBeans para Java, C, C++Manuel Antonio
 
GCC Compiler as a Performance Testing tool for C programs
GCC Compiler as a Performance Testing tool for C programsGCC Compiler as a Performance Testing tool for C programs
GCC Compiler as a Performance Testing tool for C programsDaniel Ilunga
 
Introduction to Perl - Day 1
Introduction to Perl - Day 1Introduction to Perl - Day 1
Introduction to Perl - Day 1Dave Cross
 
Compiling Under Linux
Compiling Under LinuxCompiling Under Linux
Compiling Under LinuxPierreMASURE
 

Andere mochten auch (14)

GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005
 
GEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions FrameworkGEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions Framework
 
Principles of compiler design
Principles of compiler designPrinciples of compiler design
Principles of compiler design
 
NetBeans para Java, C, C++
NetBeans para Java, C, C++NetBeans para Java, C, C++
NetBeans para Java, C, C++
 
MinGw Compiler
MinGw CompilerMinGw Compiler
MinGw Compiler
 
HRM - PM in GCC
HRM - PM in GCCHRM - PM in GCC
HRM - PM in GCC
 
G++ & GCC
G++ & GCCG++ & GCC
G++ & GCC
 
Gccgdb
GccgdbGccgdb
Gccgdb
 
GCC Compiler as a Performance Testing tool for C programs
GCC Compiler as a Performance Testing tool for C programsGCC Compiler as a Performance Testing tool for C programs
GCC Compiler as a Performance Testing tool for C programs
 
C compilation process
C compilation processC compilation process
C compilation process
 
Introduction to Perl - Day 1
Introduction to Perl - Day 1Introduction to Perl - Day 1
Introduction to Perl - Day 1
 
Compiling Under Linux
Compiling Under LinuxCompiling Under Linux
Compiling Under Linux
 
Gcc opt
Gcc optGcc opt
Gcc opt
 
Deep C
Deep CDeep C
Deep C
 

Ähnlich wie How it's made: C++ compilers (GCC)

Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerMarina Kolpakova
 
07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilationAdam Husár
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-optJeff Larkin
 
Cray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best PracticesCray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best PracticesJeff Larkin
 
不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)Douglas Chen
 
RailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMsRailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMsLourens Naudé
 
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019corehard_by
 
AllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW SecurityAllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW SecurityAllBits BVBA (freelancer)
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingPositive Hack Days
 
HES2011 - James Oakley and Sergey bratus-Exploiting-the-Hard-Working-DWARF
HES2011 - James Oakley and Sergey bratus-Exploiting-the-Hard-Working-DWARFHES2011 - James Oakley and Sergey bratus-Exploiting-the-Hard-Working-DWARF
HES2011 - James Oakley and Sergey bratus-Exploiting-the-Hard-Working-DWARFHackito Ergo Sum
 
0100_Embeded_C_CompilationProcess.pdf
0100_Embeded_C_CompilationProcess.pdf0100_Embeded_C_CompilationProcess.pdf
0100_Embeded_C_CompilationProcess.pdfKhaledIbrahim10923
 
Optimization in Programming languages
Optimization in Programming languagesOptimization in Programming languages
Optimization in Programming languagesAnkit Pandey
 
What’s New in ScyllaDB Open Source 5.0
What’s New in ScyllaDB Open Source 5.0What’s New in ScyllaDB Open Source 5.0
What’s New in ScyllaDB Open Source 5.0ScyllaDB
 
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5PRADEEP
 
lec2 - Modern Processors - SIMD.pptx
lec2 - Modern Processors - SIMD.pptxlec2 - Modern Processors - SIMD.pptx
lec2 - Modern Processors - SIMD.pptxRakesh Pogula
 
Chapter Seven(2)
Chapter Seven(2)Chapter Seven(2)
Chapter Seven(2)bolovv
 
Happy To Use SIMD
Happy To Use SIMDHappy To Use SIMD
Happy To Use SIMDWei-Ta Wang
 

Ähnlich wie How it's made: C++ compilers (GCC) (20)

Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
 
07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
 
Cray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best PracticesCray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best Practices
 
不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)
 
RailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMsRailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMs
 
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
 
AllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW SecurityAllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW Security
 
New features in Ruby 2.5
New features in Ruby 2.5New features in Ruby 2.5
New features in Ruby 2.5
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash Cracking
 
HES2011 - James Oakley and Sergey bratus-Exploiting-the-Hard-Working-DWARF
HES2011 - James Oakley and Sergey bratus-Exploiting-the-Hard-Working-DWARFHES2011 - James Oakley and Sergey bratus-Exploiting-the-Hard-Working-DWARF
HES2011 - James Oakley and Sergey bratus-Exploiting-the-Hard-Working-DWARF
 
0100_Embeded_C_CompilationProcess.pdf
0100_Embeded_C_CompilationProcess.pdf0100_Embeded_C_CompilationProcess.pdf
0100_Embeded_C_CompilationProcess.pdf
 
Matopt
MatoptMatopt
Matopt
 
Optimization in Programming languages
Optimization in Programming languagesOptimization in Programming languages
Optimization in Programming languages
 
SIP Tutorial/Workshop 3
SIP Tutorial/Workshop 3SIP Tutorial/Workshop 3
SIP Tutorial/Workshop 3
 
What’s New in ScyllaDB Open Source 5.0
What’s New in ScyllaDB Open Source 5.0What’s New in ScyllaDB Open Source 5.0
What’s New in ScyllaDB Open Source 5.0
 
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5
 
lec2 - Modern Processors - SIMD.pptx
lec2 - Modern Processors - SIMD.pptxlec2 - Modern Processors - SIMD.pptx
lec2 - Modern Processors - SIMD.pptx
 
Chapter Seven(2)
Chapter Seven(2)Chapter Seven(2)
Chapter Seven(2)
 
Happy To Use SIMD
Happy To Use SIMDHappy To Use SIMD
Happy To Use SIMD
 

Mehr von Sławomir Zborowski

C++ Undefined Behavior (Code::Dive 2016)
C++ Undefined Behavior (Code::Dive 2016)C++ Undefined Behavior (Code::Dive 2016)
C++ Undefined Behavior (Code::Dive 2016)Sławomir Zborowski
 
What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...Sławomir Zborowski
 
What every C++ programmer should know about modern compilers (w/o comments, A...
What every C++ programmer should know about modern compilers (w/o comments, A...What every C++ programmer should know about modern compilers (w/o comments, A...
What every C++ programmer should know about modern compilers (w/o comments, A...Sławomir Zborowski
 
C++17 - the upcoming revolution (Code::Dive 2015)/
C++17 - the upcoming revolution (Code::Dive 2015)/C++17 - the upcoming revolution (Code::Dive 2015)/
C++17 - the upcoming revolution (Code::Dive 2015)/Sławomir Zborowski
 
Boost.Python - domesticating the snake
Boost.Python - domesticating the snakeBoost.Python - domesticating the snake
Boost.Python - domesticating the snakeSławomir Zborowski
 
Metaprogramming in C++ - from 70's to C++17
Metaprogramming in C++ - from 70's to C++17Metaprogramming in C++ - from 70's to C++17
Metaprogramming in C++ - from 70's to C++17Sławomir Zborowski
 

Mehr von Sławomir Zborowski (9)

C++ Undefined Behavior (Code::Dive 2016)
C++ Undefined Behavior (Code::Dive 2016)C++ Undefined Behavior (Code::Dive 2016)
C++ Undefined Behavior (Code::Dive 2016)
 
What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...
 
What every C++ programmer should know about modern compilers (w/o comments, A...
What every C++ programmer should know about modern compilers (w/o comments, A...What every C++ programmer should know about modern compilers (w/o comments, A...
What every C++ programmer should know about modern compilers (w/o comments, A...
 
Algorithms for Cloud Computing
Algorithms for Cloud ComputingAlgorithms for Cloud Computing
Algorithms for Cloud Computing
 
C++17 - the upcoming revolution (Code::Dive 2015)/
C++17 - the upcoming revolution (Code::Dive 2015)/C++17 - the upcoming revolution (Code::Dive 2015)/
C++17 - the upcoming revolution (Code::Dive 2015)/
 
More functional C++14
More functional C++14More functional C++14
More functional C++14
 
Boost.Python - domesticating the snake
Boost.Python - domesticating the snakeBoost.Python - domesticating the snake
Boost.Python - domesticating the snake
 
Metaprogramming in C++ - from 70's to C++17
Metaprogramming in C++ - from 70's to C++17Metaprogramming in C++ - from 70's to C++17
Metaprogramming in C++ - from 70's to C++17
 
Boost Multi Index
Boost Multi IndexBoost Multi Index
Boost Multi Index
 

Kürzlich hochgeladen

Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdfPaige Cruz
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 

Kürzlich hochgeladen (20)

20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 

How it's made: C++ compilers (GCC)