[llvm-bugs] [Bug 35289] New: [SystemZ] different -O0 result with -march=z13

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 13 06:37:11 PST 2017


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

            Bug ID: 35289
           Summary: [SystemZ]  different -O0 result with -march=z13
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: SystemZ
          Assignee: unassignedbugs at nondot.org
          Reporter: paulsson at linux.vnet.ibm.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19412
  --> https://bugs.llvm.org/attachment.cgi?id=19412&action=edit
reduced csmith program

Csmith has generated a program which gives a different checksum with -O0
-march=z13 compared to many other builds:

gcc -O0 -march=z10 w0.c -I/root/csmith/runtime -o a.out -w; ./a.out 1
gcc -O1 -march=z10 w0.c -I/root/csmith/runtime -o a.out -w; ./a.out 1
gcc -O0 -march=z13 w0.c -I/root/csmith/runtime -o a.out -w; ./a.out 1
gcc -O1 -march=z13 w0.c -I/root/csmith/runtime -o a.out -w; ./a.out 1
/root/llvm/build/llvm-dev/bin/clang -O0 -march=z10 w0.c -I/root/csmith/runtime
-o a.out -w; ./a.out 1
/root/llvm/build/llvm-dev/bin/clang -O3 -march=z13 w0.c -I/root/csmith/runtime
-o a.out -w; ./a.out 1
/root/llvm/build/llvm-dev/bin/clang -O3 -march=z10 w0.c -I/root/csmith/runtime
-o a.out -w; ./a.out 1
...checksum after hashing g_670.f1 : 6522DF69
checksum = 6522DF69

/root/llvm/build/llvm-dev/bin/clang -O0 -march=z13 w0.c -I/root/csmith/runtime
-o a.out -w; ./a.out 1
...checksum after hashing g_670.f1 : A988DFF7
checksum = A988DFF7

The program has been reduced and the interesting function (I think) now looks
like:

func_30:                                func_30:                             
# BB#0:                                 # BB#0:                              
        stmg    %r11, %r15, 88(%r15)            stmg    %r11, %r15, 88(%r15)
        aghi    %r15, -184                      aghi    %r15, -184
        lgr     %r11, %r15                      lgr     %r11, %r15
        lgr     %r0, %r3                        lgr     %r0, %r3
        lgr     %r1, %r2                        lgr     %r1, %r2
        stg     %r3, 176(%r11)                  stg     %r3, 176(%r11)
        larl    %r3, g_670                      larl    %r3, g_670
        llgc    %r4, 8(%r3)                     llgc    %r4, 8(%r3)
        lg      %r5, 0(%r3)                     lg      %r5, 0(%r3)
        sllg    %r14, %r5, 8                    sllg    %r14, %r5, 8
        ogr     %r4, %r14                       ogr     %r4, %r14
                                      |         lr      %r13, %r4
        risbg   %r14, %r4, 62, 191, 1 |                                      
        lr      %r13, %r14            |         risbhg  %r13, %r13, 30, 159, 
        xilf    %r13, 1               |         xihf    %r13, 1
        llihf   %r14, 4288675839                llihf   %r14, 4288675839
        oilf    %r14, 4294967040                oilf    %r14, 4294967040
        ngr     %r4, %r14                       ngr     %r4, %r14

        lr      %r14, %r13            |         risblg  %r14, %r13, 0, 159, 3
        rosbg   %r4, %r14, 0, 10, 53            rosbg   %r4, %r14, 0, 10, 53
        risbg   %r5, %r4, 8, 63, 56   |         risbgn  %r5, %r4, 8, 63, 56
        stg     %r5, 0(%r3)                     stg     %r5, 0(%r3)
        larl    %r3, g_2235                     larl    %r3, g_2235
        mvc     0(32,%r2), 0(%r3)               mvc     0(32,%r2), 0(%r3)
        stg     %r1, 168(%r11)                  stg     %r1, 168(%r11)       
        stg     %r0, 160(%r11)                  stg     %r0, 160(%r11)       
        lmg     %r11, %r15, 272(%r11)           lmg     %r11, %r15, 272(%r11)
        br      %r14                            br      %r14
.Lfunc_end6:                            .Lfunc_end6:

bin/clang -O0 -march=z10 w0.i -o a.out; ./a.out
checksum = 6522DF69
bin/clang -O0 -march=z13 w0.i -o a.out; ./a.out
checksum = A988DFF7

-- 
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/20171113/8000d791/attachment.html>


More information about the llvm-bugs mailing list