public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
@ 2021-05-11 16:06 cnsun at uwaterloo dot ca
  2021-05-11 16:10 ` [Bug c/100532] " cnsun at uwaterloo dot ca
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: cnsun at uwaterloo dot ca @ 2021-05-11 16:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100532
           Summary: ICE: tree check: expected class ‘type’, have
                    ‘exceptional’ (error_mark) in
                    useless_type_conversion_p, at gimple-expr.c:259
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

Might be a duplicate of PR 100525.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.FUbEknNORK-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210511 (experimental) [master revision
:7db32cac8:aa891c56f25baac94db004e309d1b6e40b770a95] (GCC)

$ cat mutant.c
typedef __SIZE_TYPE__ size_t;
void *memcpy(void[], const void *, size_t);
c() { memcpy(c, "a", 2); }

$ gcc-trunk  mutant.c
mutant.c:2:18: error: declaration of type name as array of voids
    2 | void *memcpy(void[], const void *, size_t);
      |                  ^
mutant.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    3 | c() { memcpy(c, "a", 2); }
      | ^
mutant.c: In function ‘c’:
mutant.c:3:14: error: type of formal parameter 1 is incomplete
    3 | c() { memcpy(c, "a", 2); }
      |              ^
mutant.c:3:7: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
    3 | c() { memcpy(c, "a", 2); }
      |       ^~~~~~
0x7bce07 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/tree.c:8724
0x6cb4a3 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/tree.h:3479
0x6cb4a3 useless_type_conversion_p(tree_node*, tree_node*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimple-expr.c:259
0xc2fc77 types_compatible_p
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimple-expr.h:67
0xc2fc77 gimplify_addr_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6246
0xc25d93 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14130
0xc34d59 gimplify_call_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:3446
0xc25d73 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14055
0xc28f6a gimplify_stmt(tree_node**, gimple**)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6877
0xc2979e gimplify_bind_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:1421
0xc259d3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14284
0xc28f6a gimplify_stmt(tree_node**, gimple**)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6877
0xc2a563 gimplify_body(tree_node*, bool)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:15328
0xc2a9b1 gimplify_function_tree(tree_node*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:15482
0xa7e707 cgraph_node::analyze()
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/cgraphunit.c:670
0xa81611 analyze_functions
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/cgraphunit.c:1234
0xa820e1 symbol_table::finalize_compilation_unit()
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/cgraphunit.c:2508
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.

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
@ 2021-05-11 16:10 ` cnsun at uwaterloo dot ca
  2021-05-12  9:29 ` marxin at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cnsun at uwaterloo dot ca @ 2021-05-11 16:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Chengnian Sun <cnsun at uwaterloo dot ca> ---
Another duplicate.


$ cat mutant.c
void *memcpy(void[], const void *, __SIZE_TYPE__);
f(x) {
  if (f)
    memcpy(x, x, x);
}

$ gcc-trunk  mutant.c
mutant.c:1:18: error: declaration of type name as array of voids
    1 | void *memcpy(void[], const void *, __SIZE_TYPE__);
      |                  ^
mutant.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | f(x) {
      | ^
mutant.c: In function ‘f’:
mutant.c:2:1: warning: type of ‘x’ defaults to ‘int’ [-Wimplicit-int]
mutant.c:4:12: error: type of formal parameter 1 is incomplete
    4 |     memcpy(x, x, x);
      |            ^
mutant.c:4:15: warning: passing argument 2 of ‘memcpy’ makes pointer from
integer without a cast [-Wint-conversion]
    4 |     memcpy(x, x, x);
      |               ^
      |               |
      |               int
mutant.c:1:22: note: expected ‘const void *’ but argument is of type ‘int’
    1 | void *memcpy(void[], const void *, __SIZE_TYPE__);
      |                      ^~~~~~~~~~~~
mutant.c:4:5: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
    4 |     memcpy(x, x, x);
      |     ^~~~~~
0x7bce07 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/tree.c:8724
0x6cb4a3 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/tree.h:3479
0x6cb4a3 useless_type_conversion_p(tree_node*, tree_node*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimple-expr.c:259
0xc2fc77 types_compatible_p
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimple-expr.h:67
0xc2fc77 gimplify_addr_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6246
0xc25d93 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14130
0xc34d59 gimplify_call_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:3446
0xc25d73 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14055
0xc28f6a gimplify_stmt(tree_node**, gimple**)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6877
0xc2d4cb gimplify_cond_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:4264
0xc25a77 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14040
0xc28f6a gimplify_stmt(tree_node**, gimple**)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6877
0xc2979e gimplify_bind_expr
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:1421
0xc259d3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:14284
0xc28f6a gimplify_stmt(tree_node**, gimple**)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:6877
0xc2a563 gimplify_body(tree_node*, bool)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:15328
0xc2a9b1 gimplify_function_tree(tree_node*)
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/gimplify.c:15482
0xa7e707 cgraph_node::analyze()
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/cgraphunit.c:670
0xa81611 analyze_functions
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/cgraphunit.c:1234
0xa820e1 symbol_table::finalize_compilation_unit()
        /tmp/tmp.FUbEknNORK-gcc-builder/gcc/gcc/cgraphunit.c:2508
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.

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
  2021-05-11 16:10 ` [Bug c/100532] " cnsun at uwaterloo dot ca
@ 2021-05-12  9:29 ` marxin at gcc dot gnu.org
  2021-08-22  4:39 ` [Bug c/100532] [12 Regression] " pinskia at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-05-12  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2021-05-12
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

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

* [Bug c/100532] [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
  2021-05-11 16:10 ` [Bug c/100532] " cnsun at uwaterloo dot ca
  2021-05-12  9:29 ` marxin at gcc dot gnu.org
@ 2021-08-22  4:39 ` pinskia at gcc dot gnu.org
  2021-08-22  4:40 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-22  4:39 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE: tree check: expected   |[12 Regression] ICE: tree
                   |class ‘type’, have          |check: expected class
                   |‘exceptional’ (error_mark)  |‘type’, have ‘exceptional’
                   |in                          |(error_mark) in
                   |useless_type_conversion_p,  |useless_type_conversion_p,
                   |at gimple-expr.c:259        |at gimple-expr.c:259
   Target Milestone|---                         |12.0

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

* [Bug c/100532] [12 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
                   ` (2 preceding siblings ...)
  2021-08-22  4:39 ` [Bug c/100532] [12 Regression] " pinskia at gcc dot gnu.org
@ 2021-08-22  4:40 ` pinskia at gcc dot gnu.org
  2021-08-22 13:51 ` [Bug c/100532] " hjl.tools at gmail dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-22  4:40 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anbu1024.me at gmail dot com

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 101196 has been marked as a duplicate of this bug. ***

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
                   ` (3 preceding siblings ...)
  2021-08-22  4:40 ` pinskia at gcc dot gnu.org
@ 2021-08-22 13:51 ` hjl.tools at gmail dot com
  2022-05-06  8:30 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2021-08-22 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[12 Regression] ICE: tree   |ICE: tree check: expected
                   |check: expected class       |class ‘type’, have
                   |‘type’, have ‘exceptional’  |‘exceptional’ (error_mark)
                   |(error_mark) in             |in
                   |useless_type_conversion_p,  |useless_type_conversion_p,
                   |at gimple-expr.c:259        |at gimple-expr.c:259

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
It isn't a GCC 12 regression. r10-0 has the same ICE. It was hidden on release
branches.

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
                   ` (4 preceding siblings ...)
  2021-08-22 13:51 ` [Bug c/100532] " hjl.tools at gmail dot com
@ 2022-05-06  8:30 ` jakub at gcc dot gnu.org
  2022-11-15 19:45 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-06  8:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.0                        |12.2

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 12.1 is being released, retargeting bugs to GCC 12.2.

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
                   ` (5 preceding siblings ...)
  2022-05-06  8:30 ` jakub at gcc dot gnu.org
@ 2022-11-15 19:45 ` pinskia at gcc dot gnu.org
  2023-04-23  3:01 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-15 19:45 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.3                        |---
           Keywords|                            |ice-checking
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
                   ` (6 preceding siblings ...)
  2022-11-15 19:45 ` pinskia at gcc dot gnu.org
@ 2023-04-23  3:01 ` pinskia at gcc dot gnu.org
  2023-10-18  3:25 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-23  3:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 109597 has been marked as a duplicate of this bug. ***

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
                   ` (7 preceding siblings ...)
  2023-04-23  3:01 ` pinskia at gcc dot gnu.org
@ 2023-10-18  3:25 ` pinskia at gcc dot gnu.org
  2023-10-19  5:30 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-18  3:25 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |141242068 at smail dot nju.edu.cn

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 111855 has been marked as a duplicate of this bug. ***

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
                   ` (8 preceding siblings ...)
  2023-10-18  3:25 ` pinskia at gcc dot gnu.org
@ 2023-10-19  5:30 ` pinskia at gcc dot gnu.org
  2023-10-19 15:39 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-19  5:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Maybe the simple fix:
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index 6e044b4afbc..8f8562936dc 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -3367,7 +3367,7 @@ convert_argument (location_t ploc, tree function, tree
fundecl,
     {
       error_at (ploc, "type of formal parameter %d is incomplete",
                parmnum + 1);
-      return val;
+      return error_mark_node;
     }

   /* Optionally warn about conversions that differ from the default

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
                   ` (9 preceding siblings ...)
  2023-10-19  5:30 ` pinskia at gcc dot gnu.org
@ 2023-10-19 15:39 ` pinskia at gcc dot gnu.org
  2023-10-19 16:51 ` cvs-commit at gcc dot gnu.org
  2023-10-19 16:52 ` pinskia at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-19 15:39 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2023-October
                   |                            |/633610.html

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Patch posted:
https://gcc.gnu.org/pipermail/gcc-patches/2023-October/633610.html

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
                   ` (10 preceding siblings ...)
  2023-10-19 15:39 ` pinskia at gcc dot gnu.org
@ 2023-10-19 16:51 ` cvs-commit at gcc dot gnu.org
  2023-10-19 16:52 ` pinskia at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-10-19 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:

https://gcc.gnu.org/g:2454ba9e2d1ce2d1b9b2b46f6111e022364bf9b5

commit r14-4759-g2454ba9e2d1ce2d1b9b2b46f6111e022364bf9b5
Author: Andrew Pinski <pinskia@gmail.com>
Date:   Thu Oct 19 05:42:02 2023 +0000

    c: Fix ICE when an argument was an error mark [PR100532]

    In the case of convert_argument, we would return the same expression
    back rather than error_mark_node after the error message about
    trying to convert to an incomplete type. This causes issues in
    the gimplfier trying to see if another conversion is needed.

    The code here dates back to before the revision history too so
    it might be the case it never noticed we should return an error_mark_node.

    Bootstrapped and tested on x86_64-linux-gnu with no regressions.

            PR c/100532

    gcc/c/ChangeLog:

            * c-typeck.cc (convert_argument): After erroring out
            about an incomplete type return error_mark_node.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pr100532-1.c: New test.

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

* [Bug c/100532] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259
  2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
                   ` (11 preceding siblings ...)
  2023-10-19 16:51 ` cvs-commit at gcc dot gnu.org
@ 2023-10-19 16:52 ` pinskia at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-19 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |14.0
             Status|ASSIGNED                    |RESOLVED

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-10-19 16:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 16:06 [Bug c/100532] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:259 cnsun at uwaterloo dot ca
2021-05-11 16:10 ` [Bug c/100532] " cnsun at uwaterloo dot ca
2021-05-12  9:29 ` marxin at gcc dot gnu.org
2021-08-22  4:39 ` [Bug c/100532] [12 Regression] " pinskia at gcc dot gnu.org
2021-08-22  4:40 ` pinskia at gcc dot gnu.org
2021-08-22 13:51 ` [Bug c/100532] " hjl.tools at gmail dot com
2022-05-06  8:30 ` jakub at gcc dot gnu.org
2022-11-15 19:45 ` pinskia at gcc dot gnu.org
2023-04-23  3:01 ` pinskia at gcc dot gnu.org
2023-10-18  3:25 ` pinskia at gcc dot gnu.org
2023-10-19  5:30 ` pinskia at gcc dot gnu.org
2023-10-19 15:39 ` pinskia at gcc dot gnu.org
2023-10-19 16:51 ` cvs-commit at gcc dot gnu.org
2023-10-19 16:52 ` pinskia 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).