[llvm-bugs] [Bug 40757] New: Compilation does not end when -O3 or more is set.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 18 02:39:29 PST 2019


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

            Bug ID: 40757
           Summary: Compilation does not end when -O3 or more is set.
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: ueno.masakazu at jp.fujitsu.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

When compiling the following program(bug498.c) with -O3 or more, compilation
does not end.

I think there is something wrong with Loop Strength Reduction Pass.
This problem can be avoided by the -mllvm -disable-lsr option.

* source program(bug498.c)
#include <stdio.h>
int main () {
  int i,j,l=0,m=3,n=40;
  unsigned long v1=1,v2=2,v3=3;
  int a[50][50],b[50][50];

  for (i=0; i<50; i++) {
    for (j=0; j<50; j++) {
      a[i][j]=0;
      b[i][j]=1;
    }
  }

  for(i=0;i<10;i++) {
    for (l=0; l<4; l++) {
      for(m=0; m<30; m++) {
        for(j=0;j<2;j++) {
          v3=v2 * v2;
        }
        v1=v3 - v1;
        v2=v1 - i;
        b[i][j]=a[i][j]+b[i][j];
      }
    }
  }

  printf("%lu %lu %lu %d\n",v1,v2,v3, b[0][0]);
  return 0;
}


* compile/exec log using -mllvm -disable-lsr option
$ clang -O3 bug498.c -mllvm -disable-lsr
$ ./a.out
12145924650467887591 12145924650467887582 3040934746218291456 1

-- 
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/20190218/5cb4440e/attachment.html>


More information about the llvm-bugs mailing list