This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How can I generate a new function at compile time?

(Sorry for the duplicate.)

I managed to pass the needed parameters to the generated function.
However I cannot pin down the reason why the compilation fails.
It seems that the cfg is somehow broken, but I cannot tell how.
Do you have any debugging hints?

As far as I can tell, the cfg is changed during the generation of the preheader
(I do this to find the entry block easily.)
and in the function move_sese_region_to_fn.

I noticed that after pass 058t.copyrename2 the original function bar disappears
and the new function is replaced by _GLOBAL__N_bar.constprop, could this have
anything to do with the problem?

The pass runs just after the construction of cfg,  outline.c.011t.cfg.

/home/bhuber/sandbox/install/bin/gcc -O3 -I /home/bhuber/sandbox/src -c -fdump-tree-all-details -fdump-ipa-all-details -fdump-rtl-all-details -funinline-innermost-loops -Wall -Wextra /home/bhuber/sandbox/try/outline.c
/home/bhuber/sandbox/try/outline.c: In function '_GLOBAL__N_bar.constprop':
/home/bhuber/sandbox/try/outline.c:3:1: internal compiler error: in purge_dead_edges, at cfgrtl.c:3183
bar (int s, int r, unsigned * t, int * k, int * p, int * l)
0x67e7c4 purge_dead_edges(basic_block_def*) 
0xe5a0d6 find_bb_boundaries
0xe5a0d6 find_many_sub_basic_blocks(simple_bitmap_def*)
0x66c0f5 execute
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <> for instructions.

I attach the transformation pass and the small example program.

Thank you again for the help,

P.s. I am aware that this transformation is not safe in general,
    however in this case it should work.

Attachment: outline.c
Description: Binary data

Attachment: uninline-innermost-loops.c
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]