Skip to content

configure --enable-optimize doesn't seem to override CFG_DISABLE_OPTIMIZE #8721

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

Closed
catamorphism opened this issue Aug 23, 2013 · 5 comments
Closed
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@catamorphism
Copy link
Contributor

If CFG_DISABLE_OPTIMIZE is set in the environment, and I run ../configure --enable-optimize, I would expect an optimized build. However, this seems to have the effect of building an optimized LLVM but not an optimized rustc. (Doing VERBOSE=1 make rustc-stage1, I see the -O3 flag in the LLVM compile command lines, but no -O flag in the Rust compile commands.) The Makefile.in suggests my suspicion is right:

ifdef CFG_DISABLE_OPTIMIZE
  $(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
  CFG_RUSTC_FLAGS +=
else
  CFG_RUSTC_FLAGS += -O
endif

If this is the intended behavior, it should at least be documented.

@catamorphism
Copy link
Contributor Author

Nominating for milestone 5, production-ready

@catamorphism
Copy link
Contributor Author

Just a bug

@flaper87
Copy link
Contributor

Visiting for triage... Still valid.

This seems to be the expected behavior. However, I'd expect CFG_DISABLE_OPTIMIZE to be consistent throughout Rust's build. That is, CFG_DISABLE_OPTIMIZE should disable all optimization if set.

@huonw
Copy link
Member

huonw commented Mar 2, 2014

part of #8058

@emberian
Copy link
Member

There are now separate flags for optimizing C++ and LLVM code respectively (--disable-optimize-cxx and --disable-optimize-llvm).

xFrednet pushed a commit to xFrednet/rust that referenced this issue May 21, 2022
Support negative ints in manual_range_contains

fixes: rust-lang#8721
changelog: Fixes issue where ranges containing ints with different signs would be
incorrect due to comparing as unsigned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

4 participants