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

            Bug ID: 47891
           Summary: Miscompile under PowerPC caused by commit 5415fef3abef
           Product: new-bugs
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

Created attachment 24075
  --> https://bugs.llvm.org/attachment.cgi?id=24075&action=edit
fragment of boringssl multi-word shift code

Commit 5415fef3abef causes a miscompile in the attached test case under
powerpc.

The attached program demonstrates the issue. It appears to me that carry or
next_carry is calculated wrong for the ninth iteration of the loop. Of note,
the loop must be fully unrolled for this to happen. If I perturb the code so
that it isn't unrolled, or use -fno-unroll-loops, everything works fine.

Output under powerpc:

Failed
    Correct          Actual
 0: c71c71c71c71c9fc   c71c71c71c71c9fc
 1: 5b91f6e791f6e791   5b91f6e791f6e791
 2: 6000000000000005   6000000000000005
 3: 9e79e79e79e79ed8   9e79e79e79e79ed8
 4: 4bf2c78af2c7816e   4bf2c78af2c7816e
 5: a53d3d3d3d3d3d3d   a53d3d3d3d3d3d3d
 6: 7555555555555558   7555555555555558
 7: cf3cf3cf3cf3cfcd   cf3cf3cf3cf3cfcd
 8: d3cfa5effb5effcf   d3cfa5effb5effcf
 9: 0000000000000000   0000000000000001
10: 0000000000000000   0000000000000000

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to