From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14290 invoked by alias); 14 May 2003 15:46:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 14219 invoked by uid 71); 14 May 2003 15:46:01 -0000 Resent-Date: 14 May 2003 15:46:01 -0000 Resent-Message-ID: <20030514154601.14218.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, Sylvain.Pion@mpi-sb.mpg.de Resent-Reply-To: gcc-gnats@gcc.gnu.org, Sylvain.Pion@mpi-sb.mpg.de Received: (qmail 30745 invoked by uid 48); 14 May 2003 15:38:40 -0000 Message-Id: <20030514153840.30740.qmail@sources.redhat.com> Date: Wed, 14 May 2003 15:46:00 -0000 From: Sylvain.Pion@mpi-sb.mpg.de Reply-To: Sylvain.Pion@mpi-sb.mpg.de To: gcc-gnats@gcc.gnu.org Cc: Sylvain.Pion@mpi-sb.mpg.de X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify: Sylvain.Pion@mpi-sb.mpg.de Subject: libstdc++/10783: std::vector::reverse_iterator could be smaller X-SW-Source: 2003-05/txt/msg01653.txt.bz2 List-Id: >Number: 10783 >Category: libstdc++ >Synopsis: std::vector::reverse_iterator could be smaller >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: pessimizes-code >Submitter-Id: net >Arrival-Date: Wed May 14 15:46:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Sylvain Pion >Release: 3.2, 3.3, 3.4 (2.95 doesn't have the problem, I don't have 3.[01]) >Organization: >Environment: Reading specs from ./GCC/Linux-3.2/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.2.3/specs Configured with: ../gcc-3.2/configure --prefix=/home/spion/GCC/Linux-3.2 --enable-languages=c++ Thread model: posix gcc version 3.2.3 >Description: On my 32bit machine, sizeof(std::vector<>::reverse_iterator) is 8. Similarly for std::vector<>::const_reverse_iterator. All other iterators from the STL containers (except deque) have sizeof 4. I believe it could be made also 4 bytes if the empty base class optimization applied, but it seems it doesn't. Is it because there are 2 derivations from the same iterator<...> class ? Is there a way to fix it ? >How-To-Repeat: #include #include int main() { typedef std::vector V; std::cout << "sizeof(iterator) = " << sizeof(V::iterator) << std::endl; std::cout << "sizeof(reverse_iterator) = " << sizeof(V::reverse_iterator) << std::endl; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: