This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Interprocedural optimization question
- From: "Daniel Berlin" <dberlin at dberlin dot org>
- To: "Razya Ladelsky" <RAZYA at il dot ibm dot com>
- Cc: rbertran at ac dot upc dot edu, gcc at gcc dot gnu dot org
- Date: Mon, 29 Jan 2007 14:28:34 -0500
- Subject: Re: Interprocedural optimization question
- References: <OF12E55586.50FFA51F-ONC2257272.00409A6C-C2257272.0040AFCE@LocalDomain> <OF96B1025F.70CBD6E3-ONC2257272.0040B769-C2257272.0040E8C2@il.ibm.com>
On 1/29/07, Razya Ladelsky <RAZYA@il.ibm.com> wrote:
Razya Ladelsky/Haifa/IBM wrote on 29/01/2007 13:46:33:
> Hi,
>
> Does gcc apply inter-procedural optimizations across functions called
using
> a function pointer? I guess that gcc performs conservatively assuming
that
> the pointer could point everywhere because the pointer is a declared as
a
> global variable and could be changed in any place. Is it true?
Yes.
The callgraph does not include these calls.
Well, not quite.
While the callgraph doesn't include them, ipa-pta will come up with a
conservatively correct set for them.
IN the presence of static function pointers, we will come up with a
completely accurate set for them unless they escape