Finding Missed Compiler Optimizations by Differential Testing

Abstract : Randomized differential testing of compilers has had great success in finding compiler crashes and silent miscompila-tions. In this paper we investigate whether we can use similar techniques to improve the quality of the generated code: Can we compare the code generated by different compilers to find optimizations performed by one but missed by another? We have developed a set of tools for running such tests. We compile C code generated by standard random program generators and use a custom binary analysis tool to compare the output programs. Depending on the optimization of interest, the tool can be configured to compare features such as the number of total instructions, multiply or divide instructions, function calls, stack accesses, and more. A standard test case reduction tool produces minimal examples once an interesting difference has been found. We have used our tools to compare the code generated by GCC, Clang, and CompCert. We have found previously un-reported missing arithmetic optimizations in all three compilers, as well as individual cases of unnecessary register spilling, missed opportunities for register coalescing, dead stores, redundant computations, and missing instruction selection patterns.
Type de document :
Communication dans un congrès
CC'18 - 27th International Conference on Compiler Construction, Feb 2018, Vienna, Austria. 〈10.1145/3178372.3179521〉
Liste complète des métadonnées

Littérature citée [24 références]  Voir  Masquer  Télécharger

https://hal.inria.fr/hal-01682683
Contributeur : Gergö Barany <>
Soumis le : vendredi 12 janvier 2018 - 14:01:22
Dernière modification le : jeudi 24 mai 2018 - 17:18:07
Document(s) archivé(s) le : lundi 7 mai 2018 - 22:14:47

Fichier

cc2018.pdf
Fichiers produits par l'(les) auteur(s)

Identifiants

Collections

Citation

Gergö Barany. Finding Missed Compiler Optimizations by Differential Testing. CC'18 - 27th International Conference on Compiler Construction, Feb 2018, Vienna, Austria. 〈10.1145/3178372.3179521〉. 〈hal-01682683〉

Partager

Métriques

Consultations de la notice

477

Téléchargements de fichiers

321