public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/94968] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
@ 2020-05-06  8:58 anbu1024.me at gmail dot com
  2020-05-06  9:30 ` [Bug c/94968] [10/11 " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: anbu1024.me at gmail dot com @ 2020-05-06  8:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94968

            Bug ID: 94968
           Summary: [10 Regression] internal compiler error: tree check:
                    expected class ‘type’, have ‘exceptional’ (error_mark)
                    in useless_type_conversion_p, at gimple-expr.c:87
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

int foo() { 
        __builtin_speculation_safe_value ( 1 , x );
}

--------------------------------------------------------------------------------

$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--------------------------------------------------------------------------------

$ gcc-10 test.c 
test.c: In function ‘foo’:
test.c:3:41: error: ‘x’ undeclared (first use in this function)
    3 |  __builtin_speculation_safe_value ( 1 , x );
      |                                         ^
test.c:3:41: note: each undeclared identifier is reported only once for each
function it appears in
test.c:3:2: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
    3 |  __builtin_speculation_safe_value ( 1 , x );
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x731f2f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc-10-20200419/gcc/tree.c:9777
0x665cf0 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../gcc-10-20200419/gcc/tree.h:3410
0x665cf0 useless_type_conversion_p(tree_node*, tree_node*)
        ../../gcc-10-20200419/gcc/gimple-expr.c:87
0x8919e4 speculation_safe_value_resolve_params
        ../../gcc-10-20200419/gcc/c-family/c-common.c:6720
0x8919e4 resolve_overloaded_builtin(unsigned int, tree_node*, vec<tree_node*,
va_gc, vl_embed>*)
        ../../gcc-10-20200419/gcc/c-family/c-common.c:7407
0x81a6c9 c_build_function_call_vec(unsigned int, vec<unsigned int, va_heap,
vl_ptr>, tree_node*, vec<tree_node*, va_gc, vl_embed>*, vec<tree_node*, va_gc,
vl_embed>*)
        ../../gcc-10-20200419/gcc/c/c-typeck.c:3199
0x838cde c_parser_postfix_expression_after_primary
        ../../gcc-10-20200419/gcc/c/c-parser.c:10501
0x8307a1 c_parser_postfix_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:10176
0x834ada c_parser_unary_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:8273
0x83632d c_parser_cast_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:8115
0x8365b9 c_parser_binary_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:7918
0x837595 c_parser_conditional_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:7652
0x837bb0 c_parser_expr_no_commas
        ../../gcc-10-20200419/gcc/c/c-parser.c:7569
0x837e11 c_parser_expression
        ../../gcc-10-20200419/gcc/c/c-parser.c:10637
0x8385b7 c_parser_expression_conv
        ../../gcc-10-20200419/gcc/c/c-parser.c:10670
0x82dd0b c_parser_statement_after_labels
        ../../gcc-10-20200419/gcc/c/c-parser.c:6301
0x82ff71 c_parser_compound_statement_nostart
        ../../gcc-10-20200419/gcc/c/c-parser.c:5805
0x84c8c4 c_parser_compound_statement
        ../../gcc-10-20200419/gcc/c/c-parser.c:5617
0x84e381 c_parser_declaration_or_fndef
        ../../gcc-10-20200419/gcc/c/c-parser.c:2505
0x8566e3 c_parser_external_declaration
        ../../gcc-10-20200419/gcc/c/c-parser.c:1745
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

--------------------------------------------------------------------------------

$ gcc-9 --version
gcc (GCC) 9.3.1 20200425
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--------------------------------------------------------------------------------

$ gcc-9 test.c 
test.c: In function ‘foo’:
test.c:3:41: error: ‘x’ undeclared (first use in this function)
    3 |  __builtin_speculation_safe_value ( 1 , x );
      |                                         ^
test.c:3:41: note: each undeclared identifier is reported only once for each
function it appears in
test.c:3:2: error: both arguments must be compatible
    3 |  __builtin_speculation_safe_value ( 1 , x );
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

* [Bug c/94968] [10/11 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
  2020-05-06  8:58 [Bug c/94968] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87 anbu1024.me at gmail dot com
@ 2020-05-06  9:30 ` rguenth at gcc dot gnu.org
  2020-05-06  9:32 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-06  9:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94968

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
   Target Milestone|---                         |10.2

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

* [Bug c/94968] [10/11 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
  2020-05-06  8:58 [Bug c/94968] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87 anbu1024.me at gmail dot com
  2020-05-06  9:30 ` [Bug c/94968] [10/11 " rguenth at gcc dot gnu.org
@ 2020-05-06  9:32 ` jakub at gcc dot gnu.org
  2020-05-06 10:53 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-06  9:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94968

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2020-05-06
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

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

* [Bug c/94968] [10/11 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
  2020-05-06  8:58 [Bug c/94968] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87 anbu1024.me at gmail dot com
  2020-05-06  9:30 ` [Bug c/94968] [10/11 " rguenth at gcc dot gnu.org
  2020-05-06  9:32 ` jakub at gcc dot gnu.org
@ 2020-05-06 10:53 ` jakub at gcc dot gnu.org
  2020-05-07 12:55 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-06 10:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94968

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48464
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48464&action=edit
gcc11-pr94968.patch

Untested fix.

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

* [Bug c/94968] [10/11 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
  2020-05-06  8:58 [Bug c/94968] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87 anbu1024.me at gmail dot com
                   ` (2 preceding siblings ...)
  2020-05-06 10:53 ` jakub at gcc dot gnu.org
@ 2020-05-07 12:55 ` cvs-commit at gcc dot gnu.org
  2020-05-07 13:28 ` cvs-commit at gcc dot gnu.org
  2020-05-07 13:36 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-07 12:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94968

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:9b95bb52b40c05e630278fe5cd61a79a3c4f620a

commit r11-163-g9b95bb52b40c05e630278fe5cd61a79a3c4f620a
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu May 7 14:54:20 2020 +0200

    c-family: Fix error-recovery ICE on __builtin_speculation_safe_value
[PR94968]

    If the second argument of __builtin_speculation_safe_value is
    error_mark_node (or has such a type), we ICE during
    useless_typ_conversion_p.

    202-05-07  Jakub Jelinek  <jakub@redhat.com>

            PR c/94968
            * c-common.c (speculation_safe_value_resolve_params): Return false
if
            error_operand_p (val2).
            (resolve_overloaded_builtin) <case
BUILT_IN_SPECULATION_SAFE_VALUE_N>:
            Remove extraneous semicolon.

            * gcc.dg/pr94968.c: New test.

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

* [Bug c/94968] [10/11 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
  2020-05-06  8:58 [Bug c/94968] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87 anbu1024.me at gmail dot com
                   ` (3 preceding siblings ...)
  2020-05-07 12:55 ` cvs-commit at gcc dot gnu.org
@ 2020-05-07 13:28 ` cvs-commit at gcc dot gnu.org
  2020-05-07 13:36 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-07 13:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94968

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:da91f9d2b6edea15eee052f93976b15e786da536

commit r10-8116-gda91f9d2b6edea15eee052f93976b15e786da536
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu May 7 14:54:20 2020 +0200

    c-family: Fix error-recovery ICE on __builtin_speculation_safe_value
[PR94968]

    If the second argument of __builtin_speculation_safe_value is
    error_mark_node (or has such a type), we ICE during
    useless_typ_conversion_p.

    202-05-07  Jakub Jelinek  <jakub@redhat.com>

            PR c/94968
            * c-common.c (speculation_safe_value_resolve_params): Return false
if
            error_operand_p (val2).
            (resolve_overloaded_builtin) <case
BUILT_IN_SPECULATION_SAFE_VALUE_N>:
            Remove extraneous semicolon.

            * gcc.dg/pr94968.c: New test.

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

* [Bug c/94968] [10/11 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87
  2020-05-06  8:58 [Bug c/94968] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87 anbu1024.me at gmail dot com
                   ` (4 preceding siblings ...)
  2020-05-07 13:28 ` cvs-commit at gcc dot gnu.org
@ 2020-05-07 13:36 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-07 13:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94968

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> ---
Fixed for 10.2+ and 11+.

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

end of thread, other threads:[~2020-05-07 13:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06  8:58 [Bug c/94968] New: [10 Regression] internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:87 anbu1024.me at gmail dot com
2020-05-06  9:30 ` [Bug c/94968] [10/11 " rguenth at gcc dot gnu.org
2020-05-06  9:32 ` jakub at gcc dot gnu.org
2020-05-06 10:53 ` jakub at gcc dot gnu.org
2020-05-07 12:55 ` cvs-commit at gcc dot gnu.org
2020-05-07 13:28 ` cvs-commit at gcc dot gnu.org
2020-05-07 13:36 ` 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).