3 ms·
I don’t think there are C compilers out there that do not optimize at all. AFAIK, all of them will do some register assignment, some constant folding, etc. Fo
by Someone 5y ago
I don’t think there are C compilers out there that do not optimize at all.
AFAIK, all of them will do some register assignment, some constant folding, etc.
For example, if you write
void f(int a)
{
int b = a;
b = b + b;
g(b);
}
are there compilers out there that compile that to
- load a
- store into b
- load b
- load b into another register
- add
- store into b
- load b
- call g
- return
?
Languages that do overflow and range checks such as Julia and Rust in debug mode would have to add lots of them there if they do not do any optimization.