Comments (4)
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.
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.
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.
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)
- TLD: static variable inside the function not promoted into global HOT 5
- TLD: bad code translation for initialized array HOT 5
- TLD: invalid initializers for file scope variables HOT 5
- TLD: UPCR_TLD_* macros must be at most one per line HOT 1
- TLD(RFE): implement an enable/disable switch for TLD HOT 1
- TLD: runtime regressions HOT 1
- TLD: missing TLD macros when accessing upcrt_forall_control HOT 5
- TLD: warning when 'extern' is used HOT 12
- TLD: Assertion failures inside Debug build HOT 2
- TLD: Assertion failures inside Release build HOT 1
- Undeclared __isoc99...scanf() functions in output HOT 6
- Problems w/ ___errno on Solaris HOT 16
- Bad translated output for attribute((transparent_union)) HOT 8
- 3.8 merge: Missing some brackets in struct initializers HOT 2
- Bad translation of pointer-to-shared as logical HOT 1
- Assertion failure translating complex.h on FreeBSD/i386 HOT 7
- crash on `sys/wait.h` from glibc 2.17 HOT 5
- cupc2c on MacOS X HOT 2
- Incorrect initializers for definite shared arrays HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from upc2c.