← 输入框|github.com|刷新
Skip to content

Build failure on PPC: parser_stype.h: error: static assertion failed: the comparison reduces to '(16 == 12)' #2460

Closed

Description

@barracuda156

This is likely due to 32-bitness of the arch or possibly something specific to ppc. I have no i386 set-up at hand to compare.

In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/tokenizer.h:6,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/parser.h:6,
                 from parser.yy:24,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/parser.tab.cc:91:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/parser_stype.h:115:31: error: static assertion failed
  115 | static_assert(sizeof(YYSTYPE) == sizeof(Vec<LPython::AST::ast_t*>));
      |               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/parser_stype.h:115:31: note: the comparison reduces to '(16 == 12)'
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/tokenizer.h:6,
                 from tokenizer.re:4:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/parser_stype.h:115:31: error: static assertion failed
  115 | static_assert(sizeof(YYSTYPE) == sizeof(Vec<LPython::AST::ast_t*>));
      |               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/parser_stype.h:115:31: note: the comparison reduces to '(16 == 12)'
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/tokenizer.h:6,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/parser.h:6,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/parser.cpp:7:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/parser_stype.h:115:31: error: static assertion failed
  115 | static_assert(sizeof(YYSTYPE) == sizeof(Vec<LPython::AST::ast_t*>));
      |               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_lpython/lpython/work/lpython-0.20.0/src/lpython/parser/parser_stype.h:115:31: note: the comparison reduces to '(16 == 12)'

Activity

  1. barracuda156 commented on Jan 10, 2024

    @barracuda156
    ContributorAuthor

    @certik Not sure if this is a problem or an arch specifics, but with this static assert commented out plus two minor fixes – #2459 and #2461 – lpython builds fine for me on ppc.

    There is no support for powerpc assembler in the code, so I do not know to what extent it will be usable, but it builds :)

  2. barracuda156 commented on Jan 10, 2024

    @barracuda156
    ContributorAuthor

    If this is of little concern (i.e. the code still gonna work, just slower), then something like this allows it to build: barracuda156@8ad2ce3

  3. certik commented on Jan 10, 2024

    @certik
    Contributor

    The fix at barracuda156@8ad2ce3 is fine. This is just a performance problem in parsing --- when the node is bigger than necessary (the AST node, 12 bytes in this case), we are wasting memory and copying too much, but there are no functional issues, just slightly slower performance of parsing.

  4. barracuda156 commented on Jan 11, 2024

    @barracuda156
    ContributorAuthor

    @certik Great, then I can make a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions