Re: fold_builtin changes tree

2012-03-21 Thread Paulo J. Matos
On 20/03/12 10:30, Jakub Jelinek wrote: Like any other builtin expander? There are many dozens of examples in builtins.c. It is called with the tree argument, so you verify it, complain if the argument is not the one you are expecting, and just expand it as the symbol instead of expanding the

Re: fold_builtin changes tree

2012-03-20 Thread Paulo J. Matos
On Mon, 19 Mar 2012 22:49:39 -0700, Ian Lance Taylor wrote: I'm not sure what you are folding the builtin to, but perhaps you could retain a reference to the function. I am folding the function call __function_size(foobar) to a new symbol foobar@size. The reference to function foobar

Re: fold_builtin changes tree

2012-03-20 Thread Jakub Jelinek
On Tue, Mar 20, 2012 at 10:21:45AM +, Paulo J. Matos wrote: I'm not sure what you are folding the builtin to, but perhaps you could retain a reference to the function. I am folding the function call __function_size(foobar) to a new symbol foobar@size. The reference to function

fold_builtin changes tree

2012-03-19 Thread Paulo J. Matos
Hi, I have builtin __function_size(foobar) that is applied to functions. This should be folded to a symbol foobar@size. The problem comes when I mark in the fold_builtin function in my backend that DECL_PRESERVE(foobar) = 1; The reason I need to do this is so that foobar is not removed if we

Re: fold_builtin changes tree

2012-03-19 Thread Ian Lance Taylor
Paulo J. Matos pa...@matos-sorge.com writes: I have builtin __function_size(foobar) that is applied to functions. This should be folded to a symbol foobar@size. The problem comes when I mark in the fold_builtin function in my backend that DECL_PRESERVE(foobar) = 1; The reason I need to do