public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field
@ 2012-01-16 14:29 ogoffart at kde dot org
  2012-01-16 14:58 ` [Bug c++/51868] [4.7 Regression] " redi at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ogoffart at kde dot org @ 2012-01-16 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51868
           Summary: Crash when generating the move constructor for a class
                    with a bit field
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ogoffart@kde.org


Created attachment 26341
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26341
testcase

See the attached example.
Compilation flag used: -std=c++0x

gcc crashes with:

bitfield.cc: In constructor ‘B::B(B&&)’:
bitfield.cc:7:8: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Reproduced with GCC 4.6.2 from archlinux binary package, and gcc 4.7 from
trunk.
Used to work with GCC 4.6.1


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

* [Bug c++/51868] [4.7 Regression] Crash when generating the move constructor for a class with a bit field
  2012-01-16 14:29 [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field ogoffart at kde dot org
@ 2012-01-16 14:58 ` redi at gcc dot gnu.org
  2012-01-16 15:21 ` redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2012-01-16 14:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-16
      Known to work|                            |4.6.2
            Summary|Crash when generating the   |[4.7 Regression] Crash when
                   |move constructor for a      |generating the move
                   |class with a bit field      |constructor for a class
                   |                            |with a bit field
     Ever Confirmed|0                           |1
      Known to fail|                            |4.7.0

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-16 14:36:58 UTC ---
Confirmed with 4.7, it works with 4.6.1 and 4.6.2

IIRC Arch Linux lies about the version, what they call 4.6.2 is the unreleased
4.6.3, so please provide the output of gcc -v as requested by the URL you
quoted.


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

* [Bug c++/51868] [4.7 Regression] Crash when generating the move constructor for a class with a bit field
  2012-01-16 14:29 [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field ogoffart at kde dot org
  2012-01-16 14:58 ` [Bug c++/51868] [4.7 Regression] " redi at gcc dot gnu.org
@ 2012-01-16 15:21 ` redi at gcc dot gnu.org
  2012-01-16 18:12 ` jason at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2012-01-16 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-16 14:45:33 UTC ---
on trunk:

Program received signal SIGSEGV, Segmentation fault.
fold_convert_loc (loc=0, type=0x2aaaaac5da80, arg=0x0) at
/home/redi/src/gcc/gcc-4.7-20120114/gcc/fold-const.c:1856
1856      tree orig = TREE_TYPE (arg);


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

* [Bug c++/51868] [4.7 Regression] Crash when generating the move constructor for a class with a bit field
  2012-01-16 14:29 [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field ogoffart at kde dot org
  2012-01-16 14:58 ` [Bug c++/51868] [4.7 Regression] " redi at gcc dot gnu.org
  2012-01-16 15:21 ` redi at gcc dot gnu.org
@ 2012-01-16 18:12 ` jason at gcc dot gnu.org
  2012-01-16 18:55 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-16 18:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jason at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/51868] [4.7 Regression] Crash when generating the move constructor for a class with a bit field
  2012-01-16 14:29 [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field ogoffart at kde dot org
                   ` (2 preceding siblings ...)
  2012-01-16 18:12 ` jason at gcc dot gnu.org
@ 2012-01-16 18:55 ` jason at gcc dot gnu.org
  2012-01-16 18:56 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-16 18:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-16 18:40:33 UTC ---
Author: jason
Date: Mon Jan 16 18:40:26 2012
New Revision: 183218

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183218
Log:
    PR c++/51868
    * typeck.c (build_static_cast_1): Handle bit-fields properly.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/rv-bitfield.C
    trunk/gcc/testsuite/g++.dg/cpp0x/rv-bitfield2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/51868] [4.7 Regression] Crash when generating the move constructor for a class with a bit field
  2012-01-16 14:29 [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field ogoffart at kde dot org
                   ` (3 preceding siblings ...)
  2012-01-16 18:55 ` jason at gcc dot gnu.org
@ 2012-01-16 18:56 ` jason at gcc dot gnu.org
  2012-01-16 19:09 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-16 18:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-16 18:54:47 UTC ---
Fixed.


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

* [Bug c++/51868] [4.7 Regression] Crash when generating the move constructor for a class with a bit field
  2012-01-16 14:29 [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field ogoffart at kde dot org
                   ` (4 preceding siblings ...)
  2012-01-16 18:56 ` jason at gcc dot gnu.org
@ 2012-01-16 19:09 ` redi at gcc dot gnu.org
  2012-01-16 21:33 ` [Bug c++/51868] [4.6 " jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2012-01-16 19:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-16 18:57:59 UTC ---
Jason, does it happen with 4.6.3 too?  I couldn't test that


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

* [Bug c++/51868] [4.6 Regression] Crash when generating the move constructor for a class with a bit field
  2012-01-16 14:29 [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field ogoffart at kde dot org
                   ` (5 preceding siblings ...)
  2012-01-16 19:09 ` redi at gcc dot gnu.org
@ 2012-01-16 21:33 ` jason at gcc dot gnu.org
  2012-01-16 21:37 ` jason at gcc dot gnu.org
  2012-01-16 21:54 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-16 21:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |ASSIGNED
         Resolution|FIXED                       |
            Summary|[4.7 Regression] Crash when |[4.6 Regression] Crash when
                   |generating the move         |generating the move
                   |constructor for a class     |constructor for a class
                   |with a bit field            |with a bit field

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-16 21:13:38 UTC ---
Yes, it also breaks with the current 4.6 branch; I'll apply the fix there as
well.


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

* [Bug c++/51868] [4.6 Regression] Crash when generating the move constructor for a class with a bit field
  2012-01-16 14:29 [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field ogoffart at kde dot org
                   ` (6 preceding siblings ...)
  2012-01-16 21:33 ` [Bug c++/51868] [4.6 " jason at gcc dot gnu.org
@ 2012-01-16 21:37 ` jason at gcc dot gnu.org
  2012-01-16 21:54 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-16 21:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-16 21:34:30 UTC ---
Author: jason
Date: Mon Jan 16 21:34:26 2012
New Revision: 183223

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183223
Log:
    PR c++/51868
    * typeck.c (build_static_cast_1): Handle bit-fields properly.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/rv-bitfield.C
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/rv-bitfield2.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/typeck.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/51868] [4.6 Regression] Crash when generating the move constructor for a class with a bit field
  2012-01-16 14:29 [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field ogoffart at kde dot org
                   ` (7 preceding siblings ...)
  2012-01-16 21:37 ` jason at gcc dot gnu.org
@ 2012-01-16 21:54 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-16 21:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.7.0                       |4.6.3

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-16 21:37:29 UTC ---
Fixed for 4.6.3 as well.


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

end of thread, other threads:[~2012-01-16 21:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-16 14:29 [Bug c++/51868] New: Crash when generating the move constructor for a class with a bit field ogoffart at kde dot org
2012-01-16 14:58 ` [Bug c++/51868] [4.7 Regression] " redi at gcc dot gnu.org
2012-01-16 15:21 ` redi at gcc dot gnu.org
2012-01-16 18:12 ` jason at gcc dot gnu.org
2012-01-16 18:55 ` jason at gcc dot gnu.org
2012-01-16 18:56 ` jason at gcc dot gnu.org
2012-01-16 19:09 ` redi at gcc dot gnu.org
2012-01-16 21:33 ` [Bug c++/51868] [4.6 " jason at gcc dot gnu.org
2012-01-16 21:37 ` jason at gcc dot gnu.org
2012-01-16 21:54 ` 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).