Re: Question about undefined functions' parameters during LTO

2020-04-07 Thread Richard Biener via Gcc
On Tue, Apr 7, 2020 at 2:41 PM Erick Ochoa wrote: > > > > On 07/04/2020 14:34, Michael Matz wrote: > > Hello, > > > > On Tue, 7 Apr 2020, Erick Ochoa wrote: > > > >> Thanks for this lead! It is almost exactly what I need. I do have one more > >> question about this. It seems that the types

Re: Question about undefined functions' parameters during LTO

2020-04-07 Thread Michael Matz
Hello, On Tue, 7 Apr 2020, Erick Ochoa wrote: > > So, when you want to compare types use useless_type_conversion_p (for > > equivalence you need useless(a,b) && useless(b,a)). In particular, > > for record types T it's TYPE_CANONICAL(T) that needs to be > > pointer-equal. (I.e. you could

Re: Question about undefined functions' parameters during LTO

2020-04-07 Thread Erick Ochoa
On 07/04/2020 14:34, Michael Matz wrote: Hello, On Tue, 7 Apr 2020, Erick Ochoa wrote: Thanks for this lead! It is almost exactly what I need. I do have one more question about this. It seems that the types obtained via FOR_EACH_FUNCTION_ARGS and TREE_TYPE are different pointers when

Re: Question about undefined functions' parameters during LTO

2020-04-07 Thread Michael Matz
Hello, On Tue, 7 Apr 2020, Erick Ochoa wrote: > Thanks for this lead! It is almost exactly what I need. I do have one more > question about this. It seems that the types obtained via > FOR_EACH_FUNCTION_ARGS and TREE_TYPE are different pointers when compiled with > -flto. > > What do I mean by

Re: Question about undefined functions' parameters during LTO

2020-04-07 Thread Richard Biener via Gcc
On Tue, Apr 7, 2020 at 1:54 PM Erick Ochoa wrote: > > Hello Micheal, > > Thanks for this lead! It is almost exactly what I need. I do have one > more question about this. It seems that the types obtained via > FOR_EACH_FUNCTION_ARGS and TREE_TYPE are different pointers when > compiled with -flto.

Re: Question about undefined functions' parameters during LTO

2020-04-07 Thread Erick Ochoa
Hello Micheal, Thanks for this lead! It is almost exactly what I need. I do have one more question about this. It seems that the types obtained via FOR_EACH_FUNCTION_ARGS and TREE_TYPE are different pointers when compiled with -flto. What do I mean by this? Consider the following code:

Re: Question about undefined functions' parameters during LTO

2020-03-13 Thread Michael Matz
Hello, On Fri, 13 Mar 2020, Erick Ochoa wrote: > +for (tree parm = DECL_ARGUMENTS (undefined_function->decl); parm; parm = > DECL_CHAIN (parm)) > + { > + tree type = TREE_TYPE(parm); > + if (dump_file) fprintf(dump_file, "I want the type, do I have it? > %s\n", type ? "true"

Re: Question about undefined functions' parameters during LTO

2020-03-13 Thread Erick Ochoa
On 13.03.20 00:44, Richard Biener wrote: On Thu, Mar 12, 2020 at 5:31 PM Erick Ochoa wrote: Hello, I am trying to find out the arguments of functions which are undefined during LTO. Basically: gcc_assert(in_lto_p && !cnode->definition) // Do we have arguments?

Re: Question about undefined functions' parameters during LTO

2020-03-13 Thread Erick Ochoa
On 12.03.20 08:48, Jan Hubicka wrote: Hello, Hello, I am trying to find out the arguments of functions which are undefined during LTO. Basically: gcc_assert(in_lto_p && !cnode->definition) // Do we have arguments? gcc_assert(DECL_ARGUMENTS(cnode->decl)) // fails // No, we don't. As I

Re: Question about undefined functions' parameters during LTO

2020-03-13 Thread Richard Biener via Gcc
On Thu, Mar 12, 2020 at 5:31 PM Erick Ochoa wrote: > > Hello, > > I am trying to find out the arguments of functions which are undefined > during LTO. > > Basically: > > gcc_assert(in_lto_p && !cnode->definition) > // Do we have arguments? > gcc_assert(DECL_ARGUMENTS(cnode->decl)) // fails > //

Re: Question about undefined functions' parameters during LTO

2020-03-12 Thread Jan Hubicka
> Hello, Hello, > > I am trying to find out the arguments of functions which are undefined > during LTO. > > Basically: > > gcc_assert(in_lto_p && !cnode->definition) > // Do we have arguments? > gcc_assert(DECL_ARGUMENTS(cnode->decl)) // fails > // No, we don't. > > As I understand it,

Question about undefined functions' parameters during LTO

2020-03-12 Thread Erick Ochoa
Hello, I am trying to find out the arguments of functions which are undefined during LTO. Basically: gcc_assert(in_lto_p && !cnode->definition) // Do we have arguments? gcc_assert(DECL_ARGUMENTS(cnode->decl)) // fails // No, we don't. As I understand it, functions which are not defined are