Hello,

Should I be concerned about using a vec<> inside a GTYed struct. Something like:
typedef loop_info * LOOP_INFO;

struct GTY(()) LOOP_INFO 
{
  ...
  vec<loop_info> infos;
};

is causing me some pain due to invalid free() / delete / delete[] / realloc() 
(as reported by valgrind) after a segfault).

Are there are any rules of thumb to what can go inside a GTYed struct? I read 
http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gccint/Type-Information.html#Type-Information
unfortunately it doesn't mention the use of vecs inside GTYed structs.

For sake of completion the backtrace looks like:
==30111== Invalid free() / delete / delete[] / realloc()
==30111==    at 0x4A078F0: realloc (vg_replace_malloc.c:632)
==30111==    by 0x1037CEC: xrealloc (xmalloc.c:179)
==30111==    by 0x663C4E: void 
va_heap::reserve<basic_block_def*>(vec<basic_block_def*, va_heap, vl_embed>*&, 
unsigned int, bool) (vec.h:300)
==30111==    by 0x663B49: vec<basic_block_def*, va_heap, 
vl_ptr>::reserve(unsigned int, bool) (vec.h:1468)
==30111==    by 0xCEA04E: firepath_reorg_loops(_IO_FILE*) (firepath.c:8764)
==30111==    by 0xCE6107: firepath_reorg() (firepath.c:6678)
==30111==    by 0x9BE01D: rest_of_handle_machine_reorg() (reorg.c:3927)
==30111==    by 0x94BC0A: execute_one_pass(opt_pass*) (passes.c:2379)
==30111==    by 0x94BDFE: execute_pass_list(opt_pass*) (passes.c:2427)
==30111==    by 0x94BE2F: execute_pass_list(opt_pass*) (passes.c:2428)
==30111==    by 0x94BE2F: execute_pass_list(opt_pass*) (passes.c:2428)
==30111==    by 0x68A254: expand_function(cgraph_node*) (cgraphunit.c:1640)

Cheers,

Paulo Matos


Reply via email to