mercredi 11 octobre 2017

Why does changing the return type of a function from void to int cause clang to generate substantially less code?

I was messing around with Compiler Explorer, and comparing clang output for a simple for-each loop at various optimization settings. You can see my test here.

For some reason, changing the return type of the function from void to int completely changes clang's generated assembly, though GCC's code generation remains unaffected. Does anyone know why this might be?

Aucun commentaire:

Enregistrer un commentaire