address taken problem

2008-04-10 Thread Dasarath Weeratunge
In the following code I marked the tree 'node.0' as address taken using 'c_mark_addressable'. Now in the assembly code, isn't the return value of the second call to malloc completely discarded? This problem does not arise in -O0. Here I'm using -O2. main () { void * D.2897; struct node * D.2

TREE_ADDRESSABLE flag

2008-04-09 Thread Dasarath Weeratunge
I came across the following problem when trying to instrument the program. If I take the address of trees using build_fold_addr_expr at O2 the compiled programs crash (segmentation fault) at runtime. They run OK at O0. In this particular case I only took the addresses of var_decl and parm_decl nod

gimple

2008-03-27 Thread Dasarath Weeratunge
Is it possible to map simplified source statements back to the original source code in GCC? If this is not possible is it possible to stop the simplification altogether and just retain the original source tree in say DECL_SAVED_TREE(...) ? I tried removing tree lowering passes but gcc still seems

GCC build problem

2008-03-05 Thread Dasarath Weeratunge
I added a field to struct basic_block_def in basic-block.h of type struct pointer_set_t. Now when I try to rebuild GCC build fails with error: libbackend.a(gtype-desc.o): In function `gt_pch_nx_basic_block_def': /scratch/dweeratu/gcc/build/gcc/gtype-desc.c:2472: undefined reference to `gt_pch_nx_

global declarations

2008-02-25 Thread Dasarath Weeratunge
Once the files have been completely parsed, how can I traverse through all global declarations (e.g. types and variables) ? I can find the functions by traversing the call graph but would like to know how to do the same for types and variables. Also is there a way to find a decl from its UID? Than

call site information

2008-02-21 Thread Dasarath Weeratunge
If I have a CALL_EXPR how can I find out information about the call site? For example, the filename and line number. thanks, -- dasarath

cc1

2008-02-16 Thread Dasarath Weeratunge
When I use cc1 directly it outputs a whole lot of text like: gnu_dev_major gnu_dev_minor gnu_dev_makedev stat lstat fstat fstatat mknod mknodat stat64 lstat64 fstat64 fstatat64 shwi_to_double_int uhwi_to_double_int double_int_zero_p double_int_one_p double_int_minus_one_p double_int_equal_p VEC_t

compilation flow

2008-02-15 Thread Dasarath Weeratunge
I'm trying to extract the C front end of GCC with all tree lowering passes, and call graph generation. I do not need ssa conversion. Is tree_rest_of_compilation the correct place to cut the compiler pipeline for this? thanks, -- dasarath

GCC ssa and alias info

2008-02-12 Thread Dasarath Weeratunge
Is it possible to dump the ssa representation and alias information generated by the compiler to a file? thanks, -- dasarath