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
Duplicate global vars allowed by llvm-as #1449
Comments
This test case: test/Regression/Assembler/2003-02-02-ConstGlobal.ll also tests for redefinition of global/constant. Chris, are you SURE you want to make this illegal. I would have to remove this |
Yes, that testcase is also broken. These were due to llvm-gcc3, which would output stuff then sometimes |
Okay, there's a dozen or so more of these. I'll either fix the test case to not |
Sounds good |
Why stop at just redefinition in a type plane? Any redefinition of an external |
i agree. Historically we allowed this because of type planes. However, I'd like to drop them entirely. I'm |
Hmm .. what about: ; This tests a hack put into place specifically for the C++ libstdc++ library. %X = external global { int } Has the ugly hack now been removed? |
good point. To handle that, we need to verify that llvm-link will correctly unify the globals in these two a.ll: b.ll: The linker should merge those together: we should not have 'type-plane aware linking'. -Chris |
What are the unification rules? Same size? |
same name |
The situation wouldn't arise if they weren't the same name. That's not what I'm
Reid. |
I guess it doesn't matter. llvm-link produces: ; ModuleID = 'c.bc' implementation ; Functions: which I guess is correct. So, can I just go ahead and make same named gvars in llvm-as and verifier illegal? |
sounds good. The buggy behavior in the linker has probably since been fixed. |
Fixed with this patch: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070101/042099.html |
Extended Description
The test/Feature/constexpr.ll test case is incorrect. It is specifically
allowing this:
%t4 = global int** cast (uint** %t3 to int**)
%t4 = global int** cast (uint** %t3 to int**)
This should produce an error as it is incorrect to allow redefinition of global
vars, even if they have exactly the same type and initializer.
Such redefinition needs to be made illegal in llvm-as. The test case needs to
be modified to not test for allowing redefinition. A new test case should check
that llvm-as generates an error on redefinition.
The text was updated successfully, but these errors were encountered: