Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    玄铁编译器bug

    MR Series
    2
    3
    1447
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gb2047
      mm LV 5 last edited by

      有没有人发现,玄铁的编译器在优化的时候,把函数自动编译成inline函数时,生成的指令会导致Store/AMO address misaligned异常。比如产生的这样的指令:

      2a96:	014128a3          	sw	s4,17(sp)
      

      必须是4的倍数,不应该是17!

      加上编译选项,-fno-inline就一切正常!

      1 Reply Last reply Reply Quote Share 0
      • aozima
        aozima LV 7 last edited by

        编译器哪个版本?
        可以精简份最小代码出来?然后单独编译下这小段代码?

        gb2047 1 Reply Last reply Reply Quote Share 0
        • gb2047
          mm LV 5 @aozima last edited by

          @aozima
          Xuantie-900 elf newlib gcc Toolchain V2.6.1 B-20220906
          Xuantie-900 elf newlib gcc Toolchain V2.4.0 B-20220427

          这个比较难复现。也许加一个打印就没这个bug了

          1 Reply Last reply Reply Quote Share 0
          • 1 / 1
          • First post
            Last post

          Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

          行为准则 | 用户协议 | 隐私权政策