From: Dan Bonachea (bonachea_at_cs_dot_berkeley_dot_edu)
Date: Mon Dec 27 2004 - 15:34:12 PST
Hi Venelin - This appears to be a bug in the Berkeley UPC translator. I've submitted a bug on your behalf to the Berkeley UPC bug database and added it to our regression test suite, and a developer should be looking into it shortly (although probably not until after the holidays). Here's a temporary workaround - replace this line: printf("%d", cmp(P[0][0], P[0][1])); with: Point p1 = P[0][0]; Point p2 = P[0][1]; printf("%d", cmp(p1,p2)); I've verified this works with the most recent snapshot version of Berkeley UPC (2.1.0 beta). Apologies for the inconvenience.. Dan PS - Please submit any future suspected compiler bugs directly to our bug database (http://upc-bugs.lbl.gov/bugzilla). Anyone can create an account for free - I've already created one for you (your info was mailed directly to you under separate cover). At 06:59 AM 12/27/2004, Mitov wrote: >Hello I'm new to upc. And I have written most in C++(not C). >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?