News for hackers. Stuff that matters.
Re:C meeting is over. C23 added: by WithinReason on Saturday February 19, 2022 @06:43AM (#30396369)
The downside of reordering being performance? Or something else?
Re:C meeting is over. C23 added: by 10x-dev on Saturday February 19, 2022 @07:05AM (#30396491)
Performance is usually the upside. The downside is subtle bugs that can happen due to side effects of the statements being reordered between sequence points.
Re:C meeting is over. C23 added: by WithinReason on Saturday February 19, 2022 @07:14AM (#30396554)
AFAIK compilers don't reorder if it would change the result.
Re:C meeting is over. C23 added: by Thiez on Saturday February 19, 2022 @10:05AM (#30397631)
Compilers not allowed to violate the language spec when optimizing. But the spec may be fairly generous in its allowed interpretations, which may not match what a programmer may naively expect. C, with its many undefined behaviors and implementation defined behaviors, is especially dangerous.