public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/50009] New: [4.7 Regression] Segmentation fault in tree_nop_conversion
@ 2011-08-07  0:45 d.g.gorbachev at gmail dot com
  2011-08-08  9:58 ` [Bug target/50009] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2011-08-07  0:45 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.7 Regression] Segmentation fault in
                    tree_nop_conversion
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: d.g.gorbachev@gmail.com
            Target: i686-pc-mingw32


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

Testcase:

struct S {
  short a;
  short b[];
} __attribute__((packed));


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

* [Bug target/50009] [4.7 Regression] Segmentation fault in tree_nop_conversion
  2011-08-07  0:45 [Bug c/50009] New: [4.7 Regression] Segmentation fault in tree_nop_conversion d.g.gorbachev at gmail dot com
@ 2011-08-08  9:58 ` rguenth at gcc dot gnu.org
  2011-08-18 10:46 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-08-08  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.08.08 09:57:48
          Component|c                           |target
   Target Milestone|---                         |4.7.0
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-08 09:57:48 UTC ---
It seems that the stor-layout code assumes fields have complete types - they
do not, in case of flexible trailing array members.

  if (targetm.ms_bitfield_layout_p (rli->t))
    {
      /* Here, the alignment of the underlying type of a bitfield can
         affect the alignment of a record; even a zero-sized field
         can do this.  The alignment should be to the alignment of
         the type, except that for zero-size bitfields this only
         applies if there was an immediately prior, nonzero-size
         bitfield.  (That's the way it is, experimentally.) */
      if ((!is_bitfield && !DECL_PACKED (field))
          || (!integer_zerop (DECL_SIZE (field))

now, the STRIP_NOPS in integer_zerop is odd as well.


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

* [Bug target/50009] [4.7 Regression] Segmentation fault in tree_nop_conversion
  2011-08-07  0:45 [Bug c/50009] New: [4.7 Regression] Segmentation fault in tree_nop_conversion d.g.gorbachev at gmail dot com
  2011-08-08  9:58 ` [Bug target/50009] " rguenth at gcc dot gnu.org
@ 2011-08-18 10:46 ` jakub at gcc dot gnu.org
  2011-08-18 14:32 ` jakub at gcc dot gnu.org
  2011-08-18 14:34 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-18 10:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-18 10:24:10 UTC ---
Created attachment 25051
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25051
gcc47-pr50009.patch

Untested fix.


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

* [Bug target/50009] [4.7 Regression] Segmentation fault in tree_nop_conversion
  2011-08-07  0:45 [Bug c/50009] New: [4.7 Regression] Segmentation fault in tree_nop_conversion d.g.gorbachev at gmail dot com
  2011-08-08  9:58 ` [Bug target/50009] " rguenth at gcc dot gnu.org
  2011-08-18 10:46 ` jakub at gcc dot gnu.org
@ 2011-08-18 14:32 ` jakub at gcc dot gnu.org
  2011-08-18 14:34 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-18 14:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-18 14:29:14 UTC ---
Author: jakub
Date: Thu Aug 18 14:29:10 2011
New Revision: 177860

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177860
Log:
    PR target/50009
    * stor-layout.c (update_alignment_for_field): Don't ICE on
    packed flexible array members if ms_bitfield_layout_p.

    * gcc.c-torture/compile/pr50009.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr50009.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/stor-layout.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug target/50009] [4.7 Regression] Segmentation fault in tree_nop_conversion
  2011-08-07  0:45 [Bug c/50009] New: [4.7 Regression] Segmentation fault in tree_nop_conversion d.g.gorbachev at gmail dot com
                   ` (2 preceding siblings ...)
  2011-08-18 14:32 ` jakub at gcc dot gnu.org
@ 2011-08-18 14:34 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-18 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-18 14:31:49 UTC ---
Fixed.


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

end of thread, other threads:[~2011-08-18 14:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-07  0:45 [Bug c/50009] New: [4.7 Regression] Segmentation fault in tree_nop_conversion d.g.gorbachev at gmail dot com
2011-08-08  9:58 ` [Bug target/50009] " rguenth at gcc dot gnu.org
2011-08-18 10:46 ` jakub at gcc dot gnu.org
2011-08-18 14:32 ` jakub at gcc dot gnu.org
2011-08-18 14:34 ` jakub 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).