Skip to content
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

c backend with array types can produce code rejected by gcc 4.0.1 #1290

Closed
llvmbot opened this issue Sep 20, 2006 · 8 comments
Closed

c backend with array types can produce code rejected by gcc 4.0.1 #1290

llvmbot opened this issue Sep 20, 2006 · 8 comments
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 20, 2006

Bugzilla Link 918
Resolution FIXED
Resolved on Nov 07, 2018 00:17
Version trunk
OS All
Attachments .ll to reproduce the problem
Reporter LLVM Bugzilla Contributor

Extended Description

The C backend can currently (recent head) produce code with such patterns:

/* Global Declarations /
/
Structure forward decls */
struct l_structtype_s;

/* Typedefs /
typedef struct l_structtype_s l_fixarray_array3[3]; /
problematic
declaration */
typedef struct l_structtype_s l_structtype_s;

/* Structure contents */
struct l_structtype_s {
int field0;
};

gcc 4.0.1 will reject this with a "array type has incomplete element type" error.

this seems not valid C, precedently gcc accepted it as a (fragile) extension.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 11, 2007

Could someone please have a look at this? This bug prefends PyPy from using the later gcc versions.

@lattner
Copy link
Collaborator

lattner commented Jan 12, 2007

Eric, I'd love to see this fixed, but don't have bandwidth to investigate it. I'd suggest making a call for help
on the llvmdev list, you'll get more visibility there.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 15, 2007

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 15, 2007

test case for current llvm cvs head
llvm-as -f testme.ll;llc -march=c -f testme.bc;gcc -c testme.cbe.c

@lattner
Copy link
Collaborator

lattner commented Jan 16, 2007

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 16, 2007

@lattner
Copy link
Collaborator

lattner commented Jan 16, 2007

Nice work, I applied Gordon's testcase here:
Regression/CodeGen/CBackend/2007-01-15-NamedArrayType.ll

and here's a slightly adapted version of his patch:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070115/042762.html

Thanks Gordon!

-Chris

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 16, 2007

great stuff! thank you Gordon and Chris!

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead
Projects
None yet
Development

No branches or pull requests

2 participants