public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52977] New: internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option
@ 2012-04-13 16:08 ai.azuma at gmail dot com
  2012-04-14  6:25 ` [Bug c/52977] " markus at trippelsdorf dot de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ai.azuma at gmail dot com @ 2012-04-13 16:08 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52977
           Summary: internal compiler error: Segmentation fault with `-x
                    c-header' or `-x cxx-header' option
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ai.azuma@gmail.com


Created attachment 27152
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27152
Output of -v option and preprocessed file

The following code causes an ICE with GCC 4.8.0 20120408 (experimental) and `-x
c-header' or `-x cxx-header' option.


////////////////////////////////////////
typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
__inline __m64 __attribute__((__gnu_inline__, __always_inline__,
__artificial__))
_mm_setzero_si64() { return (__m64)0LL; }
////////////////////////////////////////


N.B. As far as I can confirm, this ICE is not reproduced with GCC 4.6.3, GCC
4.7.0 and GCC 4.8.0 20120311. This reproducer originally comes from a
Boost.Math 1.49.0 source file.


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

* [Bug c/52977] internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option
  2012-04-13 16:08 [Bug c/52977] New: internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option ai.azuma at gmail dot com
@ 2012-04-14  6:25 ` markus at trippelsdorf dot de
  2012-04-16  8:48 ` [Bug c/52977] [4.8 Regression] " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: markus at trippelsdorf dot de @ 2012-04-14  6:25 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus at trippelsdorf dot
                   |                            |de, rguenth at gcc dot
                   |                            |gnu.org

--- Comment #1 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-04-14 06:24:34 UTC ---
Started with rev.185458.

 % cat test.i
fn1 () 
{
  (int __attribute__((__vector_size__(8)))) 0L;
}

or

 % cat test.ii
typedef int __m64 __attribute__ ((__vector_size__ (8)));
__m64 a = (__m64) 0LL;


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

* [Bug c/52977] [4.8 Regression] internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option
  2012-04-13 16:08 [Bug c/52977] New: internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option ai.azuma at gmail dot com
  2012-04-14  6:25 ` [Bug c/52977] " markus at trippelsdorf dot de
@ 2012-04-16  8:48 ` rguenth at gcc dot gnu.org
  2012-04-16 10:15 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-16  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-04-16
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.8.0
            Summary|internal compiler error:    |[4.8 Regression] internal
                   |Segmentation fault with `-x |compiler error:
                   |c-header' or `-x            |Segmentation fault with `-x
                   |cxx-header' option          |c-header' or `-x
                   |                            |cxx-header' option
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-16 08:48:13 UTC ---
Mine then.


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

* [Bug c/52977] [4.8 Regression] internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option
  2012-04-13 16:08 [Bug c/52977] New: internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option ai.azuma at gmail dot com
  2012-04-14  6:25 ` [Bug c/52977] " markus at trippelsdorf dot de
  2012-04-16  8:48 ` [Bug c/52977] [4.8 Regression] " rguenth at gcc dot gnu.org
@ 2012-04-16 10:15 ` rguenth at gcc dot gnu.org
  2012-04-16 13:22 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-16 10:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-16 10:15:35 UTC ---
ugh...

#0  0x00000000004d7255 in gt_pch_p_14lang_tree_node (this_obj=0x7ffff5bf64c0, 
    x_p=0x7ffff5bf64c0, op=0x8b1a27 <relocate_ptrs>, cookie=0x7fffffffdb20)
    at ./gt-c-decl.h:1448

        case TS_VECTOR:
          if ((void *)(x) == this_obj)
            op (&((*x).generic.vector.typed.type), cookie);
          {
            size_t i0;
            size_t l0 = (size_t)(TYPE_VECTOR_SUBPARTS (TREE_TYPE
((tree)&((*x).generic.vector))));
            for (i0 = 0; i0 != l0; i0++) {
              if ((void *)(x) == this_obj)
                op (&((*x).generic.vector.elts[i0]), cookie);
            }
          }
          break;

so we relocate TREE_TYPE before accessing it to find the number of elements.

Other than trying to teach gengtype to compute all required lengths before
changing pointers I only see the less efficient solution of repeating the
element count in-line :/


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

* [Bug c/52977] [4.8 Regression] internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option
  2012-04-13 16:08 [Bug c/52977] New: internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option ai.azuma at gmail dot com
                   ` (2 preceding siblings ...)
  2012-04-16 10:15 ` rguenth at gcc dot gnu.org
@ 2012-04-16 13:22 ` rguenth at gcc dot gnu.org
  2012-04-17 14:42 ` rguenth at gcc dot gnu.org
  2012-04-19 13:33 ` matz at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-16 13:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-16 13:21:37 UTC ---
Author: rguenth
Date: Mon Apr 16 13:21:30 2012
New Revision: 186494

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

    PR middle-end/52977
    * tree.h (VECTOR_CST_NELTS): Adjust.
    (struct tree_vector): Add explicit length field.
    (make_vector_stat): Declare.
    (make_vector): Define.
    * tree.c (make_vector_stat): New function.
    (build_vector_stat): Use it.
    * tree-streamer-in.c (streamer_alloc_tree): Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-streamer-in.c
    trunk/gcc/tree.c
    trunk/gcc/tree.h


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

* [Bug c/52977] [4.8 Regression] internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option
  2012-04-13 16:08 [Bug c/52977] New: internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option ai.azuma at gmail dot com
                   ` (3 preceding siblings ...)
  2012-04-16 13:22 ` rguenth at gcc dot gnu.org
@ 2012-04-17 14:42 ` rguenth at gcc dot gnu.org
  2012-04-19 13:33 ` matz at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-17 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-17 14:41:33 UTC ---
Fixed.


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

* [Bug c/52977] [4.8 Regression] internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option
  2012-04-13 16:08 [Bug c/52977] New: internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option ai.azuma at gmail dot com
                   ` (4 preceding siblings ...)
  2012-04-17 14:42 ` rguenth at gcc dot gnu.org
@ 2012-04-19 13:33 ` matz at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: matz at gcc dot gnu.org @ 2012-04-19 13:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Michael Matz <matz at gcc dot gnu.org> 2012-04-19 13:29:34 UTC ---
Author: matz
Date: Thu Apr 19 13:29:29 2012
New Revision: 186593

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186593
Log:
    PR middle-end/52977
    * tree.h (VECTOR_CST_NELTS): Use part number of types again.
    (struct tree_vector): Adjust GTY length.
    * tree.c (make_vector_stat): Don't set VECTOR_CST_NELTS.

    * gengtype.c (struct walk_type_data): Add in_record_p and loopcounter
    members.
    (walk_type, <TYPE_POINTER, TYPE_ARRAY>): Handle case where our
    caller emitted the length calulation already.
    (walk_type, <TYPE_UNION, TYPE_STRUCT>): Emit length calculations

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gengtype.c
    trunk/gcc/tree.c
    trunk/gcc/tree.h


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

end of thread, other threads:[~2012-04-19 13:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-13 16:08 [Bug c/52977] New: internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option ai.azuma at gmail dot com
2012-04-14  6:25 ` [Bug c/52977] " markus at trippelsdorf dot de
2012-04-16  8:48 ` [Bug c/52977] [4.8 Regression] " rguenth at gcc dot gnu.org
2012-04-16 10:15 ` rguenth at gcc dot gnu.org
2012-04-16 13:22 ` rguenth at gcc dot gnu.org
2012-04-17 14:42 ` rguenth at gcc dot gnu.org
2012-04-19 13:33 ` matz 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).