public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56241] New: ICE in toplev.c:332 on invalid
@ 2013-02-07 15:16 ppluzhnikov at google dot com
  2013-02-07 15:26 ` [Bug c++/56241] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2013-02-07 15:16 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56241
           Summary: ICE in toplev.c:332 on invalid
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ppluzhnikov@google.com


This is a result of test reduction gone bad. The test is invalid, but shouldn't
crash the compiler.

struct pair {
  constexpr pair (const) :
  };
template < 0 >
make_pair () {
}
pair prefix[] = { 0, make_pair }

Using g++ (GCC) 4.8.0 20130205 (experimental):

g++ -c -std=c++11 t.ii
t.ii:2:19: error: ISO C++ forbids declaration of ‘parameter’ with no type
[-fpermissive]
   constexpr pair (const) :
                   ^
t.ii: In constructor ‘constexpr pair::pair(int)’:
t.ii:2:26: error: expected identifier at end of input
   constexpr pair (const) :
                          ^
t.ii:2:26: error: expected ‘{’ at end of input
t.ii: At global scope:
t.ii:4:12: error: expected identifier before numeric constant
 template < 0 >
            ^
t.ii:4:12: error: expected ‘>’ before numeric constant
t.ii:5:12: error: ISO C++ forbids declaration of ‘make_pair’ with no type
[-fpermissive]
 make_pair () {
            ^
t.ii:7:32: error: conversion from ‘<unresolved overloaded function type>’ to
non-scalar type ‘pair’ requested
 pair prefix[] = { 0, make_pair }
                                ^
t.ii:7:32: internal compiler error: Segmentation fault
0xa7fd6f crash_signal
    ../../gcc/toplev.c:332
0xc69563 non_type_check
    ../../gcc/tree.h:3847
0xc69563 build_constructor(tree_node*, vec<constructor_elt_d, va_gc,
vl_embed>*)
    ../../gcc/tree.c:1422
...


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

* [Bug c++/56241] [4.6/4.7/4.8 Regression] ICE in toplev.c:332 on invalid
  2013-02-07 15:16 [Bug c++/56241] New: ICE in toplev.c:332 on invalid ppluzhnikov at google dot com
@ 2013-02-07 15:26 ` jakub at gcc dot gnu.org
  2013-02-07 16:26 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-07 15:26 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |error-recovery
   Last reconfirmed|                            |2013-02-07
                 CC|                            |jakub at gcc dot gnu.org
     Ever Confirmed|0                           |1
            Summary|ICE in toplev.c:332 on      |[4.6/4.7/4.8 Regression]
                   |invalid                     |ICE in toplev.c:332 on
                   |                            |invalid
   Target Milestone|---                         |4.6.4

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-07 15:25:48 UTC ---
Usually delta reduction test scripts and similar should be verifying that the
expected error occurs (expected many times) and no further errors are
introduced during the reduction.

Anyway, this started to ICE with:
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166167


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

* [Bug c++/56241] [4.6/4.7/4.8 Regression] ICE in toplev.c:332 on invalid
  2013-02-07 15:16 [Bug c++/56241] New: ICE in toplev.c:332 on invalid ppluzhnikov at google dot com
  2013-02-07 15:26 ` [Bug c++/56241] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
@ 2013-02-07 16:26 ` jakub at gcc dot gnu.org
  2013-02-07 17:34 ` jason at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-07 16:26 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-07 16:25:21 UTC ---
Created attachment 29386
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29386
gcc48-pr56241.patch

Fixed thusly, build_constructor doesn't like elts with NULL values, such elts
shouldn't be added at all.

I wonder about several other places in init.c where I believe NULL elt->value
could be added:
          ce.value = build_zero_init_1 (TREE_TYPE (type),
                                         /*nelts=*/NULL_TREE,
                                         static_storage_p, NULL_TREE);
          v->quick_push (ce);
in build_zero_init_1 (perhaps vec_alloc should be moved right before the
quick_push and both calls guarded with ce.value != NULL condition), and
          ce.value = build_value_init (TREE_TYPE (type), complain);
          v->quick_push (ce);
in build_value_init_noctor (likewise).


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

* [Bug c++/56241] [4.6/4.7/4.8 Regression] ICE in toplev.c:332 on invalid
  2013-02-07 15:16 [Bug c++/56241] New: ICE in toplev.c:332 on invalid ppluzhnikov at google dot com
  2013-02-07 15:26 ` [Bug c++/56241] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
  2013-02-07 16:26 ` jakub at gcc dot gnu.org
@ 2013-02-07 17:34 ` jason at gcc dot gnu.org
  2013-02-07 17:39 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2013-02-07 17:34 UTC (permalink / raw)
  To: gcc-bugs


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

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

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


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

* [Bug c++/56241] [4.6/4.7/4.8 Regression] ICE in toplev.c:332 on invalid
  2013-02-07 15:16 [Bug c++/56241] New: ICE in toplev.c:332 on invalid ppluzhnikov at google dot com
                   ` (2 preceding siblings ...)
  2013-02-07 17:34 ` jason at gcc dot gnu.org
@ 2013-02-07 17:39 ` jason at gcc dot gnu.org
  2013-02-07 18:11 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2013-02-07 17:39 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2013-02-07 17:38:58 UTC ---
Oops, didn't notice you had attached a patch until after I hit save.

(In reply to comment #2)
> Created attachment 29386 [details]
> gcc48-pr56241.patch

This is OK.


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

* [Bug c++/56241] [4.6/4.7/4.8 Regression] ICE in toplev.c:332 on invalid
  2013-02-07 15:16 [Bug c++/56241] New: ICE in toplev.c:332 on invalid ppluzhnikov at google dot com
                   ` (3 preceding siblings ...)
  2013-02-07 17:39 ` jason at gcc dot gnu.org
@ 2013-02-07 18:11 ` jakub at gcc dot gnu.org
  2013-02-07 21:30 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-07 18:11 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-07 18:09:29 UTC ---
Created attachment 29388
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29388
gcc48-pr56241.patch

Patch with also the two other spots changed.


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

* [Bug c++/56241] [4.6/4.7/4.8 Regression] ICE in toplev.c:332 on invalid
  2013-02-07 15:16 [Bug c++/56241] New: ICE in toplev.c:332 on invalid ppluzhnikov at google dot com
                   ` (4 preceding siblings ...)
  2013-02-07 18:11 ` jakub at gcc dot gnu.org
@ 2013-02-07 21:30 ` jakub at gcc dot gnu.org
  2013-02-07 22:03 ` [Bug c++/56241] [4.6/4.7 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-07 21:30 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-07 21:28:27 UTC ---
Author: jakub
Date: Thu Feb  7 21:27:55 2013
New Revision: 195866

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195866
Log:
    PR c++/56241
    * init.c (build_vec_init): Don't append NULL values into new_vec.
    (build_zero_init_1): Don't push anything into v if recursive call
    returned NULL_TREE.
    (build_value_init_noctor): Don't push anything into v if
    build_value_init call returned NULL_TREE.

    * g++.dg/parse/crash61.C: New test.

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


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

* [Bug c++/56241] [4.6/4.7 Regression] ICE in toplev.c:332 on invalid
  2013-02-07 15:16 [Bug c++/56241] New: ICE in toplev.c:332 on invalid ppluzhnikov at google dot com
                   ` (5 preceding siblings ...)
  2013-02-07 21:30 ` jakub at gcc dot gnu.org
@ 2013-02-07 22:03 ` jakub at gcc dot gnu.org
  2013-02-19 17:25 ` jakub at gcc dot gnu.org
  2013-02-19 17:41 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-07 22:03 UTC (permalink / raw)
  To: gcc-bugs


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

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                     |
            Summary|[4.6/4.7/4.8 Regression]    |[4.6/4.7 Regression] ICE in
                   |ICE in toplev.c:332 on      |toplev.c:332 on invalid
                   |invalid                     |

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-07 22:02:48 UTC ---
Fixed for 4.8+ so far.


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

* [Bug c++/56241] [4.6/4.7 Regression] ICE in toplev.c:332 on invalid
  2013-02-07 15:16 [Bug c++/56241] New: ICE in toplev.c:332 on invalid ppluzhnikov at google dot com
                   ` (6 preceding siblings ...)
  2013-02-07 22:03 ` [Bug c++/56241] [4.6/4.7 " jakub at gcc dot gnu.org
@ 2013-02-19 17:25 ` jakub at gcc dot gnu.org
  2013-02-19 17:41 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-19 17:25 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-19 17:24:48 UTC ---
Author: jakub
Date: Tue Feb 19 17:24:37 2013
New Revision: 196146

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196146
Log:
    Backported from mainline
    2013-02-07  Jakub Jelinek  <jakub@redhat.com>

    PR c++/56241
    * init.c (build_vec_init): Don't append NULL values into new_vec.
    (build_zero_init_1): Don't push anything into v if recursive call
    returned NULL_TREE.
    (build_value_init_noctor): Don't push anything into v if
    build_value_init call returned NULL_TREE.

    * g++.dg/parse/crash61.C: New test.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/parse/crash61.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/init.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/56241] [4.6/4.7 Regression] ICE in toplev.c:332 on invalid
  2013-02-07 15:16 [Bug c++/56241] New: ICE in toplev.c:332 on invalid ppluzhnikov at google dot com
                   ` (7 preceding siblings ...)
  2013-02-19 17:25 ` jakub at gcc dot gnu.org
@ 2013-02-19 17:41 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-19 17:41 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-19 17:41:11 UTC ---
Fixed for 4.7.3+, error-recovery, so not fixing on 4.6 branch.


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

end of thread, other threads:[~2013-02-19 17:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-07 15:16 [Bug c++/56241] New: ICE in toplev.c:332 on invalid ppluzhnikov at google dot com
2013-02-07 15:26 ` [Bug c++/56241] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
2013-02-07 16:26 ` jakub at gcc dot gnu.org
2013-02-07 17:34 ` jason at gcc dot gnu.org
2013-02-07 17:39 ` jason at gcc dot gnu.org
2013-02-07 18:11 ` jakub at gcc dot gnu.org
2013-02-07 21:30 ` jakub at gcc dot gnu.org
2013-02-07 22:03 ` [Bug c++/56241] [4.6/4.7 " jakub at gcc dot gnu.org
2013-02-19 17:25 ` jakub at gcc dot gnu.org
2013-02-19 17:41 ` 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).