未定义行为对编译器优化的影响

Zefan Shen
{"title":"未定义行为对编译器优化的影响","authors":"Zefan Shen","doi":"10.1145/3501774.3501781","DOIUrl":null,"url":null,"abstract":"With the development of society and the improvement of life quality, people's requirements for software experience are becoming more and more stringent. Performance optimization is becoming more and more important in software design. At present, most compilers support the default optimization options of o 1, o 2 and o 3, such as the GCC compiler. In order to meet the different degrees of optimization needs of users, it provides nearly a hundred optimization options for compiling time, target file length, and execution. At the same time, compiler optimization options will adjust the code execution order, and different optimization options will treat undefined behaviors differently. This work mainly tests the impact of undefined behavior (UB) on compiler optimization at different levels. The results show that UB has both positive and negative effects on the compiler. In addition, this paper reminds programmers to learn to improve their code specifications and correctly handle these undefined behaviors.","PeriodicalId":255059,"journal":{"name":"Proceedings of the 2021 European Symposium on Software Engineering","volume":"128 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-11-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"The Impact of Undefined Behavior on Compiler Optimization\",\"authors\":\"Zefan Shen\",\"doi\":\"10.1145/3501774.3501781\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"With the development of society and the improvement of life quality, people's requirements for software experience are becoming more and more stringent. Performance optimization is becoming more and more important in software design. At present, most compilers support the default optimization options of o 1, o 2 and o 3, such as the GCC compiler. In order to meet the different degrees of optimization needs of users, it provides nearly a hundred optimization options for compiling time, target file length, and execution. At the same time, compiler optimization options will adjust the code execution order, and different optimization options will treat undefined behaviors differently. This work mainly tests the impact of undefined behavior (UB) on compiler optimization at different levels. The results show that UB has both positive and negative effects on the compiler. In addition, this paper reminds programmers to learn to improve their code specifications and correctly handle these undefined behaviors.\",\"PeriodicalId\":255059,\"journal\":{\"name\":\"Proceedings of the 2021 European Symposium on Software Engineering\",\"volume\":\"128 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2021-11-19\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings of the 2021 European Symposium on Software Engineering\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/3501774.3501781\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 2021 European Symposium on Software Engineering","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3501774.3501781","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

随着社会的发展和生活质量的提高,人们对软件体验的要求也越来越严格。性能优化在软件设计中变得越来越重要。目前,大多数编译器都支持默认的0 1、0 2和0 3的优化选项,比如GCC编译器。为了满足用户不同程度的优化需求,提供了编译时间、目标文件长度、执行等近百种优化选项。同时,编译器优化选项会调整代码执行顺序,不同的优化选项对未定义行为的处理方式也不同。本工作主要测试未定义行为(UB)在不同层次上对编译器优化的影响。结果表明,UB对编译器既有积极的影响,也有消极的影响。此外,本文还提醒程序员要学会改进自己的代码规范,正确处理这些未定义的行为。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
The Impact of Undefined Behavior on Compiler Optimization
With the development of society and the improvement of life quality, people's requirements for software experience are becoming more and more stringent. Performance optimization is becoming more and more important in software design. At present, most compilers support the default optimization options of o 1, o 2 and o 3, such as the GCC compiler. In order to meet the different degrees of optimization needs of users, it provides nearly a hundred optimization options for compiling time, target file length, and execution. At the same time, compiler optimization options will adjust the code execution order, and different optimization options will treat undefined behaviors differently. This work mainly tests the impact of undefined behavior (UB) on compiler optimization at different levels. The results show that UB has both positive and negative effects on the compiler. In addition, this paper reminds programmers to learn to improve their code specifications and correctly handle these undefined behaviors.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Customer Satisfaction in Software Development Projects A Lightweight Development of Outbreak Prevention Strategies Built on Formal Methods and xDSLs An Exploratory Teaching Proposal of Greek History Independence Events based on STEAM Epistemology, Educational Robotics and Smart Learning Technologies Merging Live Video Feeds for Remote Monitoring of a Mining Machine Incorporating energy efficiency measurement into CI\CD pipeline
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1