public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/46977] New: [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650)
@ 2010-12-16  2:01 zsojka at seznam dot cz
  2010-12-16 12:55 ` [Bug c++/46977] " hjl.tools at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: zsojka at seznam dot cz @ 2010-12-16  2:01 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.6 Regression] [C++0x] ICE: SIGSEGV in
                    htab_find_slot_with_hash (hashtab.c:650)
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz


------- testcase.C --------
template < typename > void
foo ()
{
  ({int i;}), 0;
}
---------------------------

Compiler output:
$ gcc -std=gnu++0x testcase.C
==24355== Invalid read of size 8
==24355==    at 0x11EE1E7: htab_find_slot_with_hash (hashtab.c:650)
==24355==    by 0x540147: register_local_specialization (pt.c:1679)
==24355==    by 0x56ACB0: tsubst_decl (pt.c:10050)
==24355==    by 0x5632F7: tsubst (pt.c:10371)
==24355==    by 0x55358B: tsubst_expr (pt.c:11992)
==24355==    by 0x5534F8: tsubst_expr (pt.c:12120)
==24355==    by 0x55DEEA: tsubst_copy_and_build (pt.c:13266)
==24355==    by 0x55EA64: tsubst_copy_and_build (pt.c:12782)
==24355==    by 0x5623E4: fold_non_dependent_expr_sfinae (pt.c:5168)
==24355==    by 0x4FFCB8: null_ptr_cst_p (call.c:518)
==24355==    by 0x54AA0D: build_non_dependent_expr (pt.c:18721)
==24355==    by 0x62D7A0: finish_expr_stmt (semantics.c:633)
==24355==  Address 0x20 is not stack'd, malloc'd or (recently) free'd
==24355== 
testcase.C: In function 'void foo()':
testcase.C:4:9: 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.


GDB:
Program received signal SIGSEGV, Segmentation fault.
htab_find_slot_with_hash (htab=0x0, element=0x7ffff7eea1e0, hash=4278047804,
insert=INSERT)
    at /mnt/svn/gcc-trunk/libiberty/hashtab.c:650
650       size = htab_size (htab);
(gdb) bt
#0  htab_find_slot_with_hash (htab=0x0, element=0x7ffff7eea1e0,
hash=4278047804, insert=INSERT)
    at /mnt/svn/gcc-trunk/libiberty/hashtab.c:650
#1  0x0000000000540148 in register_local_specialization (spec=0x7ffff7eea280,
tmpl=0x7ffff7eea1e0)
    at /mnt/svn/gcc-trunk/gcc/cp/pt.c:1679
#2  0x000000000056acb1 in tsubst_decl (t=0x7ffff7eea1e0, args=0x0, complain=1)
at /mnt/svn/gcc-trunk/gcc/cp/pt.c:10050
#3  0x00000000005632f8 in tsubst (t=0x7ffff7eea1e0, args=0x0, complain=1,
in_decl=0x0)
    at /mnt/svn/gcc-trunk/gcc/cp/pt.c:10371
#4  0x000000000055358c in tsubst_expr (t=<value optimized out>, args=0x0,
complain=1, in_decl=0x0, 
    integral_constant_expression_p=1 '\001') at
/mnt/svn/gcc-trunk/gcc/cp/pt.c:11992
#5  0x00000000005534f9 in tsubst_expr (t=0x7ffff5d04800, args=0x0, complain=1,
in_decl=0x0, 
    integral_constant_expression_p=1 '\001') at
/mnt/svn/gcc-trunk/gcc/cp/pt.c:12120
#6  0x000000000055deeb in tsubst_copy_and_build (t=0x7ffff7ecb990, args=0x0,
complain=1, in_decl=0x0, 
    function_p=<value optimized out>, integral_constant_expression_p=<value
optimized out>)
    at /mnt/svn/gcc-trunk/gcc/cp/pt.c:13266
#7  0x000000000055ea65 in tsubst_copy_and_build (t=0x7ffff7ff90a8, args=0x0,
complain=1, in_decl=0x0, 
    function_p=<value optimized out>, integral_constant_expression_p=1 '\001')
at /mnt/svn/gcc-trunk/gcc/cp/pt.c:12782
#8  0x00000000005623e5 in fold_non_dependent_expr_sfinae (expr=0x7ffff7ff90a8,
complain=<value optimized out>)
    at /mnt/svn/gcc-trunk/gcc/cp/pt.c:5168
#9  0x00000000004ffcb9 in null_ptr_cst_p (t=<value optimized out>) at
/mnt/svn/gcc-trunk/gcc/cp/call.c:518
#10 0x000000000054aa0e in build_non_dependent_expr (expr=0x7ffff7ff90a8) at
/mnt/svn/gcc-trunk/gcc/cp/pt.c:18721
#11 0x000000000062d7a1 in finish_expr_stmt (expr=0x7ffff7ff90a8) at
/mnt/svn/gcc-trunk/gcc/cp/semantics.c:633
#12 0x00000000005cc470 in cp_parser_statement (parser=0x7ffff5d27000,
in_statement_expr=0x0, 
    in_compound=<value optimized out>, if_p=<value optimized out>) at
/mnt/svn/gcc-trunk/gcc/cp/parser.c:8130
#13 0x00000000005cd7b6 in cp_parser_statement_seq_opt (parser=0x7ffff5d27000,
in_statement_expr=0x0)
    at /mnt/svn/gcc-trunk/gcc/cp/parser.c:8379
#14 0x00000000005cd8ec in cp_parser_compound_statement (parser=0x7ffff5d27000,
in_statement_expr=0x0, 
    in_try=<value optimized out>) at /mnt/svn/gcc-trunk/gcc/cp/parser.c:8333
#15 0x00000000005e2abc in cp_parser_function_body (parser=0x7ffff5d27000) at
/mnt/svn/gcc-trunk/gcc/cp/parser.c:16320
#16 cp_parser_ctor_initializer_opt_and_function_body (parser=0x7ffff5d27000) at
/mnt/svn/gcc-trunk/gcc/cp/parser.c:16357
#17 0x00000000005e3302 in cp_parser_function_definition_after_declarator
(parser=0x7ffff5d27000, inline_p=0 '\000')
    at /mnt/svn/gcc-trunk/gcc/cp/parser.c:19749
#18 0x00000000005e4aec in
cp_parser_function_definition_from_specifiers_and_declarator
(parser=0x7ffff5d27000, 
    decl_specifiers=0x7fffffffd880, checks=0x0, function_definition_allowed_p=1
'\001', member_p=0 '\000', 
    declares_class_or_enum=0, function_definition_p=0x7fffffffd8ef "\001") at
/mnt/svn/gcc-trunk/gcc/cp/parser.c:19678
#19 cp_parser_init_declarator (parser=0x7ffff5d27000,
decl_specifiers=0x7fffffffd880, checks=0x0, 
    function_definition_allowed_p=1 '\001', member_p=0 '\000',
declares_class_or_enum=0, 
    function_definition_p=0x7fffffffd8ef "\001") at
/mnt/svn/gcc-trunk/gcc/cp/parser.c:14467
#20 0x00000000005e9b5c in cp_parser_single_declaration (parser=0x7ffff5d27000,
checks=0x0, member_p=0 '\000', 
    explicit_specialization_p=0 '\000', friend_p=0x7fffffffd94f "") at
/mnt/svn/gcc-trunk/gcc/cp/parser.c:20003
#21 0x00000000005e9e85 in cp_parser_template_declaration_after_export
(parser=0x7ffff5d27000, member_p=0 '\000')
    at /mnt/svn/gcc-trunk/gcc/cp/parser.c:19853
#22 0x00000000005eebba in cp_parser_declaration (parser=0x7ffff5d27000) at
/mnt/svn/gcc-trunk/gcc/cp/parser.c:9408
#23 cp_parser_declaration (parser=0x7ffff5d27000) at
/mnt/svn/gcc-trunk/gcc/cp/parser.c:9359
#24 0x00000000005ed26a in cp_parser_declaration_seq_opt (parser=0x7ffff5d27000)
at /mnt/svn/gcc-trunk/gcc/cp/parser.c:9338
#25 0x00000000005eef55 in cp_parser_translation_unit () at
/mnt/svn/gcc-trunk/gcc/cp/parser.c:3455
#26 c_parse_file () at /mnt/svn/gcc-trunk/gcc/cp/parser.c:25147
#27 0x00000000006c3185 in c_common_parse_file () at
/mnt/svn/gcc-trunk/gcc/c-family/c-opts.c:1071
#28 0x0000000000a1fe08 in compile_file (argc=14, argv=0x7fffffffdba8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:579
#29 do_compile (argc=14, argv=0x7fffffffdba8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:1874
#30 toplev_main (argc=14, argv=0x7fffffffdba8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:1937
#31 0x00007ffff6586bbd in __libc_start_main () from /lib/libc.so.6
#32 0x00000000004fd929 in _start ()

Tested revisions:
r167809 - crash
r167723 - crash
r165699 - OK
4.5 r166509 - OK


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

* [Bug c++/46977] [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650)
  2010-12-16  2:01 [Bug c++/46977] New: [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650) zsojka at seznam dot cz
@ 2010-12-16 12:55 ` hjl.tools at gmail dot com
  2010-12-16 15:24 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2010-12-16 12:55 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.12.16 12:55:07
                 CC|                            |jason at redhat dot com
     Ever Confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2010-12-16 12:55:07 UTC ---
It is caused by revision 166167:

http://gcc.gnu.org/ml/gcc-cvs/2010-11/msg00053.html


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

* [Bug c++/46977] [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650)
  2010-12-16  2:01 [Bug c++/46977] New: [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650) zsojka at seznam dot cz
  2010-12-16 12:55 ` [Bug c++/46977] " hjl.tools at gmail dot com
@ 2010-12-16 15:24 ` rguenth at gcc dot gnu.org
  2011-01-03 21:07 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-12-16 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0


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

* [Bug c++/46977] [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650)
  2010-12-16  2:01 [Bug c++/46977] New: [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650) zsojka at seznam dot cz
  2010-12-16 12:55 ` [Bug c++/46977] " hjl.tools at gmail dot com
  2010-12-16 15:24 ` rguenth at gcc dot gnu.org
@ 2011-01-03 21:07 ` rguenth at gcc dot gnu.org
  2011-01-14 23:01 ` aoliva at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-03 21:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

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


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

* [Bug c++/46977] [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650)
  2010-12-16  2:01 [Bug c++/46977] New: [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650) zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2011-01-03 21:07 ` rguenth at gcc dot gnu.org
@ 2011-01-14 23:01 ` aoliva at gcc dot gnu.org
  2011-01-14 23:55 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: aoliva at gcc dot gnu.org @ 2011-01-14 23:01 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

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

--- Comment #2 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2011-01-14 22:30:38 UTC ---
Mine


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

* [Bug c++/46977] [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650)
  2010-12-16  2:01 [Bug c++/46977] New: [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650) zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2011-01-14 23:01 ` aoliva at gcc dot gnu.org
@ 2011-01-14 23:55 ` jason at gcc dot gnu.org
  2011-01-15 17:55 ` aoliva at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-01-14 23:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-01-14 23:54:10 UTC ---
I'm actually testing a patch for this now.


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

* [Bug c++/46977] [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650)
  2010-12-16  2:01 [Bug c++/46977] New: [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650) zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2011-01-14 23:55 ` jason at gcc dot gnu.org
@ 2011-01-15 17:55 ` aoliva at gcc dot gnu.org
  2011-01-21 17:58 ` jason at gcc dot gnu.org
  2011-01-21 19:35 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: aoliva at gcc dot gnu.org @ 2011-01-15 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|aoliva at gcc dot gnu.org   |jason at gcc dot gnu.org

--- Comment #4 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2011-01-15 17:20:12 UTC ---
Yours, then ;-)


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

* [Bug c++/46977] [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650)
  2010-12-16  2:01 [Bug c++/46977] New: [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650) zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2011-01-15 17:55 ` aoliva at gcc dot gnu.org
@ 2011-01-21 17:58 ` jason at gcc dot gnu.org
  2011-01-21 19:35 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-01-21 17:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-01-21 17:38:06 UTC ---
Author: jason
Date: Fri Jan 21 17:38:02 2011
New Revision: 169096

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169096
Log:
    PR c++/46977
    * semantics.c (potential_constant_expression_1): Split out from
    potential_constant_expression.  Add want_rval parm.  Handle
    template expression forms.  Don't enforce restriction on address
    of automatic variable here.  Add a couple of diagnostics that
    had been missing.
    (require_potential_constant_expression): New entry point.
    (build_data_member_initialization, register_constexpr_fundef): Adjust.
    (maybe_constant_value): Check potential_constant_expression.
    * pt.c (fold_non_dependent_expr_sfinae): Likewise.
    * tree.c (build_vec_init_expr): Adjust.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-stmtexpr.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/46977] [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650)
  2010-12-16  2:01 [Bug c++/46977] New: [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650) zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2011-01-21 17:58 ` jason at gcc dot gnu.org
@ 2011-01-21 19:35 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-01-21 19:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-01-21 19:07:33 UTC ---
Fixed.


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

end of thread, other threads:[~2011-01-21 19:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-16  2:01 [Bug c++/46977] New: [4.6 Regression] [C++0x] ICE: SIGSEGV in htab_find_slot_with_hash (hashtab.c:650) zsojka at seznam dot cz
2010-12-16 12:55 ` [Bug c++/46977] " hjl.tools at gmail dot com
2010-12-16 15:24 ` rguenth at gcc dot gnu.org
2011-01-03 21:07 ` rguenth at gcc dot gnu.org
2011-01-14 23:01 ` aoliva at gcc dot gnu.org
2011-01-14 23:55 ` jason at gcc dot gnu.org
2011-01-15 17:55 ` aoliva at gcc dot gnu.org
2011-01-21 17:58 ` jason at gcc dot gnu.org
2011-01-21 19:35 ` 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).