Hello Ian and Everyone,
     Here is my problem specifically. I apologize in advance if this email is 
long.

        I am trying to mark all for loop *top* labels with a integer value. 
This integer value is an index to another data structure that I'm trying to 
maintain. 

   I just added the index value (as unsigned int) into the following data 
structure (in tree.h):

struct GTY(()) tree_label_decl {
  struct tree_decl_with_rtl common;
  int label_decl_uid;
  int eh_landing_pad_nr;
  unsigned int My_INDEX;   /* <== THIS IS WHAT I AM TRYING TO DO */
};

I put the above modification and then I set My_INDEX in the "top" tree (top is 
created using build1(LABEL_EXPR, void_type_node, NULL_TREE)) in the 
c_finish_loop() and tried to reconfigure & build the gcc. Now, it is crashing 
when it is trying to compile the files using "prev-gcc/xgcc" (mainly at the 
gimplification phase).

I tried to gdb through the cc1 executable and did a tree dump (using 
"debug_function" and "debug_c_tree" commands when I was using gdb) and it is 
converting some labels into <<<error>>> or <error_mark_node>.

If I comment out the line where I am setting the My_INDEX, the gcc builds and 
works correctly. I am accessing My_INDEX on top as: top->label_decl.My_INDEX

Is there any other files, functions or structures I need to modify for me to 
add and use My_INDEX? Also, am I accessing the "My_INDEX" correctly?

I am using gcc-4.6

Any help is highly appreciated!

Thanking You,

Yours Sincerely,

Balaji V. Iyer.

PS. Please CC me when you reply this message.


-----Original Message-----
From: Ian Lance Taylor [mailto:i...@google.com] 
Sent: Monday, May 09, 2011 7:34 PM
To: Iyer, Balaji V
Cc: gcc@gcc.gnu.org
Subject: Re: Adding elements into tree data structure

"Iyer, Balaji V" <balaji.v.i...@intel.com> writes:

>       I would like to add 8 integer array fields (I am also OK if they are 
> tree-lists) into the tree data structure. I want to update this fields every 
> time I see loops. This value will be used later by the optimizer. I tried to 
> just add them into the structure in tree.h (under struct tree_base) and it is 
> seg-faulting. I am using GCC 4.6.0.
>
>       Can someone please tell me the procedure for adding elements into the 
> tree structure?

Hard to say what is wrong without more information.  Make sure that
tree_code_size returns the right values.  But really I would recommend
just using the debugger to find out what is causing the segfault.

Ian

Reply via email to