increment the optimization counter for DCE'd folds, also enable -O3 for compilation.

This commit is contained in:
Dale Weiler 2013-08-01 14:24:10 +00:00
parent 69c4dce477
commit 7669a99c7f
3 changed files with 3 additions and 2 deletions

View file

@ -4,7 +4,7 @@ UNAME ?= $(shell uname)
CYGWIN = $(findstring CYGWIN, $(UNAME)) CYGWIN = $(findstring CYGWIN, $(UNAME))
MINGW = $(findstring MINGW32, $(UNAME)) MINGW = $(findstring MINGW32, $(UNAME))
CFLAGS += -Wall -Wextra -Werror -fno-strict-aliasing $(OPTIONAL) CFLAGS += -O3 -Wall -Wextra -Werror -fno-strict-aliasing $(OPTIONAL)
ifneq ($(shell git describe --always 2>/dev/null),) ifneq ($(shell git describe --always 2>/dev/null),)
CFLAGS += -DGMQCC_GITINFO="\"$(shell git describe --always)\"" CFLAGS += -DGMQCC_GITINFO="\"$(shell git describe --always)\""
endif endif

1
fold.c
View file

@ -634,6 +634,7 @@ int fold_cond(ir_value *condval, ast_function *func, ast_ifthen *branch) {
* is expanded into the current block for the function. * is expanded into the current block for the function.
*/ */
func->curblock = elide; func->curblock = elide;
++opts_optimizationcount[OPTIM_CONST_FOLD_DCE];
return true; return true;
} }
return -1; /* nothing done */ return -1; /* nothing done */

View file

@ -745,7 +745,7 @@ GMQCC_WARN
code_t *code_init (void); code_t *code_init (void);
void code_cleanup (code_t *); void code_cleanup (code_t *);
uint32_t code_genstring (code_t *, const char *string); uint32_t code_genstring (code_t *, const char *string);
qcint_t code_alloc_field (code_t *, size_t qcsize); qcint_t code_alloc_field (code_t *, size_t qcsize);
void code_push_statement(code_t *, prog_section_statement_t *stmt, int linenum); void code_push_statement(code_t *, prog_section_statement_t *stmt, int linenum);
void code_pop_statement (code_t *); void code_pop_statement (code_t *);