How to insert external global variable declarations and pointer assignment statements through GCC plugin GIMPLE pass

Ian Lance Taylor iant@google.com
Tue May 31 19:40:00 GMT 2011


"Abhijit Nandy" <abhijit.nandy@gmail.com> writes:

> Thanks for the pointers. I have been trying to make a simple VAR_DECL
> using the following call :
>
> tree type_node = make_node(POINTER_TYPE);
> //TYPE_NAME(type_node) = type_id;
> tree var_decl = build0(VAR_DECL, type_node);

Use build_decl.

> testcode.c:33:1: internal compiler error: Segmentation fault

When you get a segmentation fault, your first step should be to use the
debugger to find out what went wrong.  That will normally point you in
the right direction.

Ian



More information about the Gcc-help mailing list