public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60215] New: [4.9 Regression] ICE with invalid bit-field size
@ 2014-02-15 21:01 reichelt at gcc dot gnu.org
  2014-02-15 21:02 ` [Bug c++/60215] " reichelt at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-15 21:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60215
           Summary: [4.9 Regression] ICE with invalid bit-field size
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following invalid code snippet (compiled with "-std=c++11") triggers an
ICE on trunk:

==================
struct A
{
  void foo();
  int i : foo;
};
==================

bug.cc:4:11: error: width of bit-field 'i' has non-integral type '<unresolved
overloaded function type>'
   int i : foo;
           ^
bug.cc:4:11: internal compiler error: in cxx_eval_constant_expression, at
cp/semantics.c:9679
0x73dfc0 cxx_eval_constant_expression
        ../../gcc/gcc/cp/semantics.c:9679
0x7410d5 cxx_eval_outermost_constant_expr
        ../../gcc/gcc/cp/semantics.c:9807
0x6597ac check_bitfield_decl
        ../../gcc/gcc/cp/class.c:3250
0x6597ac check_field_decls
        ../../gcc/gcc/cp/class.c:3619
0x67002b check_bases_and_members
        ../../gcc/gcc/cp/class.c:5511
0x675221 finish_struct_1(tree_node*)
        ../../gcc/gcc/cp/class.c:6484
0x677574 finish_struct(tree_node*, tree_node*)
        ../../gcc/gcc/cp/class.c:6801
0x6a97ba cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19218
0x6a97ba cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19437
0x6a97ba cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14302
0x6c2ba0 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11547
0x6c9799 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11137
0x6acc63 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11086
0x6d3f12 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10983
0x6d2c08 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10869
0x6d44aa cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6d44aa c_parse_file()
        ../../gcc/gcc/cp/parser.c:31536
0x7f3813 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]


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

* [Bug c++/60215] [4.9 Regression] ICE with invalid bit-field size
  2014-02-15 21:01 [Bug c++/60215] New: [4.9 Regression] ICE with invalid bit-field size reichelt at gcc dot gnu.org
@ 2014-02-15 21:02 ` reichelt at gcc dot gnu.org
  2014-02-17  9:41 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-15 21:02 UTC (permalink / raw)
  To: gcc-bugs

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

Volker Reichelt <reichelt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery,
                   |                            |ice-on-invalid-code
      Known to work|                            |4.7.0, 4.8.0
   Target Milestone|---                         |4.9.0
      Known to fail|                            |4.9.0


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

* [Bug c++/60215] [4.9 Regression] ICE with invalid bit-field size
  2014-02-15 21:01 [Bug c++/60215] New: [4.9 Regression] ICE with invalid bit-field size reichelt at gcc dot gnu.org
  2014-02-15 21:02 ` [Bug c++/60215] " reichelt at gcc dot gnu.org
@ 2014-02-17  9:41 ` jakub at gcc dot gnu.org
  2014-02-17 11:01 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-02-17  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-17
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |paolo at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r205449.


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

* [Bug c++/60215] [4.9 Regression] ICE with invalid bit-field size
  2014-02-15 21:01 [Bug c++/60215] New: [4.9 Regression] ICE with invalid bit-field size reichelt at gcc dot gnu.org
  2014-02-15 21:02 ` [Bug c++/60215] " reichelt at gcc dot gnu.org
  2014-02-17  9:41 ` jakub at gcc dot gnu.org
@ 2014-02-17 11:01 ` paolo.carlini at oracle dot com
  2014-02-18 23:12 ` paolo at gcc dot gnu.org
  2014-02-18 23:12 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-02-17 11:01 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

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

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Evidently, in case of error recovery we can get here:

9672     case COMPONENT_REF:
9673       if (is_overloaded_fn (t))
9674         {
9675           /* We can only get here in checking mode via 
9676              build_non_dependent_expr,  because any expression that
9677              calls or takes the address of the function will have
9678              pulled a FUNCTION_DECL out of the COMPONENT_REF.  */
9679           gcc_checking_assert (allow_non_constant);
9680           *non_constant_p = true;
9681           return t;
9682         }

with allow_non_constant == false. Jason suggested the comment (and the assert
;) as part of the fix for 58647, thus I would like to hear from him... Shall we
maybe || errorcount ? Seems safe for 4.9.0.


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

* [Bug c++/60215] [4.9 Regression] ICE with invalid bit-field size
  2014-02-15 21:01 [Bug c++/60215] New: [4.9 Regression] ICE with invalid bit-field size reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-02-17 11:01 ` paolo.carlini at oracle dot com
@ 2014-02-18 23:12 ` paolo at gcc dot gnu.org
  2014-02-18 23:12 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-02-18 23:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Tue Feb 18 23:11:26 2014
New Revision: 207858

URL: http://gcc.gnu.org/viewcvs?rev=207858&root=gcc&view=rev
Log:
/cp
2014-02-18  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/60225
    * semantics.c (ensure_literal_type_for_constexpr_object): Use
    strip_array_types.

/testsuite
2014-02-18  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/60225
    * g++.dg/cpp0x/constexpr-ice10.C: New.

/cp
2014-02-18  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/60215
    * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
    During error recovery allow_non_constant may be false.

/testsuite
2014-02-18  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/60215
    * g++.dg/cpp0x/pr60215.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-ice10.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr60215.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/60215] [4.9 Regression] ICE with invalid bit-field size
  2014-02-15 21:01 [Bug c++/60215] New: [4.9 Regression] ICE with invalid bit-field size reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-02-18 23:12 ` paolo at gcc dot gnu.org
@ 2014-02-18 23:12 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-02-18 23:12 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

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

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed.


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

end of thread, other threads:[~2014-02-18 23:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15 21:01 [Bug c++/60215] New: [4.9 Regression] ICE with invalid bit-field size reichelt at gcc dot gnu.org
2014-02-15 21:02 ` [Bug c++/60215] " reichelt at gcc dot gnu.org
2014-02-17  9:41 ` jakub at gcc dot gnu.org
2014-02-17 11:01 ` paolo.carlini at oracle dot com
2014-02-18 23:12 ` paolo at gcc dot gnu.org
2014-02-18 23:12 ` paolo.carlini at oracle dot com

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).