clangupc / clang-upc

Clang UPC Front-End
https://clangupc.github.io/
Other
16 stars 5 forks source link

Clang-upc ICE on user's example code #93

Closed PHHargrove closed 8 years ago

PHHargrove commented 8 years ago

The attached UPC code is based on an issue being discussed on the upc-users@lbl.gov list. Both the current master and the stable 3.6.2-1 crash when compiling it on Linux/x86-64.

When I have more time I will add the clang backtraces and try to reduce the test case.

NOTE: The .upc.txt suffix on the attachment was needed to make github happy - it should be just .upc

PHHargrove commented 8 years ago

Reduced test case:

#include <upc.h>

int main(void) {
    static shared[] int *shared sh_center[THREADS];
    shared[] int *center[THREADS];
    int i;

    for (i = 0; i < THREADS; i++) {
      center[i] = sh_center[i];
    }

    return 0;
}

-Paul [Sent from my phone]

PHHargrove commented 8 years ago

I am attaching error output from master and the stable 3.6.2-0 release.

Any line numbers are from the following, slightly more reduced, version:

$ cat -n bug.upc
     1  #include <upc.h>
     2  int main(void) {
     3    static shared[] int *shared sh_center[THREADS];
     4    shared[] int *center[THREADS];
     5    for (int i = 0; i < THREADS; i++) center[i] = sh_center[i];
     6    return 0;
     7  }

-Paul

swatanabe commented 8 years ago

AMDG

On 05/18/2016 03:15 PM, Paul H. Hargrove wrote:

I am attaching error output from master and the stable 3.6.2-0 release.

Any line numbers are from the following, slightly more reduced, version:

$ cat -n bug.upc
     1  #include <upc.h>
     2  int main(void) {
     3    static shared[] int *shared sh_center[THREADS];
     4    shared[] int *center[THREADS];
     5    for (int i = 0; i < THREADS; i++) center[i] = sh_center[i];
     6    return 0;
     7  }

I found the problem. This needs to be treated as a variable array, but it's not handled quite right.

In Christ, Steven Watanabe