public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
@ 2011-03-08 22:14 scot4spam at yahoo dot com
  2011-03-08 22:43 ` [Bug c++/48035] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: scot4spam at yahoo dot com @ 2011-03-08 22:14 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Mismatch on size of class when initializing hierarchy
                    involving virtual inheritance and empty base classes
           Product: gcc
           Version: 4.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: scot4spam@yahoo.com


Created attachment 23585
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23585
preprocessed source file

The attached preprocessed source file is a much-simplified version of a more
complex class hierarchy involving several levels of virtual inheritance and
empty classes in the hierarchy.

"g++ -v" details:
Using built-in specs.
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch=i686
--build=i686-redhat-linux
Thread model: posix
gcc version 4.4.5 20101112 (Red Hat 4.4.5-2) (GCC)

Also tested with a new build:
Using built-in specs.
COLLECT_GCC=./g++
Target: i686-pc-linux-gnu
Configured with: ./configure
Thread model: posix
gcc version 4.5.2 (GCC)

Among others.

Compile with "g++ -c vtable-bug.i".

What we observe (tested on x86 and ARM) is that "operator new" is called to
allocate 12 bytes for the class (and sizeof matches that 12 byte size), but the
compiled code then proceeds to load four-byte 0's into offsets 0, 4, 8, AND 12
from the allocated buffer, stomping data at byte offsets 12-15.  (More complex
hierarchies can result in more than one 4-byte offset being stomped, and/or the
same offset being initialized repeatedly.)

Changing which classes are virtual, or adding data to empty base classes,
changes or fixes the behavior.


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

* [Bug c++/48035] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
@ 2011-03-08 22:43 ` pinskia at gcc dot gnu.org
  2011-03-08 22:46 ` [Bug c++/48035] [4.4/4.5/4.6 Regression] " pinskia at gcc dot gnu.org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-03-08 22:43 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-03-08 22:43:13 UTC ---
On x86_64 with valgrind:


==31260== Invalid write of size 8
==31260==    at 0x4006E0: BadStuffHere() (t.cc:38)
==31260==    by 0x400703: main (t.cc:43)
==31260==  Address 0x5936058 is 0 bytes after a block of size 24 alloc'd
==31260==    at 0x4C24DFA: operator new(unsigned long)
(vg_replace_malloc.c:261)
==31260==    by 0x4006C6: BadStuffHere() (t.cc:38)
==31260==    by 0x400703: main (t.cc:43)


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

* [Bug c++/48035] [4.4/4.5/4.6 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
  2011-03-08 22:43 ` [Bug c++/48035] " pinskia at gcc dot gnu.org
@ 2011-03-08 22:46 ` pinskia at gcc dot gnu.org
  2011-03-09 11:45 ` dodji at gcc dot gnu.org
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-03-08 22:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.03.08 22:45:54
      Known to work|                            |4.3.5
   Target Milestone|---                         |4.4.6
            Summary|Mismatch on size of class   |[4.4/4.5/4.6 Regression]
                   |when initializing hierarchy |Mismatch on size of class
                   |involving virtual           |when initializing hierarchy
                   |inheritance and empty base  |involving virtual
                   |classes                     |inheritance and empty base
                   |                            |classes
     Ever Confirmed|0                           |1
      Known to fail|                            |4.4.5, 4.6.0

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-03-08 22:45:54 UTC ---
Confirmed, there was no valgrind errors in 4.3.5.


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

* [Bug c++/48035] [4.4/4.5/4.6 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
  2011-03-08 22:43 ` [Bug c++/48035] " pinskia at gcc dot gnu.org
  2011-03-08 22:46 ` [Bug c++/48035] [4.4/4.5/4.6 Regression] " pinskia at gcc dot gnu.org
@ 2011-03-09 11:45 ` dodji at gcc dot gnu.org
  2011-03-09 12:46 ` jakub at gcc dot gnu.org
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-03-09 11:45 UTC (permalink / raw)
  To: gcc-bugs

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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |dodji at gcc dot gnu.org


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

* [Bug c++/48035] [4.4/4.5/4.6 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (2 preceding siblings ...)
  2011-03-09 11:45 ` dodji at gcc dot gnu.org
@ 2011-03-09 12:46 ` jakub at gcc dot gnu.org
  2011-03-09 14:04 ` jakub at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-09 12:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-09 12:46:12 UTC ---
I think this started with
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=138355


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

* [Bug c++/48035] [4.4/4.5/4.6 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (3 preceding siblings ...)
  2011-03-09 12:46 ` jakub at gcc dot gnu.org
@ 2011-03-09 14:04 ` jakub at gcc dot gnu.org
  2011-03-11 14:47 ` jakub at gcc dot gnu.org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-09 14:04 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-09 14:03:35 UTC ---
I think the problem is that build_zero_init isn't aware of the
DECL_FIELD_IS_BASE FIELD_DECLs and CLASSTYPE_AS_BASE stuff.  So when
simplify_aggr_init_expr decides to call build_zero_init on the
SpecificImplementation type, while the first FIELD_DECL has size 8 and its type
also size 8, the second FIELD_DECL has size 12 (CLASSTYPE_SIZE_UNIT), its type
has size 24 and thus what build_zero_init returns on the subtype isn't directly
usable as ctor of the outer type.


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

* [Bug c++/48035] [4.4/4.5/4.6 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (4 preceding siblings ...)
  2011-03-09 14:04 ` jakub at gcc dot gnu.org
@ 2011-03-11 14:47 ` jakub at gcc dot gnu.org
  2011-03-11 15:44 ` jakub at gcc dot gnu.org
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-11 14:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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

* [Bug c++/48035] [4.4/4.5/4.6 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (5 preceding siblings ...)
  2011-03-11 14:47 ` jakub at gcc dot gnu.org
@ 2011-03-11 15:44 ` jakub at gcc dot gnu.org
  2011-03-11 15:47 ` [Bug c++/48035] [4.4/4.5 " jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-11 15:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-11 15:43:42 UTC ---
Author: jakub
Date: Fri Mar 11 15:43:37 2011
New Revision: 170874

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170874
Log:
    PR c++/48035
    * init.c (build_zero_init_1): Extracted from build_zero_init.
    Add FIELD_SIZE argument, if non-NULL and field bit_position
    as not smaller than that, don't add that field's initializer.
    Pass DECL_SIZE as last argument to build_zero_init_1
    for DECL_FIELD_IS_BASE fields.
    (build_zero_init): Use build_zero_init_1.

    * g++.dg/inherit/virtual8.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/inherit/virtual8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/init.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/48035] [4.4/4.5 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (6 preceding siblings ...)
  2011-03-11 15:44 ` jakub at gcc dot gnu.org
@ 2011-03-11 15:47 ` jakub at gcc dot gnu.org
  2011-04-10 10:49 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-11 15:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.6.0
            Summary|[4.4/4.5/4.6 Regression]    |[4.4/4.5 Regression]
                   |Mismatch on size of class   |Mismatch on size of class
                   |when initializing hierarchy |when initializing hierarchy
                   |involving virtual           |involving virtual
                   |inheritance and empty base  |inheritance and empty base
                   |classes                     |classes
      Known to fail|4.6.0                       |

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-11 15:45:04 UTC ---
Fixed on the trunk so far.


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

* [Bug c++/48035] [4.4/4.5 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (7 preceding siblings ...)
  2011-03-11 15:47 ` [Bug c++/48035] [4.4/4.5 " jakub at gcc dot gnu.org
@ 2011-04-10 10:49 ` rguenth at gcc dot gnu.org
  2011-04-11 21:23 ` tschwinge at gcc dot gnu.org
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-10 10:49 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/48035] [4.4/4.5 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (8 preceding siblings ...)
  2011-04-10 10:49 ` rguenth at gcc dot gnu.org
@ 2011-04-11 21:23 ` tschwinge at gcc dot gnu.org
  2011-04-16  9:58 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2011-04-11 21:23 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tschwinge at gcc dot
                   |                            |gnu.org

--- Comment #7 from Thomas Schwinge <tschwinge at gcc dot gnu.org> 2011-04-11 21:23:27 UTC ---
FWIW, I'm confirming both the bug and the fix in a 4.5-based tree.


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

* [Bug c++/48035] [4.4/4.5 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (9 preceding siblings ...)
  2011-04-11 21:23 ` tschwinge at gcc dot gnu.org
@ 2011-04-16  9:58 ` jakub at gcc dot gnu.org
  2011-04-18 14:04 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-16  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.6                       |4.4.7


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

* [Bug c++/48035] [4.4/4.5 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (10 preceding siblings ...)
  2011-04-16  9:58 ` jakub at gcc dot gnu.org
@ 2011-04-18 14:04 ` rguenth at gcc dot gnu.org
  2011-04-18 14:44 ` [Bug c++/48035] [4.4 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-18 14:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-18 14:02:27 UTC ---
Author: rguenth
Date: Mon Apr 18 14:02:22 2011
New Revision: 172647

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172647
Log:
2011-04-18  Richard Guenther  <rguenther@suse.de>

    Backported from 4.6 branch 
    2011-03-11  Jakub Jelinek  <jakub@redhat.com>

    PR c++/48035
    * init.c (build_zero_init_1): Extracted from build_zero_init.
    Add FIELD_SIZE argument, if non-NULL and field bit_position
    as not smaller than that, don't add that field's initializer.
    Pass DECL_SIZE as last argument to build_zero_init_1
    for DECL_FIELD_IS_BASE fields.
    (build_zero_init): Use build_zero_init_1.

    * g++.dg/inherit/virtual8.C: New test.

    2011-03-05  Zdenek Dvorak  <ook@ucw.cz>

    PR rtl-optimization/47899
    * cfgloopmanip.c (fix_bb_placements): Fix first argument
    to flow_loop_nested_p when moving the loop upward.

    * gcc.dg/pr47899.c: New test.

    2011-03-15  Richard Guenther  <rguenther@suse.de>

    PR middle-end/48031
    * fold-const.c (fold_indirect_ref_1): Do not create new variable-sized
    or variable-indexed array accesses when in gimple form.

Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/cfgloopmanip.c
    branches/gcc-4_5-branch/gcc/cp/ChangeLog
    branches/gcc-4_5-branch/gcc/cp/init.c
    branches/gcc-4_5-branch/gcc/fold-const.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/48035] [4.4 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (11 preceding siblings ...)
  2011-04-18 14:04 ` rguenth at gcc dot gnu.org
@ 2011-04-18 14:44 ` rguenth at gcc dot gnu.org
  2011-09-23 22:02 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-18 14:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-18 14:37:17 UTC ---
Author: rguenth
Date: Mon Apr 18 14:37:08 2011
New Revision: 172652

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172652
Log:
2011-04-18  Richard Guenther  <rguenther@suse.de>

    Backported from 4.6 branch 
    2011-03-11  Jakub Jelinek  <jakub@redhat.com>

    PR c++/48035
    * init.c (build_zero_init_1): Extracted from build_zero_init.
    Add FIELD_SIZE argument, if non-NULL and field bit_position
    as not smaller than that, don't add that field's initializer.
    Pass DECL_SIZE as last argument to build_zero_init_1
    for DECL_FIELD_IS_BASE fields.
    (build_zero_init): Use build_zero_init_1.

    * g++.dg/inherit/virtual8.C: New test.

    2011-03-05  Zdenek Dvorak  <ook@ucw.cz>

    PR rtl-optimization/47899
    * cfgloopmanip.c (fix_bb_placements): Fix first argument
    to flow_loop_nested_p when moving the loop upward.

    * gcc.dg/pr47899.c: New test.

    2011-03-15  Richard Guenther  <rguenther@suse.de>

    PR middle-end/48031
    * fold-const.c (fold_indirect_ref_1): Do not create new variable-sized
    or variable-indexed array accesses when in gimple form.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/inherit/virtual8.C
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/pr47899.c


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

* [Bug c++/48035] [4.4 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (12 preceding siblings ...)
  2011-04-18 14:44 ` [Bug c++/48035] [4.4 " rguenth at gcc dot gnu.org
@ 2011-09-23 22:02 ` paolo.carlini at oracle dot com
  2011-10-05  8:11 ` sezeroz at gmail dot com
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-23 22:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-23 21:57:15 UTC ---
Jakub, shall we close this?


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

* [Bug c++/48035] [4.4 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (13 preceding siblings ...)
  2011-09-23 22:02 ` paolo.carlini at oracle dot com
@ 2011-10-05  8:11 ` sezeroz at gmail dot com
  2011-10-13 18:06 ` jason at gcc dot gnu.org
  2011-10-13 18:07 ` jason at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: sezeroz at gmail dot com @ 2011-10-05  8:11 UTC (permalink / raw)
  To: gcc-bugs

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

Ozkan Sezer <sezeroz at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sezeroz at gmail dot com

--- Comment #11 from Ozkan Sezer <sezeroz at gmail dot com> 2011-10-05 08:10:50 UTC ---
Will the fixes for this PR go into 4.4?


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

* [Bug c++/48035] [4.4 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (14 preceding siblings ...)
  2011-10-05  8:11 ` sezeroz at gmail dot com
@ 2011-10-13 18:06 ` jason at gcc dot gnu.org
  2011-10-13 18:07 ` jason at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: jason at gcc dot gnu.org @ 2011-10-13 18:06 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

--- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> 2011-10-13 18:05:36 UTC ---
Fixed for 4.4.7.


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

* [Bug c++/48035] [4.4 Regression] Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes
  2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
                   ` (15 preceding siblings ...)
  2011-10-13 18:06 ` jason at gcc dot gnu.org
@ 2011-10-13 18:07 ` jason at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: jason at gcc dot gnu.org @ 2011-10-13 18:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Jason Merrill <jason at gcc dot gnu.org> 2011-10-13 18:03:01 UTC ---
Author: jason
Date: Thu Oct 13 18:02:53 2011
New Revision: 179937

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179937
Log:
    PR c++/48035
    * init.c (build_zero_init_1): Extracted from build_zero_init.
    Add FIELD_SIZE argument, if non-NULL and field bit_position
    as not smaller than that, don't add that field's initializer.
    Pass DECL_SIZE as last argument to build_zero_init_1
    for DECL_FIELD_IS_BASE fields.
    (build_zero_init): Use build_zero_init_1.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/inherit/virtual8.C
Modified:
    branches/gcc-4_4-branch/gcc/cp/ChangeLog
    branches/gcc-4_4-branch/gcc/cp/init.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2011-10-13 18:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-08 22:14 [Bug c++/48035] New: Mismatch on size of class when initializing hierarchy involving virtual inheritance and empty base classes scot4spam at yahoo dot com
2011-03-08 22:43 ` [Bug c++/48035] " pinskia at gcc dot gnu.org
2011-03-08 22:46 ` [Bug c++/48035] [4.4/4.5/4.6 Regression] " pinskia at gcc dot gnu.org
2011-03-09 11:45 ` dodji at gcc dot gnu.org
2011-03-09 12:46 ` jakub at gcc dot gnu.org
2011-03-09 14:04 ` jakub at gcc dot gnu.org
2011-03-11 14:47 ` jakub at gcc dot gnu.org
2011-03-11 15:44 ` jakub at gcc dot gnu.org
2011-03-11 15:47 ` [Bug c++/48035] [4.4/4.5 " jakub at gcc dot gnu.org
2011-04-10 10:49 ` rguenth at gcc dot gnu.org
2011-04-11 21:23 ` tschwinge at gcc dot gnu.org
2011-04-16  9:58 ` jakub at gcc dot gnu.org
2011-04-18 14:04 ` rguenth at gcc dot gnu.org
2011-04-18 14:44 ` [Bug c++/48035] [4.4 " rguenth at gcc dot gnu.org
2011-09-23 22:02 ` paolo.carlini at oracle dot com
2011-10-05  8:11 ` sezeroz at gmail dot com
2011-10-13 18:06 ` jason at gcc dot gnu.org
2011-10-13 18:07 ` jason at gcc dot gnu.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).