-
Notifications
You must be signed in to change notification settings - Fork 22
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
IR build failed with "-O0" but succeeded with "-O2" option #32
Comments
I can't reproduce this. I also don't see how this error might be emitted at all. |
There is a error in the original program at |
I tried to place tony@Win11Z790I:~/ir$ ./ir -O2 t.ir --save
{
uintptr_t c_1 = 0;
bool c_2 = 0;
bool c_3 = 1;
int32_t c_4 = 1;
l_1 = START(l_9);
bool d_2 = PARAM(l_1, "cond", 0);
l_3 = END(l_1);
l_4 = LOOP_BEGIN(l_3, l_7);
l_5 = IF(l_4, d_2);
l_6 = IF_TRUE(l_5);
l_7 = LOOP_END(l_6);
l_8 = IF_FALSE(l_5);
l_9 = RETURN(l_8, c_4);
} https://github.com/dstogov/ir/blob/master/ir_main.c#L151 // ir_main.c https://github.com/dstogov/ir/blob/master/ir_main.c#L151
int ir_compile_func(ir_ctx *ctx, int opt_level, uint32_t dump, const char *dump_file)
{
ir_check(ctx); // Check before optimization - hope to catch error even with -O2
if ((dump & (IR_DUMP_AFTER_LOAD|IR_DUMP_AFTER_ALL))
&& !_save(ctx, dump, IR_DUMP_AFTER_LOAD, dump_file)) {
return 0;
}
if (opt_level > 0 || (ctx->flags & (IR_GEN_NATIVE|IR_GEN_C))) {
ir_build_def_use_lists(ctx);
}
/* Global Optimization */
if (opt_level > 1) {
...
ir_check(ctx); // After optimization check
return 1;
} |
The See 75edc8f I think, this issue may be closed |
@dstogov Thanks. Let's close it as "Fixed". |
The IR function below failed to compile with
-O0
option, but okay with-O2
option.Failed IR program
DO NOT USE for Reproduce
This is the good
-O2
dump --- sorry for paste wrong program in first report.The text was updated successfully, but these errors were encountered: