[llvm-bugs] [Bug 42148] New: clang hangs when compiling a code sample

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 5 18:23:15 PDT 2019


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

            Bug ID: 42148
           Summary: clang hangs when compiling a code sample
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

My command line is clang++ -O3, its version is 9.0.0

The code line is as follows:

typedef unsigned __int128 u128_t;
typedef __float128 f128_t;

typedef union
{
 f128_t f;
 u128_t i;
} union128_t;

int test(volatile f128_t *start_X_ptr, volatile f128_t *start_Y_ptr)
{
 for (unsigned iter_count = 1; iter_count <= 2; iter_count++)
 {
 union128_t read_valX = { .f = *start_X_ptr };
 union128_t read_valY = { .f = *start_Y_ptr };

 u128_t expected_val = ((iter_count - 1) * read_valY.i);
 if (read_valX.i != expected_val)
 {
 return -1;
 }

 union128_t write_valX = { .i = (iter_count * (read_valX.i + 1)) };
 union128_t write_valY = { .i = (read_valX.i + 1) };

 *start_X_ptr = write_valX.f;
 *start_Y_ptr = write_valY.f;
 }
 return 0;
}

clang hangs when it compiles the code. It consumes a lot of CPU time.

-- 
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/20190606/19c0675c/attachment.html>


More information about the llvm-bugs mailing list