This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 2)
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 3 Jan 2014 11:21:25 +0100 (CET)
- Subject: Re: [PATCH] Fix devirtualization ICE (PR tree-optimization/59622, take 2)
- Authentication-results: sourceware.org; auth=none
- References: <20131230222412 dot GF892 at tucnak dot redhat dot com> <47adfd09-7411-4aa5-9782-e888833c6be9 at email dot android dot com> <20131231093208 dot GG892 at tucnak dot redhat dot com> <3246dbc4-3dfa-47d4-b2ff-d36d2f848c1c at email dot android dot com> <20140103083121 dot GT892 at tucnak dot redhat dot com> <4f67df10-e41a-4c13-9110-c68a52bdfe81 at email dot android dot com> <20140103094203 dot GY892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401031100040 dot 16201 at zhemvz dot fhfr dot qr> <20140103100809 dot GA892 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1401031110480 dot 16201 at zhemvz dot fhfr dot qr> <20140103101824 dot GC892 at tucnak dot redhat dot com>
On Fri, 3 Jan 2014, Jakub Jelinek wrote:
> On Fri, Jan 03, 2014 at 11:15:32AM +0100, Richard Biener wrote:
> > so if there is a decl then use its type signature, otherwise
> > (indirect calls) use the caller signature (and hope it matches
> > the callee...). That it later falls back to looking at
> > DECL_ARGUMENTS is odd (probably a FE issue where we have a
> > fndecl with a bogus type?)
>
> For K&R C non-prototyped functions
> foo (x, y)
> int x, y;
> {
> return x + y;
> }
> I think TYPE_ARG_TYPES is NULL (?) and DECL_ARGUMENTS is the only way to get
> at the types.
Ah, indeed. A C speciality that shouldn't survive GENERICization if
that's really the case.
I wonder how
int main()
{
return (*(&foo))(0, 0);
}
works though. Or
__auto_type x = foo;
(substitute for that new C __auto thing).
The former probably because we fold away the indirection very early.
Richard.