public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32089]  New: Winline reports bogus warning
@ 2007-05-25 22:27 mckelvey at maskull dot com
  2007-05-25 22:30 ` [Bug c++/32089] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mckelvey at maskull dot com @ 2007-05-25 22:27 UTC (permalink / raw)
  To: gcc-bugs

CircularlyReferenceable.cc:76: error: called from here
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/4.3.0/../../../../
include/c++/4.3.0/bits/stl_multiset.h:91: error: 
inlining failed in call to 'std::multiset<const 
PatternDriver::CircularlyReferenceable*, 
std::less<const PatternDriver::CircularlyReferenceable*>, 
std::allocator<const PatternDriver::CircularlyReferenceable*> >::
~multiset()': call is unlikely
CircularlyReferenceable.cc:76: error: called from here
gmake: *** [CircularlyReferenceable.o] Error 1

This error (actually a warning) makes no sense: how can a destructor call be 
unlikely? What does that mean? I suspect that the warning is badly worded. What
is intended here?

Also, multiset is in the STL, and Winline should not be reporting against it.

alpha1:gcc>uname -a
Linux alpha1 2.4.9-40 #1 Mon Sep 23 08:14:02 EDT 2002 alpha unknown

alpha1:gcc>g++ -v
Using built-in specs.
Target: alphaev56-unknown-linux-gnu
Configured with: ../gcc/configure --verbose --enable-languages=c++
--disable-linux-futex --disable-nls --disable-tls
Thread model: posix
gcc version 4.3.0 20070519 (experimental)

alpha1:gcc>alias CONFIGURECVS
alias CONFIGURECVS='../gcc/configure --verbose --enable-languages=c++
--disable-linux-futex --disable-nls --disable-tls >clog 2>&1 &'
alpha1:gcc>alias BUILD
alias BUILD='nice gmake CFLAGS='\'''\'' BOOT_CFLAGS='\'''\''
LIBCFLAGS='\''-g'\'' LIBCXXFLAGS='\''-g'\'' bootstrap >log 2>&1 &'


-- 
           Summary: Winline reports bogus warning
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mckelvey at maskull dot com
 GCC build triplet: alphaev56-unknown-linux-gnu
  GCC host triplet: alphaev56-unknown-linux-gnu
GCC target triplet: alphaev56-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32089


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

* [Bug c++/32089] Winline reports bogus warning
  2007-05-25 22:27 [Bug c++/32089] New: Winline reports bogus warning mckelvey at maskull dot com
@ 2007-05-25 22:30 ` pinskia at gcc dot gnu dot org
  2007-05-25 23:03 ` mckelvey at maskull dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-25 22:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-05-25 22:30 -------
First the deconstructor was either defaulted to inline or marked as such.
Second what are the full options do you use?

If the call is unlikely (which it says in your case), then there is no reason
to inline it.  I bet this comes from exceptions.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32089


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

* [Bug c++/32089] Winline reports bogus warning
  2007-05-25 22:27 [Bug c++/32089] New: Winline reports bogus warning mckelvey at maskull dot com
  2007-05-25 22:30 ` [Bug c++/32089] " pinskia at gcc dot gnu dot org
@ 2007-05-25 23:03 ` mckelvey at maskull dot com
  2007-06-10  3:24 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mckelvey at maskull dot com @ 2007-05-25 23:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mckelvey at maskull dot com  2007-05-25 23:03 -------
Here is how I compile it:

/usr/local/bin/g++ -c -O3 -DNDEBUG -Wuninitialized -pedantic-errors -Werror 
-Winline -ansi -fno-common -Wall -Wold-style-cast -Wsign-promo -Wpointer-arith 
-Wundef -Wwrite-strings -Winvalid-pch -Woverloaded-virtual -Wcast-qual -Wextra 
-Wredundant-decls -Wshadow -Wcast-align -Wcomment -fstrict-aliasing 
-Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wlogical-op 
-Wunused -fvisibility-inlines-hidden -MMD      
-fimplicit-templates -o CircularlyReferenceable.o CircularlyReferenceable.cc

"froms" is the multiset. The destructor will be called in the normal case.
There
is an exception, but it is thrown before the multiset is even created.

        SeenMultiset froms;

        if (from != PDNULL)
        {
            froms.insert(from);
        }

        // Record we've been seen
        seen_map.insert(std::make_pair(this, froms));

        return true;

The warning points at the seen_map.insert and the return.

Whole member function:

bool CircularlyReferenceable::

_accumulate_delete_candidates(
    const CircularlyReferenceable * const from,
    SeenMap&                              seen_map) const
{
    if (! _is_allocated())
    {
        if (! get_strict())
        {
            return false;
        }

        throw InternalException(_message(_msgtext("Inconsistent reference "
                                                  "count: %s(0)::%s(1)"),
                                         name(),
                                         "_accumulate_delete_candidates"),
                                __FILE__,
                                __LINE__);
    }

    // Get our entry (if there is one)
    const SeenMap::iterator it(seen_map.find(this));

    if (it == seen_map.end())
    {
        // We haven't been seen before; make an entry

        SeenMultiset froms;

        if (from != PDNULL)
        {
            froms.insert(from);
        }

        // Record we've been seen
        seen_map.insert(std::make_pair(this, froms));

        return true;
    }

    // We have been seen before, update the set of pointers to us

    if (from != PDNULL)
    {
        it->second.insert(from);
    }

    return false;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32089


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

* [Bug c++/32089] Winline reports bogus warning
  2007-05-25 22:27 [Bug c++/32089] New: Winline reports bogus warning mckelvey at maskull dot com
  2007-05-25 22:30 ` [Bug c++/32089] " pinskia at gcc dot gnu dot org
  2007-05-25 23:03 ` mckelvey at maskull dot com
@ 2007-06-10  3:24 ` pinskia at gcc dot gnu dot org
  2007-06-10 22:52 ` mckelvey at maskull dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-10  3:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-06-10 03:24 -------
Can you attach the preprocessed source?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32089


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

* [Bug c++/32089] Winline reports bogus warning
  2007-05-25 22:27 [Bug c++/32089] New: Winline reports bogus warning mckelvey at maskull dot com
                   ` (2 preceding siblings ...)
  2007-06-10  3:24 ` pinskia at gcc dot gnu dot org
@ 2007-06-10 22:52 ` mckelvey at maskull dot com
  2007-07-13 15:28 ` James dot W dot Mckelvey at jpl dot nasa dot gov
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mckelvey at maskull dot com @ 2007-06-10 22:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mckelvey at maskull dot com  2007-06-10 22:52 -------
Created an attachment (id=13674)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13674&action=view)
Preprocessed source


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32089


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

* [Bug c++/32089] Winline reports bogus warning
  2007-05-25 22:27 [Bug c++/32089] New: Winline reports bogus warning mckelvey at maskull dot com
                   ` (3 preceding siblings ...)
  2007-06-10 22:52 ` mckelvey at maskull dot com
@ 2007-07-13 15:28 ` James dot W dot Mckelvey at jpl dot nasa dot gov
  2008-02-17 19:45 ` hubicka at gcc dot gnu dot org
  2008-02-19  0:59 ` mckelvey at maskull dot com
  6 siblings, 0 replies; 8+ messages in thread
From: James dot W dot Mckelvey at jpl dot nasa dot gov @ 2007-07-13 15:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from James dot W dot Mckelvey at jpl dot nasa dot gov  2007-07-13 15:28 -------
(In reply to comment #3)
> Can you attach the preprocessed source?
> 

I did on June 10, I see the status is still Waiting.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32089


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

* [Bug c++/32089] Winline reports bogus warning
  2007-05-25 22:27 [Bug c++/32089] New: Winline reports bogus warning mckelvey at maskull dot com
                   ` (4 preceding siblings ...)
  2007-07-13 15:28 ` James dot W dot Mckelvey at jpl dot nasa dot gov
@ 2008-02-17 19:45 ` hubicka at gcc dot gnu dot org
  2008-02-19  0:59 ` mckelvey at maskull dot com
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2008-02-17 19:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hubicka at gcc dot gnu dot org  2008-02-17 19:45 -------
OK, I am switching it to new again ;)

However the warning really means that GCC decided to not inline the function
because it thinks it is not profitable because it concluded that the call is
infrequent. Perhaps you can suggest better wording?  The cold regions can be
controlled via hot-bb-frequency-fraction parameter.

Honza


-- 

hubicka at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-17 19:45:00
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32089


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

* [Bug c++/32089] Winline reports bogus warning
  2007-05-25 22:27 [Bug c++/32089] New: Winline reports bogus warning mckelvey at maskull dot com
                   ` (5 preceding siblings ...)
  2008-02-17 19:45 ` hubicka at gcc dot gnu dot org
@ 2008-02-19  0:59 ` mckelvey at maskull dot com
  6 siblings, 0 replies; 8+ messages in thread
From: mckelvey at maskull dot com @ 2008-02-19  0:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from mckelvey at maskull dot com  2008-02-19 00:58 -------
How can GCC conclude that a call is going to be infrequent? Doesn't that
amount to predicting the future? Also, if an object is constructed, then it
will
be destroyed. So there is almost a 100% chance of calling the destructor if the
class is used at all. Maybe I'm missing something.

It would be best for the message to say the REAL reason for not inlining,
whatever that may be.

If that is not feasible, I would be OK with just saying "inlining call
determined to be unprofitable". That is vague, but not confusing.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32089


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

end of thread, other threads:[~2008-02-19  0:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-25 22:27 [Bug c++/32089] New: Winline reports bogus warning mckelvey at maskull dot com
2007-05-25 22:30 ` [Bug c++/32089] " pinskia at gcc dot gnu dot org
2007-05-25 23:03 ` mckelvey at maskull dot com
2007-06-10  3:24 ` pinskia at gcc dot gnu dot org
2007-06-10 22:52 ` mckelvey at maskull dot com
2007-07-13 15:28 ` James dot W dot Mckelvey at jpl dot nasa dot gov
2008-02-17 19:45 ` hubicka at gcc dot gnu dot org
2008-02-19  0:59 ` mckelvey at maskull dot com

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).