Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
click on all these pieces of poo poo
gcc
clang
icc (intel cool compiler for cool cats)
shaggar diversity wheelchair-burger-king-kid option (msvc)
former amd employee welfare option (open64)
turbo (i dont think so, tim)
ritchie rich c
View Results
 
  • Locked thread
rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

theadder posted:

so hes an antisocial moron (he uses lunix) but is he right

my guess, without reading any gcc code (which i'm not allowed to do, lol), is that linus has actually diagnosed the problem correctly, but it's buried under a long discussion of what's probably a red herring (also under a giant pile of assholeishness). the red zone is almost certainly a distraction here. gcc appears to be spilling a simple constant (which is definitely screwy) to a slot which should be well within the stack frame, except unfortunately it's doing that spill just before the stack frame has actually been established. there isn't normally a reason you'd need to materialize a constant in the prologue; wild guess, there's something weird (inline assembly?) at the start of the function, and some piece of code is trying to position a "hey, i need this constant now" assertion before that and isn't being careful enough to avoid the prologue. that mistake is also confusing the register allocator, hence the spill

Adbot
ADBOT LOVES YOU

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
depends on who's handcrafting the poo poo. a modern compiler is probably smarter than you about basic integer/pointer arithmetic, and it knows a lot of subtle crap about instruction ordering and microarchitectural latencies. on the other hand, it's required to follow the platform abi, can easily be blocked by false dependencies, doesn't always know when it's worthwhile to chase trade-offs, doesn't necessarily realize that there's this one perfect instruction for summing the odd bits of a floating-point mantissa, and occasionally just makes bad decisions

  • Locked thread