This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, c++0x] Testcases for unique_ptr


On Wed, Jun 25, 2008 at 12:58 PM, Paolo Carlini
<paolo.carlini@oracle.com> wrote:
> Hi again Chris,
>
> can you please regtest again on your side with make check CXXFLAGS="-O2 -Wall"?
>
> There are two fails, maybe benign but please check:
>
> FAIL: 20_util/unique_ptr/assign/move_array.cc (test for excess errors)
> FAIL: 20_util/unique_ptr/cons/pointer_array.cc (test for excess errors)
>
> due to:
>
> unique_ptr.h:77: warning: array subscript is below array bounds
>
> Thanks,
> Paolo.
>
>

I do get those failures. They stem from the offset calculation for the
base class during the delete. I punched out a tree dump of the
attached test case and in move_array.cpp.060t.forwprop2 (also
attached) I see:
  D.2208_15 = &(*D.2149_3)[-8];
  operator delete [] (D.2208_15);

I believe it's that -8 that causes the warning. I found a bug
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35593 that seems relevant
but the test case is doing the pointer subtraction explicitly whereas
here it happens during the optimization process.

Am I correct in saying that the warning should not be emitted in our
case therefore theres a bug in whatever code is responsible for
determining if negative indexes are allowed or not?

Whats the course of action here?

Chris

Attachment: move_array.cpp
Description: Text document

Attachment: move_array.cpp.059t.dce2
Description: Binary data

Attachment: move_array.cpp.060t.forwprop2
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]