public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/64272] New: useless "called from here" for inline failed error/warning
@ 2014-12-11 15:48 manu at gcc dot gnu.org
  2021-09-28 10:03 ` [Bug middle-end/64272] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: manu at gcc dot gnu.org @ 2014-12-11 15:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64272

            Bug ID: 64272
           Summary: useless "called from here" for inline failed
                    error/warning
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: manu at gcc dot gnu.org
                CC: schwab at gcc dot gnu.org

Notice here: https://sourceware.org/ml/libc-alpha/2014-12/msg00300.html

It is useless to print the additional "called from here" (which should be an
inform note) if there is no location. Also, in the case of warning, there is no
point in giving the additional note if no warning was emitted.

I would argue that it would be better to print first the location of the call
and then give a note saying "declared here", like we do for other similar
warnings. However, since there may be no location for the call (???!!!), I
guess we can make do with something like the patch below.

I don't actually have a testcase. Andreas, could you extract one from the glibc
sources? Thanks!

Index: gcc/tree-inline.c
===================================================================
--- gcc/tree-inline.c   (revision 218628)
+++ gcc/tree-inline.c   (working copy)
@@ -4383,13 +4383,15 @@ expand_call_inline (basic_block bb, gimp
              || !optimize
              || cgraph_inline_failed_type (reason) == CIF_FINAL_ERROR)
          /* PR 20090218-1_0.c. Body can be provided by another module. */
          && (reason != CIF_BODY_NOT_AVAILABLE || !flag_generate_lto))
        {
+         /* See https://sourceware.org/ml/libc-alpha/2014-12/msg00300.html */
          error ("inlining failed in call to always_inline %q+F: %s", fn,
                 cgraph_inline_failed_string (reason));
-         error ("called from here");
+         if (input_location != UNKNWON_LOCATION)
+           inform (input_location, "called from here");
        }
       else if (warn_inline
               && DECL_DECLARED_INLINE_P (fn)
               && !DECL_NO_INLINE_WARNING_P (fn)
               && !DECL_IN_SYSTEM_HEADER (fn)
@@ -4398,13 +4400,14 @@ expand_call_inline (basic_block bb, gimp
               /* Do not warn about not inlined recursive calls.  */
               && !cg_edge->recursive_p ()
               /* Avoid warnings during early inline pass. */
               && symtab->global_info_ready)
        {
-         warning (OPT_Winline, "inlining failed in call to %q+F: %s",
-                  fn, _(cgraph_inline_failed_string (reason)));
-         warning (OPT_Winline, "called from here");
+         if (warning (OPT_Winline, "inlining failed in call to %q+F: %s",
+                      fn, _(cgraph_inline_failed_string (reason)))
+             && input_location != UNKNWON_LOCATION)
+           inform (input_location, "called from here");
        }
       goto egress;
     }
   fn = cg_edge->callee->decl;
   cg_edge->callee->get_untransformed_body ();


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug middle-end/64272] useless "called from here" for inline failed error/warning
  2014-12-11 15:48 [Bug middle-end/64272] New: useless "called from here" for inline failed error/warning manu at gcc dot gnu.org
@ 2021-09-28 10:03 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-28 10:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64272

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |6.0
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
patch was applied for GCC 6 (r6-3440).

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-28 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-11 15:48 [Bug middle-end/64272] New: useless "called from here" for inline failed error/warning manu at gcc dot gnu.org
2021-09-28 10:03 ` [Bug middle-end/64272] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).