* [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