【标题描述】选项-O3 -fselective-scheduling2 -ftrapv -fira-loop-pressure -frename-registers -fnon-call-exceptions -fsel-sched-pipelining -fexceptions运行结果不一致
一、缺陷信息
【环境信息】
软件信息
【问题复现步骤】
gcc -w -g -O3 csmith_20240528_142820_219.c -o csmith_20240528_142820_219
./csmith_20240528_142820_219
gcc -w -g -O3 -fselective-scheduling2 -ftrapv -fira-loop-pressure -frename-registers -fnon-call-exceptions -fsel-sched-pipelining -fexceptions csmith_20240528_142820_219.c -o csmith_20240528_142820_219
./csmith_20240528_142820_219
【实际结果】
运行结果不一致
开源gcc编译的结果和-O3是一样的
Hi jixiaohuiyou, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Compiler, and any of the maintainers: @Noah , @eastb233 , @kuen , @编译小伙 , @huangxiaoquan , @cf-zhao , @周磊 , @stubCode , @Haijian.Zhang , @熊洲
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
22.03-LTS-SP4上也能复现相同问题
经定位,是commit bdb0f40cea4aa1a92ead381b645363ae0571c065引入的问题,请相关责任人进一步分析。
commit bdb0f40cea4aala92ead381b645363ae0571c065(HEAD)
Author: zhanghaijian <z.zhanghaijianchuawei.com>
Date:l Mon Jul 12 10:36:15 2021 4+0800
[Backport]tree-optimization: Avoid issueing loads in SM when possible
Reference:https://gcc.gnu.org/git/?p=gcc.git;a=Commit;h=f9elea10e657af9fb02fafecfla600740fd34409
Currently store-motion emits a load of the value in the loop
preheader even when the original loop does not contain any read
of the reference. This avoids doing this. In the conditional
store-motion case we need to mark the sunk stores with no-warning
since the control dependence is too tricky to figure out for
the uninit warning.
PR合入后,验证如下
登录 后才可以发表评论