Git Product home page Git Product logo

Comments (4)

PHHargrove avatar PHHargrove commented on August 30, 2024

bug137d is a test that fails in essentially the same way for an anonymous struct

bug137d.upc:53:36: error: declaration of anonymous struct must be a definition
        for (i = 0; i < sizeof ((*(struct <anonymous struct at bug137d.upc:32:1> (*)[12])UPCR_TLD_ADDR(X))) / sizeof ((*(struct <anonymous struct at bug137d.upc:32:1> (*)[12])UPCR_TLD_ADDR(X))[0]); ++i) {
                                   ^
bug137d.upc:53:89: error: type name requires a specifier or qualifier
        for (i = 0; i < sizeof ((*(struct <anonymous struct at bug137d.upc:32:1> (*)[12])UPCR_TLD_ADDR(X))) / sizeof ((*(struct <anonymous struct at bug137d.upc:32:1> (*)[12])UPCR_TLD_ADDR(X))[0]); ++i) {
                                                                                        ^
bug137d.upc:53:122: error: declaration of anonymous struct must be a definition
        for (i = 0; i < sizeof ((*(struct <anonymous struct at bug137d.upc:32:1> (*)[12])UPCR_TLD_ADDR(X))) / sizeof ((*(struct <anonymous struct at bug137d.upc:32:1> (*)[12])UPCR_TLD_ADDR(X))[0]); ++i) {

           ^

from upc2c.

PHHargrove avatar PHHargrove commented on August 30, 2024

After c0767f1 the failure reported here for bug137d.upc appears to be resolved.

The test lockperf.upc still yields syntax errors in the translated C code, though the have changed since the initial report:

$ upcc -Ww,-Wno-duplicate-decl-specifier -Ww,-Werror=pointer-arith -g  -network=smp -pthreads -I. -nolines -save-all-temps lockperf.upc
upcc: Error building pthread objects with thread-local data: 
lockperf_obj.c:372:15: error: expected '{' before '<' token
lockperf_obj.c:373:1: error: unknown type name '_bupc_anon_struct0'
lockperf_obj.c: In function '_bupc_allv_reduce':
lockperf_obj.c:405:9: warning: unnamed struct/union that defines no instances [enabled by default]
lockperf_obj.c:488:147: error: '_bupc_anon_struct0' undeclared (first use in this function)
lockperf_obj.c:488:147: note: each undeclared identifier is reported only once for each function it appears in
lockperf_obj.c:488:167: error: expected expression before ')' token
lockperf_obj.c:507:167: error: expected expression before ')' token
lockperf_obj.c:526:167: error: expected expression before ')' token
lockperf_obj.c:545:168: error: expected expression before ')' token
lockperf_obj.c:570:168: error: expected expression before ')' token
lockperf_obj.c:589:168: error: expected expression before ')' token
lockperf_obj.c:608:168: error: expected expression before ')' token
lockperf_obj.c:627:168: error: expected expression before ')' token
lockperf_obj.c:652:168: error: expected expression before ')' token
lockperf_obj.c:671:168: error: expected expression before ')' token

The erroneous code on line 372:

typedef union <anonymous at /home/hargrov1/upc-runtime/BUILD-gcc-46/dbg_cupc2c/upc-tests/benchmarks/./bupc_collectivev.h:335:10> _bupc_anon_struct0;

The code on lines 402 - 405, which looks like it was maybe intended to be a (duplicate?) typedef:

        union {
            long double __dummyf1;
            unsigned long __dummyf2;
        };

The remaining errors on liens 408 through 671 are all due to the missing defn of _bupc_anon_struct0 (which was the erroneous code at line 372).

from upc2c.

swatanabe avatar swatanabe commented on August 30, 2024

The AST makes this a bit inconvenient. The problem is that the declaration of the anonymous union appears immediately before the variable declaration. When we process the union declaration, there isn't enough information to determine whether it needs to be moved to the global scope. I think that means that we need to determine it when processing the entire DeclStmt, and pass this down to TransformDecl somehow.

from upc2c.

nenadv avatar nenadv commented on August 30, 2024

After applying the latest fix for #102 I am not able to compile any test - with or without pthreads. This is the assertion error I get:

clang-upc2c: /eng/upc/dev/nenad/clang-upc-pthreads/src/llvm/tools/clang/include/clang/AST/Type.h:643: const clang::ExtQualsTypeCommonBase* clang::QualType::getCommonPtr() const: Assertio
n `!isNull() && "Cannot retrieve a NULL type pointer"' failed.

I did update my branch with all the changes on the master, just in case.

from upc2c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.