Re: __function_size builtin

2011-06-23 Thread Paulo J. Matos
On 22/06/11 23:25, Ian Lance Taylor wrote: "Paulo J. Matos" writes: On 22/06/11 17:34, Paulo J. Matos wrote: I thought this was the same as using __attribute__((used)) on a function declaration (which works). DECL_PRESERVE_P(node) = 1; seems to be what I wanted. :) I always wondered wha

Re: __function_size builtin

2011-06-22 Thread Ian Lance Taylor
"Paulo J. Matos" writes: > On 22/06/11 17:34, Paulo J. Matos wrote: >> I thought this was the same as using __attribute__((used)) on a function >> declaration (which works). >> > > DECL_PRESERVE_P(node) = 1; > > seems to be what I wanted. :) I always wondered what that was for. Ian

Re: __function_size builtin

2011-06-22 Thread Paulo J. Matos
On 22/06/11 17:34, Paulo J. Matos wrote: I thought this was the same as using __attribute__((used)) on a function declaration (which works). DECL_PRESERVE_P(node) = 1; seems to be what I wanted. :)

Re: __function_size builtin

2011-06-22 Thread Paulo J. Matos
ig/tc-CPU.h file. Thanks, I will give it a try. In order to tell GCC not to remove the function referenced by __function_size() builtin, I found the FUNCTION_DECL and did TREE_USED() = 1 however this didn't help because the function was removed nonetheless. I thought this was the sam

Re: __function_size builtin

2011-06-22 Thread Ian Lance Taylor
"Paulo J. Matos" writes: > My thought was to fold __function_size still to a special label > (unique for each function) that would be then generates by as and set > to the unrelaxed size of the function. Once the linker performs the > required relaxation it also modifies the label value according

__function_size builtin

2011-06-22 Thread Paulo J. Matos
Hello, I have added a builtin __function_size that is supposed to receive a pointer to a function and return the size, in words, that the function takes. We got it working until GCC4.5. In GCC4.5 became tricky for 2 reasons. First, GCC 4.5 removes the function if the only reference to the f