cc-rs icon indicating copy to clipboard operation
cc-rs copied to clipboard

feat: add opt_fast_release method

Open aminya opened this issue 4 years ago • 1 comments

aminya avatar Jan 30 '22 08:01 aminya

Disregard strict standards compliance. -Ofast enables all -O3 optimizations. It also enables optimizations that are not valid for all standard-compliant programs.

That seems like a dangerous thing we shouldn't just provide without big warnings. It seems to me that if someone truly did validate that some of these optimizations are in fact okay for their program, they would want to enable that exact flag, and not enable all of them at once without very careful consideration.

m-ou-se avatar May 11 '22 15:05 m-ou-se

I don't think we should offer this really. If users want to configure this themselves then fine, but it's too much of a footgun for the public API IMO.

thomcc avatar Mar 21 '23 23:03 thomcc

It could be marked as unsafe to communicate the unsafety.

aminya avatar Mar 21 '23 23:03 aminya

What would the safety contract be? I'm not sure this is the typical meaning of unsafe.

thomcc avatar Mar 21 '23 23:03 thomcc

Hm, I'm going to close this as not planned at this time. I think at the very least this needs more discussion and more design work. Some of the flags especially, such as -fp:fast, would be concerning to me. And things like -Ob3 (inlining more aggressively) may not necessarily lead to better performance (it depends).

ChrisDenton avatar Apr 25 '23 09:04 ChrisDenton