From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27855 invoked by alias); 22 Oct 2008 15:11:02 -0000 Received: (qmail 27426 invoked by uid 48); 22 Oct 2008 15:09:40 -0000 Date: Wed, 22 Oct 2008 15:11:00 -0000 Message-ID: <20081022150940.27425.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jamborm at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg01451.txt.bz2 ------- Comment #20 from jamborm at gcc dot gnu dot org 2008-10-22 15:09 ------- OK, here is the status regarding the trunk (4.4) and the test cases posted here: 1. The test case in the bug description now works in the sense that funk is inlined even when not performing early inlining because both indirect inlining and copy propagation can help the inliner do this. 2. When compiling the code from comment #10 with indirect inlining turned on (default on -O2) we end up with (taken from the "optimized" tree dump): a (int x) { : if (x != 0) goto ; else goto ; : f (); [tail call] goto ; : f (); [tail call] : return; } Which obviously might be optimized even further but this is no longer an inlining issue. 3. Finally, let's look at code from comment #11. The function main still retains one call to foo(), specifically the one that came from function call(). The reason is that early cpp does not see the index being constant and thus does not replace the array_ref directly with the constant. Arguments could be made that cpp should be run few more times at various places (after ipa-cp, for example) but IMHO pass ordering would need bigger justification than this artificial example and this would be very difficult to implement while also retaining the three phase division of ipa passes for lto. Because we are done with all three examples as far as inlining is concerned, I think this is fixed. -- jamborm at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079