public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32395]  New: false positive warning about use of uninitialized variable.
@ 2007-06-18 17:24 pluto at agmk dot net
  2007-06-18 17:25 ` [Bug c++/32395] " pluto at agmk dot net
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2007-06-18 17:24 UTC (permalink / raw)
  To: gcc-bugs

gcc-4.1 produces a warning for the following testcase.
(testcase uses headers from boost-1.34.0).

$ cat multi_index_test.cpp

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/member.hpp>
#include <vector>

using namespace boost;
using namespace boost::multi_index;

struct X
{
        int value;
        bool operator < ( X const& e) const;
};

typedef multi_index_container
<
        X,
        indexed_by
        <
                ordered_unique< identity< X > >,
                ordered_non_unique< member< X, int, &X::value > >
        >
> C;

extern
C f( std::vector< X > const& v )
{
        return C( v.begin(), v.end() );
}


$ x86_64-gnu-linux-g++ \
  -I/local/devel/buildenv41/x86_64-gnu-linux/boost-stdc++-1.34.0/include \
  multi_index_test.cpp -O1 -Wall --save-temps -c

/local/devel/buildenv41/x86_64-gnu-linux/boost-stdc++-1.34.0/include/boost/multi_index/ordered_index.hpp:
In member function 'std::pair<typename
boost::multi_index::detail::multi_index_base_type<Value, IndexSpecifierList,
Allocator>::type::node_type*, bool>
boost::multi_index::multi_index_container<Value, IndexSpecifierList,
Allocator>::insert_(const Value&, typename
boost::multi_index::detail::multi_index_base_type<Value, IndexSpecifierList,
Allocator>::type::node_type*) [with Value = X, IndexSpecifierList =
boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::identity<X>,
mpl_::na, mpl_::na>,
boost::multi_index::ordered_non_unique<boost::multi_index::member<X, int,
&X::value>, mpl_::na, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, Allocator =
std::allocator<X>]':
/local/devel/buildenv41/x86_64-gnu-linux/boost-stdc++-1.34.0/include/boost/multi_index/ordered_index.hpp:566:
warning:
'inf.boost::multi_index::detail::ordered_index<boost::multi_index::identity<X>,
std::less<X>, boost::multi_index::detail::nth_layer<1, X,
boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::identity<X>,
mpl_::na, mpl_::na>,
boost::multi_index::ordered_non_unique<boost::multi_index::member<X, int,
&X::value>, mpl_::na, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<X>
>, boost::mpl::vector0<mpl_::na>,
boost::multi_index::detail::ordered_unique_tag>::link_info::side' may be used
uninitialized in this function

as far i can the warning comes from:

bool link_point(key_param_type k,link_info& inf,ordered_unique_tag)
  {
    (...)
    else{
      inf.pos=yy->impl();  <== partial initialziation of link_info&.
      return false;
    }
  }

in fact, all use cases of link_point use only inf.pos
when {hinted_,}link_point returns false.

(...)

  if(!link_point(key(v),inf,Category())){
      return node_type::from_impl(inf.pos);

(...)

  node_type* insert_(value_param_type v,node_type* position,node_type* x)
  {
    link_info inf;
    if(!hinted_link_point(key(v),position,inf,Category())){
      return node_type::from_impl(inf.pos);

(...)

gcc-3.4.5 and 4.2 works fine (no warning), but 4.1.2 fails.
4.0 and 4.3 wasn't tested.


-- 
           Summary: false positive warning about use of uninitialized
                    variable.
           Product: gcc
           Version: 4.1.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net


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


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

* [Bug c++/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
@ 2007-06-18 17:25 ` pluto at agmk dot net
  2007-06-19  8:10 ` [Bug middle-end/32395] " pinskia at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2007-06-18 17:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pluto at agmk dot net  2007-06-18 17:25 -------
Created an attachment (id=13730)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13730&action=view)
testcase


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
  2007-06-18 17:25 ` [Bug c++/32395] " pluto at agmk dot net
@ 2007-06-19  8:10 ` pinskia at gcc dot gnu dot org
  2007-06-24 15:54 ` pluto at agmk dot net
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-19  8:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-06-19 08:10 -------
This is caused by two things, jump threading and inlining.  If we jump thread
more, we no longer get the warning which is what you are seeing in 4.2.1.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |middle-end


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
  2007-06-18 17:25 ` [Bug c++/32395] " pluto at agmk dot net
  2007-06-19  8:10 ` [Bug middle-end/32395] " pinskia at gcc dot gnu dot org
@ 2007-06-24 15:54 ` pluto at agmk dot net
  2007-06-25 22:56 ` pluto at agmk dot net
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2007-06-24 15:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pluto at agmk dot net  2007-06-24 15:54 -------
(In reply to comment #2)
> This is caused by two things, jump threading and inlining.  If we jump thread
> more, we no longer get the warning which is what you are seeing in 4.2.1.

is there any possibility to increase the depth of this analysis in 4.1.x?
some compile-time constant hardcoded in sources, or sth?


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (2 preceding siblings ...)
  2007-06-24 15:54 ` pluto at agmk dot net
@ 2007-06-25 22:56 ` pluto at agmk dot net
  2007-06-25 22:57 ` pluto at agmk dot net
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2007-06-25 22:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pluto at agmk dot net  2007-06-25 22:56 -------
(In reply to comment #2)
> This is caused by two things, jump threading and inlining.  If we jump thread
> more, we no longer get the warning which is what you are seeing in 4.2.1.
> 

the latest gcc 4.2 also produces this warning.


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (3 preceding siblings ...)
  2007-06-25 22:56 ` pluto at agmk dot net
@ 2007-06-25 22:57 ` pluto at agmk dot net
  2007-08-22 15:44 ` manu at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2007-06-25 22:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pluto at agmk dot net  2007-06-25 22:57 -------
Created an attachment (id=13789)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13789&action=view)
preprocessed testcase


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (4 preceding siblings ...)
  2007-06-25 22:57 ` pluto at agmk dot net
@ 2007-08-22 15:44 ` manu at gcc dot gnu dot org
  2007-08-22 15:54 ` pluto at agmk dot net
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-08-22 15:44 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]



------- Comment #6 from manu at gcc dot gnu dot org  2007-08-22 15:44 -------
(In reply to comment #5)
> Created an attachment (id=13789)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13789&action=view) [edit]
> preprocessed testcase
> 

:-( I cannot compile this testcase

manu@localhost:~/gcc$ g++ -c -O1 -Wall pr32395.ii -Wfatal-errors
/usr/include/c++/4.2.0/x86_64-pld-linux/bits/c++config.h:149: error: expected
`=' before ‘__attribute__’

manu@localhost:~/gcc$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (5 preceding siblings ...)
  2007-08-22 15:44 ` manu at gcc dot gnu dot org
@ 2007-08-22 15:54 ` pluto at agmk dot net
  2007-08-22 16:48 ` manu at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2007-08-22 15:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pluto at agmk dot net  2007-08-22 15:54 -------
(In reply to comment #6)
> (In reply to comment #5)
> > Created an attachment (id=13789)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13789&action=view) [edit]
> > preprocessed testcase
> > 
> 
> :-( I cannot compile this testcase

it works with my gcc-4.2.1-20070719.


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (6 preceding siblings ...)
  2007-08-22 15:54 ` pluto at agmk dot net
@ 2007-08-22 16:48 ` manu at gcc dot gnu dot org
  2007-08-22 18:36 ` pluto at agmk dot net
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-08-22 16:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from manu at gcc dot gnu dot org  2007-08-22 16:47 -------
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > Created an attachment (id=13789)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13789&action=view) [edit]
> > > preprocessed testcase
> > > 
> > 
> > :-( I cannot compile this testcase
> 
> it works with my gcc-4.2.1-20070719.

Perhaps is because my target is i*86-linux-gnu? Could you reprocess it for
that, please?


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (7 preceding siblings ...)
  2007-08-22 16:48 ` manu at gcc dot gnu dot org
@ 2007-08-22 18:36 ` pluto at agmk dot net
  2007-09-25 14:24 ` pluto at agmk dot net
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2007-08-22 18:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pluto at agmk dot net  2007-08-22 18:36 -------
Created an attachment (id=14095)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14095&action=view)
preprocessed testcase for 32-bits targets.


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (8 preceding siblings ...)
  2007-08-22 18:36 ` pluto at agmk dot net
@ 2007-09-25 14:24 ` pluto at agmk dot net
  2007-09-27  0:58 ` manu at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2007-09-25 14:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pluto at agmk dot net  2007-09-25 14:24 -------
Manuel, ping, do you working on it?
i've posted preprocessed 32-bit testaces for you over month ago ;)
btw. PR32368 exposes this bug.


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (9 preceding siblings ...)
  2007-09-25 14:24 ` pluto at agmk dot net
@ 2007-09-27  0:58 ` manu at gcc dot gnu dot org
  2007-09-27  4:07 ` bangerth at dealii dot org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-09-27  0:58 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]



------- Comment #11 from manu at gcc dot gnu dot org  2007-09-27 00:58 -------
(In reply to comment #10)
> Manuel, ping, do you working on it?
> i've posted preprocessed 32-bit testaces for you over month ago ;)
> btw. PR32368 exposes this bug.
> 

Sorry, I am probably doing something wrong but I cannot get it to compile.
Weird.

manuel@gcc11:~$ 128590/build/gcc/cc1plus src/multi_index_test.ii -O1 -Wall
-Wfatal-errors
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:73,
                 from /usr/include/c++/4.2.1/algorithm:66,
                 from /usr/include/boost/multi_index_container.hpp:20,
                 from multi_index_test.cpp:2:
/usr/include/c++/4.2.1/bits/cpp_type_traits.h: At global scope:
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:346: error: expected identifier
before ‘__is_pod’

and

manu@localhost:~/$ g++ -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)

manu@localhost:~/$ g++ -Wall -O1 -c multi_index_test.ii -Wfatal-errors
/usr/include/c++/4.2.1/x86_64-pld-linux/32/bits/c++config.h:149: error:
expected `=' before ‘__attribute__’
compilation terminated due to -Wfatal-errors.


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (10 preceding siblings ...)
  2007-09-27  0:58 ` manu at gcc dot gnu dot org
@ 2007-09-27  4:07 ` bangerth at dealii dot org
  2008-01-08 20:00 ` pluto at agmk dot net
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bangerth at dealii dot org @ 2007-09-27  4:07 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]



------- Comment #12 from bangerth at dealii dot org  2007-09-27 04:06 -------
(In reply to comment #11)
> /usr/include/c++/4.2.1/bits/cpp_type_traits.h:346: error: expected identifier
> before â&#8364;&#732;__is_podâ&#8364;&#8482;

__is_pod is only implemented on mainline, not 4.2.1.

W.


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (11 preceding siblings ...)
  2007-09-27  4:07 ` bangerth at dealii dot org
@ 2008-01-08 20:00 ` pluto at agmk dot net
  2008-01-23 21:25 ` pluto at agmk dot net
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2008-01-08 20:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from pluto at agmk dot net  2008-01-08 19:44 -------
Created an attachment (id=14903)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14903&action=view)
testacase for /opt/gcc43/bin/g++ 32395.ii -Wall -c -O1 -m32


-- 

pluto at agmk dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #13789|0                           |1
        is obsolete|                            |
  Attachment #14095|0                           |1
        is obsolete|                            |


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (12 preceding siblings ...)
  2008-01-08 20:00 ` pluto at agmk dot net
@ 2008-01-23 21:25 ` pluto at agmk dot net
  2008-01-23 23:20 ` manu at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2008-01-23 21:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from pluto at agmk dot net  2008-01-23 21:01 -------
> :-( I cannot compile this testcase

please try the latest testcase.


-- 


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (13 preceding siblings ...)
  2008-01-23 21:25 ` pluto at agmk dot net
@ 2008-01-23 23:20 ` manu at gcc dot gnu dot org
  2008-02-01 17:56 ` manu at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-01-23 23:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from manu at gcc dot gnu dot org  2008-01-23 22:57 -------
(In reply to comment #14)
> > :-( I cannot compile this testcase
> 
> please try the latest testcase.
> 

Thanks. It compiles fine now. The weirdest thing is that I cannot see the
uninitialized warning but I can see the "note: was declared here" message and
also the line were the warning should appear. So something is going very wrong
here.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-23 22:57:22
               date|                            |


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


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

* [Bug middle-end/32395] false positive warning about use of uninitialized variable.
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (14 preceding siblings ...)
  2008-01-23 23:20 ` manu at gcc dot gnu dot org
@ 2008-02-01 17:56 ` manu at gcc dot gnu dot org
  2010-03-15 10:32 ` [Bug middle-end/32395] false uninitialized warning (huge testcase) pluto at agmk dot net
  2010-03-15 13:40 ` manu at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-01 17:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from manu at gcc dot gnu dot org  2008-02-01 17:55 -------
Somehow after SRA we end up creating a PHI node with an empty definition:



 # BLOCK 5 freq:2931, starting at line 7057
  # PRED: 276 [98.0%]  (true,exec) 3 [98.0%]  (true,exec)
  # inf$sideD.88720_393 = PHI <inf$sideD.88720_1256(276),
inf$sideD.88720_1476(D)(3)>

This node comes from the end of BB 3:

  # MPT.561D.88709_1630 = VDEF <MPT.561D.88709_1629> { MPT.561D.88709 }
  [pr32395-0.ii : 26871] thisD.73371_2(D)->node_countD.70698 = 0;
  # VUSE <MPT.561D.88709_1630> { MPT.561D.88709 }
  [pr32395-0.ii : 27027] hint$nodeD.85841_101 =
D.84656_69->D.70734.memberD.68890;
  [pr32395-0.ii : 26876] if (last$_M_currentD.85838_10 !=
first$_M_currentD.85837_463)
    goto <bb 5>;
  else
    goto <bb 285>;
  # SUCC: 5 [98.0%]  (true,exec) 285 [2.0%]  (false,exec)

I really cannot see in this huge testcase how we end up building this. However,
not even after all passes we remove the uninitialized use (and the edges going
to the block have a rather high probability). So, this is does not seem a bug,
just a case were GCC is not smart enough. More optimizations, more cases we
could catch. We will never catch them all. I would call it a Halting Problem
case and suspend it (probably add it with xfail to the testsuite).  ;-)

That it worked before just shows a possible optimisation regression with
respect to this code. But in such a huge testcase, it is hard to see what
regressed.


-- 


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


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

* [Bug middle-end/32395] false uninitialized warning (huge testcase)
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (15 preceding siblings ...)
  2008-02-01 17:56 ` manu at gcc dot gnu dot org
@ 2010-03-15 10:32 ` pluto at agmk dot net
  2010-03-15 13:40 ` manu at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: pluto at agmk dot net @ 2010-03-15 10:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from pluto at agmk dot net  2010-03-15 10:32 -------
recent 4.4/4.5 compiles '32395.ii -Wall -c -O1 -m32' cleanly, 4.3 still warns.


-- 

pluto at agmk dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|3.4.5                       |3.4.5 4.4.4 4.5.0


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


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

* [Bug middle-end/32395] false uninitialized warning (huge testcase)
  2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
                   ` (16 preceding siblings ...)
  2010-03-15 10:32 ` [Bug middle-end/32395] false uninitialized warning (huge testcase) pluto at agmk dot net
@ 2010-03-15 13:40 ` manu at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-03-15 13:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from manu at gcc dot gnu dot org  2010-03-15 13:40 -------
Pawel, I thank you for the report, but I really do not see how we can use this
bug report. The testcase is huge, so we cannot add it to the testsuite to avoid
regressing. If you can find a reduced testcase
http://gcc.gnu.org/bugs/minimize.html or starts failing again, please reopen,
meanwhile, I am closing this as FIXED in GCC 4.5.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2010-03-15 13:40 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-18 17:24 [Bug c++/32395] New: false positive warning about use of uninitialized variable pluto at agmk dot net
2007-06-18 17:25 ` [Bug c++/32395] " pluto at agmk dot net
2007-06-19  8:10 ` [Bug middle-end/32395] " pinskia at gcc dot gnu dot org
2007-06-24 15:54 ` pluto at agmk dot net
2007-06-25 22:56 ` pluto at agmk dot net
2007-06-25 22:57 ` pluto at agmk dot net
2007-08-22 15:44 ` manu at gcc dot gnu dot org
2007-08-22 15:54 ` pluto at agmk dot net
2007-08-22 16:48 ` manu at gcc dot gnu dot org
2007-08-22 18:36 ` pluto at agmk dot net
2007-09-25 14:24 ` pluto at agmk dot net
2007-09-27  0:58 ` manu at gcc dot gnu dot org
2007-09-27  4:07 ` bangerth at dealii dot org
2008-01-08 20:00 ` pluto at agmk dot net
2008-01-23 21:25 ` pluto at agmk dot net
2008-01-23 23:20 ` manu at gcc dot gnu dot org
2008-02-01 17:56 ` manu at gcc dot gnu dot org
2010-03-15 10:32 ` [Bug middle-end/32395] false uninitialized warning (huge testcase) pluto at agmk dot net
2010-03-15 13:40 ` manu at gcc dot gnu dot 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).