Re: Help forging a function_decl

2013-07-24 Thread Rodolfo Guilherme Wottrich
Problem solved. The trouble was that the blocks of my statement list weren't correctly chained, so when lower_gimple_bind executed in pass_lower_cf, it accessed an uninitialized memory area, thus sometimes reading the flag as true and sometimes as false. Now everything runs smoothly. Again, thank

Re: Help forging a function_decl

2013-07-23 Thread Rodolfo Guilherme Wottrich
Later I found out that cgraph_mark_needed_node was already being called in cgraph_finalize_function, and that should really keep my function from being removed. But when the function cgraph_remove_unreachable_nodes executes, it is marked as unreachable just because at this point it is not marked as

Re: Help forging a function_decl

2013-07-23 Thread Rodolfo Guilherme Wottrich
Hello, 2013/7/23 Martin Jambor : > Hi, > > But you do call cgraph_add_new_function on it as well, right? If not, > how is its symbol table node (also called and serving as the call > graph node) created? I call finish_function for my decl. Inside that function, there's this one call to cgraph_ad

Re: Help forging a function_decl

2013-07-23 Thread Martin Jambor
Hi, On Mon, Jul 22, 2013 at 03:17:08PM -0300, Rodolfo Guilherme Wottrich wrote: > Hello, > > Thanks! I had solved the problem some days ago, and it was actually > related to your answer. > First, I hadn't used push_struct_function() to allocate storage for my > new function. > Second, I wasn't ca

Re: Help forging a function_decl

2013-07-22 Thread Rodolfo Guilherme Wottrich
I run gcc with -fdump-tree-all-raw and found out that all dumps until filename.c.013t.cfg are fine, but every time it fails, my function disappears from filename.c.016t.ompexp onwards. Remembering: I want it to happen every time there's a #pragma omp parallel in the source, so I put my implementati

Re: Help forging a function_decl

2013-07-22 Thread Rodolfo Guilherme Wottrich
Hello, Thanks! I had solved the problem some days ago, and it was actually related to your answer. First, I hadn't used push_struct_function() to allocate storage for my new function. Second, I wasn't calling finish_function() after setting my tree, so it would not be further compiled (just like y

Re: Help forging a function_decl

2013-07-22 Thread Martin Jambor
Hi, On Wed, Jul 17, 2013 at 04:52:30PM -0300, Rodolfo Guilherme Wottrich wrote: > Hello there, > > Please disregard this message in case it doesn't fit here. > > During compilation of a C file, I need to be able to create a global > function definition, with whatever a body I may have forged. I