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.
what is best in optimizer pipeline
value numbering
code motion
peepholing
loop idiom recognition
legalization
thread gassing
op banning
View Results
 
  • Locked thread
Dylan16807
May 12, 2010

redleader posted:

oh yeah, that's right

related (but possibly a little off topic) question: what's up with the c/c++ standards committees that makes them prefer undefined over implementation-defined behavior? i mean surely most compilers would know their target's behavior with (un)signed overflow (for example)

let's take something like arithmetic. sometimes it's faster to let it overflow. sometimes it's faster to treat it as ideal numbers and assume x+1>x. leaving it undefined lets the compiler pick the best option in each individual case, in a way that implementation-defined couldn't effectively detail.

and while it would be nice to have a rule that a series of arithmetic statements will eventually resolve to some number instead of formatting your hard drive, it's really hard to write a set of rules that preserve both safety and optimizations

Adbot
ADBOT LOVES YOU

Dylan16807
May 12, 2010

TOPS-420 posted:

avoiding ub is easy, just follow these 204 simple rules

https://blog.regehr.org/archives/1520

is there a reason they don't get rid of all the ub for trivial things like syntax errors? how did "An unmatched ‘ or ” character is encountered on a logical source line during tokenization (6.4)" survive into this century?

  • Locked thread