简体   繁体   中英

Does C dialect affect optimization in gcc?

Does C dialect affect optimization in gcc? That is (all optimization options being held the same) will gcc produce faster/slower/larger/smaller code for ANSI vs C99 vs ...?

It could, likely.

One difference between C89 ("ANSI C") and C99 is the restrict keyword added with C99, which is specifically geared towards improving optimization. While your code may not explicitly use it (because you wrote C89 code), the C language headers like <string.h> may declare function prototypes using restrict when in C99 mode. This may or may not have an effect. You'll only know when you look at the generated code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM