From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25143 invoked by alias); 18 Oct 2012 10:48:14 -0000 Received: (qmail 24966 invoked by uid 48); 18 Oct 2012 10:47:52 -0000 From: "siarhei.siamashka at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/54965] [4.6 Regression] sorry, unimplemented: inlining failed in call to 'foo': function not considered for inlining Date: Thu, 18 Oct 2012 10:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: siarhei.siamashka at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-10/txt/msg01657.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54965 --- Comment #3 from Siarhei Siamashka 2012-10-18 10:47:51 UTC --- (In reply to comment #2) > void combine_conjoint_xor_ca_float () > { > combine_channel_t j = pd_combine_conjoint_xor, k = pd_combine_conjoint_xor; > a[0] = k (0, b, 0, a[0]); > a[0] = k (0, b, 0, a[0]); > a[0] = k (0, b, 0, a[0]); > a[0] = j (0, c[0], 0, a[0]); > a[0] = k (0, c[0], 0, a[0]); > a[0] = k (0, c[0], 0, a[0]); > a[0] = k (0, c[0], 0, a[0]); > > you are using indirect function calls here, GCC in 4.6 is not smart enough > to transform them to direct calls before inlining. Inlining of > always-inline indirect function calls is not going to work reliably. Does this only apply to GCC 4.6? > Don't use always-inline or don't use indirect function calls to always-inline > functions. This looks like it might be really inconvenient. Pixman relies on this functionality in a number of places by doing something like this: void always_inline per_pixel_operation_a(...) { ... } void always_inline per_pixel_operation_b(...) { ... } void always_inline big_function_template(..., per_pixel_operation_ptr foo) { ... /* do some calls to foo() in an inner loop */ ... } void big_function_a(...) { big_function_template(..., per_pixel_operation_a); } void big_function_b(...) { big_function_template(..., per_pixel_operation_b); } Needless to say that we want to be absolutely sure that per-pixel operations are always inlined. Otherwise the performance gets really bad if the compiler ever makes a bad inlining decision. The same functionality can be probably achieved by replacing always_inline functions with macros. But the code becomes less readable, more error prone and somewhat more difficult to maintain.