-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE on invalid array with size determined by sizeof incomplete type #1227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
assigned to @isanbard |
Hi Nick, Which version of llvm-gcc are you using? It doesn't ICE on this version: [Gaz:llvm] llvm-gcc --version |
$ llvm-gcc --version Latest out of the subversion repository last night. |
I'll take a look tomorrow unless someone beats me to it. |
This appears to be a problem with the generic GCC code llvm-gcc is based on. |
Merged some code from mainline GCC to c-decl.c. Essentially, if there is an array with an incomplete type, Submitted a fix for this to the llvmdev mailing list. |
A quick test with the gcc 4.0.1 compiler on a Mac Intel machine (without the apple local patches) and it |
I can verify that this patch works on my x86-linux build, and still passes I think it should be applied. Chris? |
Mystery Of The Kind-of Working Compiler! Here's what's happening. In LLVM's GCC, the crashing line resolves to this after preprocessing: if (size_varies)
With TOT in positron, it comes out as: if (size_varies) So, basically, when tree checking is enabled, we get the ICE. Otherwise, it goes away. |
Ahh, so this fails with a non-llvm checking-enabled positron compiler as well? -Chris |
That's my next check. :-) I'll generate the new compiler now and make sure that the failure's there too. |
Holy crap! When "--enable-checking" is used during configuration with non-LLVM gcc, we get the same Hott! I'll submit the patch. |
Whoa, that even makes sense! :) Thanks Bill, -Chris |
Fixed: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060918/038091.html Also patched llvm-gcc. |
Thanks Bill! |
…lvm#1227) * Refactor component handling and generate shape information earlier. This merges all component handling back to a common path. Arrays, WHERE constructs, and FORALL constructs all share the share common code to derive the component path and any implicit iteration space shape information. This refactoring causes generated code to appear in a different order, so many tests were updated to reflect the changes. The forall tests were split into individual tests. - Adds a component path collector to manage gathering and using a path of components. - Eliminates passing context information by this pointer, which fixes some bugs. - Fixes an off-by-one correctness bug. - Fixes some bugs with malformed iteration spaces, which resulted in assertion failures. - Fixes d7b abd d7c. The todos left over: - Does not correctly deal with stemming the array properties relative to a path. This is a long standing issue with some hacks like componentToExtendedValue() that need to be replaced. This is related to the inability to handle component lower bounds, properly thread type parameters, etc. - There is still old prototype code to be removed.
Extended Description
$ llvm-gcc 025.c -c -o 025
025.c:1: error: invalid application of ‘sizeof’ to incomplete type ‘struct
poll_table_entry’
025.c:1: warning: division by zero
025.c:1: error: array type has incomplete element type
025.c:1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in grokdeclarator, at c-decl.c:4356
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://llvm.org/bugs for instructions.
$ cat 025.c
struct poll_table_entry inline_entries[((832 - 256) / sizeof(struct
poll_table_entry))];
$
The text was updated successfully, but these errors were encountered: