Message ID | CAAs8Hmztr1MrX-RgK+wdqOF-v76jNxNguXTYYO6k6NwFY+RO1Q@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Fri, Jul 12, 2013 at 3:16 PM, Sriraman Tallam <tmsriram@google.com> wrote: > Patch attached to fix this: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57698 > > Here is what is going on. In rev. 200179, this change to tree-inline.c > > Index: tree-inline.c > =================================================================== > --- tree-inline.c (revision 200178) > +++ tree-inline.c (revision 200179) > @@ -3905,8 +3905,6 @@ > for inlining, but we can't do that because frontends overwrite > the body. */ > && !cg_edge->callee->local.redefined_extern_inline > - /* Avoid warnings during early inline pass. */ > - && cgraph_global_info_ready > /* PR 20090218-1_0.c. Body can be provided by another module. */ > && (reason != CIF_BODY_NOT_AVAILABLE || !flag_generate_lto)) > { > > made inline failure errors during early inlining reportable. Now, > this function is called when the early_inliner calls > optimize_inline_calls. The reason for the failure, > CIF_INDIRECT_UNKNOWN_CALL, should not be reported because it is not a > valid reason,(see can_inline_edge_p in ipa-inline.c for the list of > reasons we intend to report) but it gets reported because of the above > change. > > > The reported bug happens only when optimization is turned on as the > early inliner pass invokes incremental inlining which calls > optimize_inline_calls and triggers the above failure. > > So, the fix is then as simple as: > > Index: tree-inline.c > =================================================================== > --- tree-inline.c (revision 200912) > +++ tree-inline.c (working copy) > @@ -3905,6 +3905,10 @@ expand_call_inline (basic_block bb, gimple stmt, c > for inlining, but we can't do that because frontends overwrite > the body. */ > && !cg_edge->callee->local.redefined_extern_inline > + /* During early inline pass, report only when optimization is > + not turned on. */ > + && (cgraph_global_info_ready > + || !optimize) > /* PR 20090218-1_0.c. Body can be provided by another module. */ > && (reason != CIF_BODY_NOT_AVAILABLE || !flag_generate_lto)) > { > > Seems like the right fix to me. Ok? The whole patch with test case > included is attached. > This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59789
Index: tree-inline.c =================================================================== --- tree-inline.c (revision 200178) +++ tree-inline.c (revision 200179) @@ -3905,8 +3905,6 @@ for inlining, but we can't do that because frontends overwrite the body. */ && !cg_edge->callee->local.redefined_extern_inline - /* Avoid warnings during early inline pass. */ - && cgraph_global_info_ready /* PR 20090218-1_0.c. Body can be provided by another module. */ && (reason != CIF_BODY_NOT_AVAILABLE || !flag_generate_lto)) { made inline failure errors during early inlining reportable. Now, this function is called when the early_inliner calls optimize_inline_calls. The reason for the failure, CIF_INDIRECT_UNKNOWN_CALL, should not be reported because it is not a valid reason,(see can_inline_edge_p in ipa-inline.c for the list of reasons we intend to report) but it gets reported because of the above change. The reported bug happens only when optimization is turned on as the early inliner pass invokes incremental inlining which calls optimize_inline_calls and triggers the above failure. So, the fix is then as simple as: Index: tree-inline.c =================================================================== --- tree-inline.c (revision 200912) +++ tree-inline.c (working copy) @@ -3905,6 +3905,10 @@ expand_call_inline (basic_block bb, gimple stmt, c for inlining, but we can't do that because frontends overwrite the body. */ && !cg_edge->callee->local.redefined_extern_inline + /* During early inline pass, report only when optimization is + not turned on. */ + && (cgraph_global_info_ready + || !optimize) /* PR 20090218-1_0.c. Body can be provided by another module. */ && (reason != CIF_BODY_NOT_AVAILABLE || !flag_generate_lto)) {