Open liufengwenyu opened 4 years ago
GCC 7 is not supported, please use >= 9.3.0.
I switched to GCC 9.3 and there was no problem with the above functions. But I think there are still some problems. For example, the following functions:
void* app_malloc(int sz, const char *what)
{
void *vp = malloc(sz);
if (vp == NULL) {
printf("Could not allocate %d bytes for %s\n", sz, what);
exit(1);
}
return vp;
}
gcc -fPIC -fplugin=./hellscape.so -fplugin-arg-hellscape-seed=deadbeef -fplugin-arg-hellscape-fla -c target.c -o target.o
The error message is as follows:
*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.
Event | Plugins
PLUGIN_FINISH | hellscape
during GIMPLE pass: fla
target.c: In function ‘app_malloc’:
target.c:53:7: internal compiler error: Segmentation fault
53 | void* app_malloc(int sz, const char *what)
| ^~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
By drawing CFG, I found that some blocks have no succs. So I added
if (last->code == GIMPLE_COND) {
/**/
} else {
if(!target->succs)
continue;
}
/**/
}
It's working.
But once the -O option is added, an inline error is reported:
gcc -fPIC -fplugin=./hellscape.so -fplugin-arg-hellscape-seed=deadbeef -fplugin-arg-hellscape-fla -c target.c -o target.o -O1
*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.
Event | Plugins
PLUGIN_FINISH | hellscape
during GIMPLE pass: einline
target.c: In function ‘app_malloc’:
target.c:62:1: internal compiler error: Segmentation fault
62 | }
| ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
I tried to add -fdisable-tree-einline, but it didn't work.
Well, need to add -fdisable-tree-einline and -fdisable-ipa-inline.
Hello, I try to fla process the following function,
But the error is reported, the error information is as follows:
I tried to print out the cfg(test.dot), and it looks normal.
dot -Tpng test.dot > test.png
Do you have any ideas?