21 Star 26 Fork 94

src-openEuler / gcc

 / 详情

[22.03 SP3 RC3][deja]在x86架构上生成的过程或目标文件中找不到预期目标字段

已验收
缺陷
创建于  
2023-12-18 15:32

【标题描述】x86架构上生成的过程或目标文件中找不到预期目标字段

一、缺陷信息
【环境信息】
软件信息

  • OS版本及分支信息:openEuler 22.03 (LTS-SP3)
  • 内核信息:5.10.0-176.0.0.89.oe2203sp3.x86_64
  • 发现问题的组件版本信息:gcc-10.3.1-42.oe2203sp3.x86_64
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/10.3.1/lto-wrapper
目标:x86_64-linux-gnu
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,fortran,objc,obj-c++,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --without-cloog --enable-gnu-indirect-function --build=x86_64-linux-gnu --with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags=' -Wl,-z,relro,-z,now' --disable-bootstrap --with-tune=generic --with-arch_32=x86-64 --disable-multilib
线程模型:posix
Supported LTO compression algorithms: zlib
gcc 版本 10.3.1 (GCC)

【问题复现步骤】
1.用例pr45416.c

gcc ./gcc.dg/pr45416.c -fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers -fdiagnostics-color=never -fdiagnostics-urls=never -O2 -ffat-lto-objects -fno-ident -S -o pr45416.s
grep "andl" pr45416.s
grep "setne" pr45416.s

2.用例pr65871-3.c

gcc ./gcc.target/i386/pr65871-3.c -fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers -fdiagnostics-color=never -fdiagnostics-urls=never -O2 -mbmi -ffat-lto-objects -fno-ident -S -o pr65871-3.s
grep "test" pr65871-3.s

3.用例pr99305.C

g++ ./g++.dg/opt/pr99305.C -fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers -fdiagnostics-color=never -fdiagnostics-urls=never -fmessage-length=0 -std=gnu++98 -O3 -fno-ipa-icf -fdump-tree-optimized -S -o pr99305.s
grep "= [^\n\r]* <= 9" pr99305.C.241t.optimized
grep "if (c" pr99305.C.241t.optimized
grep " = PHI <" pr99305.C.241t.optimized

【实际结果】
1.用例pr45416.c需要扫描出“andl”,实际未扫描到;不需要扫描到“setne”,实际扫描到
输入图片说明
2.用例pr65871-3.c不需要扫描到,实际扫描到
输入图片说明
3.用例r99305.C(3个扫描失败:a.需要扫描到3次,实际扫描到2次;b.不需要扫描到,实际扫描到;c.不需要扫描到,实际扫描到
用例
【其他相关附件信息】
比如系统message日志/组件日志、dump信息、图片等

缺陷详情参考链接:

缺陷分析指导链接:
https:xxx

附件
pr45416.c(566 Bytes)下载
纪晓慧 2023-12-18 16:05
pr65871-3.c(251 Bytes)下载
纪晓慧 2023-12-18 16:05
pr99305.C(721 Bytes)下载
纪晓慧 2023-12-18 16:05

评论 (7)

纪晓慧 创建了缺陷

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 , @Peilin Guo , @编译小伙 , @huangxiaoquan , @cf-zhao , @周磊 , @stubCode , @dingguangya , @Haijian.Zhang

openeuler-ci-bot 添加了
 
sig/Compiler
标签
纪晓慧 修改了描述
纪晓慧 优先级设置为次要
纪晓慧 计划截止日期设置为2023-12-19
纪晓慧 计划开始日期设置为2023-12-18
纪晓慧 计划截止日期2023-12-19 修改为2023-12-22

22.03-LTS-SP2 rc1 转测repo,三个用例都成功通过:
输入图片说明
输入图片说明
输入图片说明

纪晓慧 负责人设置为wangding16
wangding16 添加协作者wangding16
wangding16 负责人wangding16 修改为编译小伙
wangding16 取消协作者wangding16

22.03-LTS-SP2 rc2 转测repo,三个用例报错同issue:
输入图片说明
输入图片说明
输入图片说明

  • 尝试本地复现:基于112环境

    • ../gcc_base/configure --prefix=/home/zyd/install_gcc_base --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,fortran,objc,obj-c++,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --without-cloog --enable-gnu-indirect-function --build=x86_64-linux-gnu --with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags=' -Wl,-z,relro,-z,now' --disable-bootstrap --with-tune=generic --with-arch_32=x86-64 --disable-multilib
  • 构建出错:

    • gcc_base/gcc/common/config/i386/cpuinfo.h:584:7: 错误:‘asm’中不可能的约束
      [图片上传中…(image-IUdqlmso8nZlTRVWtCuE)]
  • 出错原因是当前112是arm环境, 需要一个x86环境来复现问题 ,当前arm的构建配置

    • ../gcc_base/configure --prefix=/home/zyd/install_gcc_base --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,fortran,objc,obj-c++,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --without-cloog --enable-gnu-indirect-function --with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags=' -Wl,-z,relro,-z,now' --disable-bootstrap --disable-multilib
  • 编译器构建成功,基于src-源码仓库

    • ../gcc-12.3.0/configure --prefix=/home/zyd/rpmbuild/BUILD/install --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,fortran,objc,obj-c++,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --without-cloog --enable-gnu-indirect-function --build=aarch64-linux-gnu --with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags=' -Wl,-z,relro,-z,now' --disable-bootstrap --with-multilib-list=lp64 --enable-bolt
    • export PATH=/home/zyd/rpmbuild/BUILD/install/bin:$PATH
  • 切换为 openEuler-22.03-LTS-SP3 分支

    • ../gcc-10.3.0/configure --prefix=/home/zyd/rpmbuild/BUILD/install10 --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,fortran,objc,obj-c++,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --without-cloog --enable-gnu-indirect-function --build=aarch64-linux-gnu --with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags=' -Wl,-z,relro,-z,now' --disable-bootstrap --with-multilib-list=lp64 --enable-bolt
编译小伙 负责人编译小伙 修改为未设置
编译小伙 负责人设置为eastb233
MC.5 通过openeuler/gcc Pull Request !163任务状态待办的 修改为已完成

3个用例加上-ftree-fold-phiopt选项后,测试通过:
输入图片说明
输入图片说明
输入图片说明

纪晓慧 任务状态已完成 修改为已验收

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(4)
5329419 openeuler ci bot 1632792936
1
https://gitee.com/src-openeuler/gcc.git
git@gitee.com:src-openeuler/gcc.git
src-openeuler
gcc
gcc

搜索帮助