Re: whirl2c

From: Wei Chen (wychen_at_cs_dot_berkeley_dot_edu)
Date: Wed Dec 08 2004 - 16:31:26 PST

  • Next message: Marc Gonzalez-Sigler: "Building the translator with GCC 3.4.3"
    Hi Marc,
        When compiling programs with our translator, it's best if you invoke 
    it with the "upcc" driver included in our runtime.  Not only does it 
    perform the preprocessing and set up the various command line options, 
    but it also passes along a configuration file containing architecture 
    dependent parameters, and our translator will crash if the file is not 
    present.  The generated C code from our whirl2c is also probably not 
    going to compile without our runtime headers; one issue for example is 
    that we output global variable declarations using macros to support 
    pthread environments.  Since all C programs are UPC programs, one thing 
    you may want to try is just use upcc to compile your C programs and see 
    if that works.  If you do want to invoke the translator directly, you 
    can use "upcc -vv" to look at the exact command passed to the 
    translator.  Improving the robustness of our translator is an important 
    and ongoing goal for us, and we'd be happy to help you get a large piece 
    of code to go through our translator/whirl2c.
        As for your second question, we have not made any structural changes 
    to WHIRL other than adding a few fields in the symbol table.  All UPC 
    specific constructs are represented using existing WHIRL nodes and are 
    distinguished by their type information.
    Marc Gonzalez-Sigler wrote:
    > Hello,
    > I've been asked to make Open64's whirl2c and whirl2f work reliably 
    > enough that it is possible to:
    > 1. Translate SPECfp2000 source code into WHIRL
    > 2. Apply preopt and LNO
    > 3. Regenerate source code
    > 4. Compile with GCC on amd64 or i386
    > Costin Iancu said:
    >   Roy Ju from Intel mentioned some time ago that they might have
    >   a cleaned up version of whirl2c that works well. I do not think
    >   it made it into the ORC release.
    > Has there been any news of this version?
    > Greg Lindahl said you (LBL+UCB) had already made many improvements to 
    > SGI's whirl2c. I checked wn2c.cxx but I am not familiar enough yet 
    > with the code to understand the improvements.
    > I downloaded berkeley_upc_translator-2.0.1.tar.gz and compiled it on 
    > Linux/i386 with GCC 3.2.2
    > Is your whirl2c supposed to work with WHIRL files produced by ORC 2.1? 
    > (Perhaps my environment is not set up correctly.)
    > $ cat testcase.c
    > struct foo { int x; int y[3]; } bar;
    > int main(void)
    > {
    >   bar.y[1] = 666666;
    >   return 0;
    > }
    > $ orcc -fe -keep testcase.c
    > $ upc_whirl2c testcase.B
    > ### Assertion failure at line 932 of ../../be/whirl2c/ty2c.cxx:
    > ### Compiler Error in file testcase.c during Post LNO Processing phase:
    > ### Unexpected TY_kind (0) in TY2C_translate()
    > Did you modify the WHIRL?
    > On a related subject, can I simply feed pre-processed C the gfec 
    > binary to produce a WHIRL file, and then use ORC's preopt and LNO?

  • Next message: Marc Gonzalez-Sigler: "Building the translator with GCC 3.4.3"