Compilation errors

From: Venelin Mitov (vmitov_at_gmail_dot_com)
Date: Sun Dec 26 2004 - 19:55:51 PST

  • Next message: Dan Bonachea: "Re: Compilation errors"
    Here is a simplified sample of a program I'm writing:
    
    //file: sample.c
    #include <upc_relaxed.h>
    #include <stdio.h>
    
    #define N 20
    
    typedef struct{
            int X, Y;
    }Point;
    
    shared[N/THREADS] Point P[2][N];
    
    int cmp(Point p, Point q){
        return p.X < q.X || p.X == q.X && p.Y < q.Y ? -1 :
            p.X == q.X && p.Y == q.Y ? 0 :
            1;
    }
    
    int main()
    {
        Point p, q;
        if(MYTHREAD == 0){
            printf("%d", cmp(P[0][0], P[0][1]));
        }
        return 0;
    }
    
    I'm trying to compile it using the following command:
    upcc -T 5 sample.c -o sampleupc
    
    And I receive the following error:
    Error during remote HTTP translation:
    upcc: error during UPC-to-C translation (sgiupc stage):
    ### Compiler Error in file sample.i during UPC Lowering phase:
    ###
    
    If I replace the printf line in main() with this one : 
    printf("%d", cmp(P[0][0], P[0][0]));  //only P[0][1] is changed to P[0][0]
    I receive another error :
    Error during remote HTTP translation:
    upcc: error during UPC-to-C translation (whirl2c stage):
    ### Assertion failure at line 1618 of ../../be/whirl2c/wn2c.cxx:
    ### Compiler Error in file sample.i during WHIRL To C phase:
    ### Expected non-null types in WN2C_based_lvalue()
    
    
    I cannot anderstand the reason for such kind of errors. Can anyone help me?
    

  • Next message: Dan Bonachea: "Re: Compilation errors"