V
V
Vitaly2017-09-05 22:17:44
C++ / C#
Vitaly, 2017-09-05 22:17:44

What optimizations are used in C and C++?

I would like to see a list of optimizations performed by the compiler. I don't need a full list of low-level optimizations, such as placing variables in registers, but rather things like evaluating constant expressions or expanding simple methods (get/set). What optimizations are different in C and C++? In particular, I'm considering gcc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2017-09-06
@vitali1995

I don't need a full list of low-level optimizations, such as placing variables in registers, but rather things like evaluating constant expressions or expanding simple methods (get/set). What optimizations are different in C and C++? In particular, I'm considering gcc.

gcc -Q --help=optimizerswill list all currently enabled (other command line options) optimizations. What each of the -f* switches means can be found here: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Option...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question