Skip to content
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

add -O2 when compiling rt, fix warnings triggered by optimizer #319

Merged
merged 1 commit into from
Apr 7, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif

CFG_INFO := $(info cfg: building on $(CFG_OSTYPE) $(CFG_CPUTYPE))

CFG_GCC_CFLAGS :=
CFG_GCC_CFLAGS := -O2 -fno-strict-aliasing
CFG_GCC_LINK_FLAGS :=
CFG_BOOT_FLAGS := $(BOOT_FLAGS)
CFG_RUSTC_FLAGS := -nowarn -O
Expand Down
4 changes: 2 additions & 2 deletions src/rt/rust_crate_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ rust_crate_reader::mem_reader::adv_zstr(size_t sz)
{
sz = 0;
while (ok) {
char c;
char c = 0;
get(c);
++sz;
if (c == '\0')
Expand Down Expand Up @@ -124,7 +124,7 @@ rust_crate_reader::abbrev_reader::abbrev_reader
// tell_off());

uintptr_t idx, tag;
uint8_t has_children;
uint8_t has_children = 0;
get_uleb(idx);
get_uleb(tag);
get(has_children);
Expand Down
2 changes: 1 addition & 1 deletion src/rt/rust_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ rust_crate_reader
void get_uleb(T &out) {
out = T(0);
for (size_t i = 0; i < sizeof(T) && ok; ++i) {
uint8_t byte;
uint8_t byte = 0;
get(byte);
out <<= 7;
out |= byte & 0x7f;
Expand Down
4 changes: 2 additions & 2 deletions src/rt/rust_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ rust_task::start(uintptr_t exit_task_glue,
*spp-- = (uintptr_t) 0x0; // output
*spp-- = (uintptr_t) 0x0; // retpc

uintptr_t exit_task_frame_base;
uintptr_t exit_task_frame_base = 0;

if (spawnee_abi == ABI_X86_RUSTBOOT_CDECL) {
for (size_t j = 0; j < n_callee_saves; ++j) {
Expand Down Expand Up @@ -454,7 +454,7 @@ rust_task::notify_tasks_waiting_to_join() {
while (tasks_waiting_to_join.is_empty() == false) {
log(rust_log::TASK, "notify_tasks_waiting_to_join: %d",
tasks_waiting_to_join.size());
maybe_proxy<rust_task> *waiting_task;
maybe_proxy<rust_task> *waiting_task = 0;
tasks_waiting_to_join.pop(&waiting_task);
if (waiting_task->is_proxy()) {
notify_message::send(notify_message::WAKEUP, "wakeup",
Expand Down
2 changes: 1 addition & 1 deletion src/rt/util/indexed_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ indexed_list<T>::remove(T *value) {
assert (value->list_index >= 0);
assert (value->list_index < (int32_t)list.size());
int32_t removeIndex = value->list_index;
T *last;
T *last = 0;
list.pop(&last);
if (last->list_index == removeIndex) {
last->list_index = -1;
Expand Down