[llvm-bugs] [Bug 25938] New: WebAssembly pops a value multiple times

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 23 15:31:13 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25938

            Bug ID: 25938
           Summary: WebAssembly pops a value multiple times
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: alonzakai at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

A gcc torture test, 930930-1.c, ends up as

----
    .text
    .file   
"/b/build/slave/linux/build/src/buildbot/work/gcc/gcc/testsuite/gcc.c-torture/execute/930930-1.c"
    .globl    f
    .type    f, at function
f:                                      # @f
    .param      i32, i32, i32, i32, i32
    .result     i32
    .local      i32, i32
# BB#0:                                 # %entry
    i32.lt_u    $push1=, $3, $4
    copy_local    $6=, $0
    block       BB0_7
    br_if       $pop1, BB0_7
BB0_1:                                  # %if.end
                                        # =>This Inner Loop Header: Depth=1
    loop        BB0_5
    i32.load    $push0=, 0($3)
    i32.ge_u    $push2=, $pop0, $2
    block       BB0_4
    br_if       $pop2, BB0_4
# BB#2:                                 # %if.end
                                        #   in Loop: Header=BB0_1 Depth=1
    i32.lt_u    $push3=, $pop0, $1
    br_if       $pop3, BB0_4
# BB#3:                                 # %if.then3
                                        #   in Loop: Header=BB0_1 Depth=1
    i32.const    $5=, -4
    i32.add     $6=, $6, $5
    i32.store    $discard=, 0($6), $pop0
BB0_4:                                  # %if.end4
                                        #   in Loop: Header=BB0_1 Depth=1
    i32.const    $push4=, -4
    i32.add     $3=, $3, $pop4
    i32.ge_u    $push5=, $3, $4
    br_if       $pop5, BB0_1
BB0_5:                                  # %out
    i32.eq      $push6=, $6, $0
    br_if       $pop6, BB0_7
# BB#6:                                 # %if.then7
    call        abort
    unreachable
BB0_7:                                  # %if.end8
    return      $3
func_end0:
    .size    f, func_end0-f

    .globl    main
    .type    main, at function
main:                                   # @main
    .result     i32
    .local      i32
# BB#0:                                 # %f.exit
    i32.const    $0=, 0
    i32.const    $push0=, mem
    i32.store    $discard=, mem+396($0), $pop0
    call        exit, $0
    unreachable
func_end1:
    .size    main, func_end1-main

    .type    mem, at object             # @mem
    .bss
    .globl    mem
    .align    4
mem:
    .zero    400
    .size    mem, 400

    .type    wm_TR, at object           # @wm_TR
    .globl    wm_TR
    .align    2
wm_TR:
    .int32    0
    .size    wm_TR, 4

    .type    wm_HB, at object           # @wm_HB
    .globl    wm_HB
    .align    2
wm_HB:
    .int32    0
    .size    wm_HB, 4

    .type    wm_SPB, at object          # @wm_SPB
    .globl    wm_SPB
    .align    2
wm_SPB:
    .int32    0
    .size    wm_SPB, 4


    .ident    "clang version 3.8.0 "
    .section    ".note.GNU-stack","", at progbits
----

Note the multiple $pop0.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151223/1b6be500/attachment.html>


More information about the llvm-bugs mailing list