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
llvm-gcc doesn't take advantage of __const_coal section on darwin #2855
Comments
assigned to @asl |
This differs between gcc-4.2 and gcc-4.0. |
The darwin assembler only allows weak definition symbols (.weak_definition) on symbols in S_COALESCED sections. The __const_coal section is usually constructed that way. The constraint comes from an early implementation of coalescing that pre-dates how darwin tools now processes weak symbols. I've been trying to remove this restriction in the assembler, but that will take a while. What llvm should do, is if it is going to emit a function/data into the __const section and the symbol is a weak definition, it should switch to the __const_coal section. |
gcc-4.2 puts llvm-gcc-4.2 puts that object in .cstring. gcc-4.2 puts other typeinfo names in .cstring; it's not obvious what algorithm to use to pick. gcc-4.0 puts |
|
The support was added in recent series of patches. Please check. |
Ping :) |
llvm-gcc-4.2's use of this section has not changed on InstCombine in TOT, so we don't match either gcc-4.0 or gcc-4.2 behaviors, which are different. But from Nick's comment, neither gcc-4.0 nor gcc-4.2 is doing the right thing anyway. There is no weak data in this file (only functions), so I think it is not supposed to be using __const_coal. But I confess I find the situation confusing. |
Is this still an issue? |
Dale, please take a look to see if we're missing anything useful here, if not, please close this, thanks! |
I don't believe "correct" is well defined here (or I don't understand the definition), but I think the behavior matches what Nick describes, which should be OK. |
Extended Description
Building instcombine at -O0 -g with llvm-gcc, nothing is emitted into the __const_coal section. With GCC, it emits:
I don't know what this section is, but if useful, we should use it. :)
The text was updated successfully, but these errors were encountered: