public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc
@ 2023-04-25  5:54 anbu1024.me at gmail dot com
  2023-04-25  6:38 ` [Bug c/109619] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: anbu1024.me at gmail dot com @ 2023-04-25  5:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109619
           Summary: ICE: tree check: expected class ‘type’, have
                    ‘exceptional’ (error_mark) in fold_const_call_1, at
                    fold-const-call.cc
           Product: gcc
           Version: 13.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: ---

$ gcc --version
gcc (GCC) 13.0.1 20230219 (experimental)
Copyright (C) 2023 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.

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

$ cat 4.c 

void foo(void *a1, const void *a2, long unsigned int a3)
{
  void *x = __builtin_memcpy(a1, a2, a3);
  int *a3 = __builtin_memmove(a1, a2, a3);
}

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

$ gcc 4.c 
4.c: In function ‘foo’:
4.c:5:8: error: ‘a3’ redeclared as different kind of symbol
    5 |   int *a3 = __builtin_memmove(a1, a2, a3);
      |        ^~
4.c:2:54: note: previous definition of ‘a3’ with type ‘long unsigned int’
    2 | void foo(void *a1, const void *a2, long unsigned int a3)
      |                                    ~~~~~~~~~~~~~~~~~~^~
4.c:4:13: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc:1800
    4 |   void *x = __builtin_memcpy(a1, a2, a3);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x840637 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc-13-20230219/gcc/tree.cc:8959
0x776846 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../gcc-13-20230219/gcc/tree.h:3653
0x776846 fold_const_call_1
        ../../gcc-13-20230219/gcc/fold-const-call.cc:1800
0x776846 fold_const_call(combined_fn, tree_node*, tree_node*, tree_node*,
tree_node*)
        ../../gcc-13-20230219/gcc/fold-const-call.cc:1903
0xa66a98 fold_builtin_3
        ../../gcc-13-20230219/gcc/builtins.cc:9851
0xa66a98 fold_builtin_n
        ../../gcc-13-20230219/gcc/builtins.cc:9932
0xc97037 gimplify_call_expr
        ../../gcc-13-20230219/gcc/gimplify.cc:3684
0xc88500 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-13-20230219/gcc/gimplify.cc:16333
0xc9a465 gimplify_modify_expr
        ../../gcc-13-20230219/gcc/gimplify.cc:6153
0xc879e1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-13-20230219/gcc/gimplify.cc:16361
0xc8a316 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc97d34 gimplify_and_add(tree_node*, gimple**)
        ../../gcc-13-20230219/gcc/gimplify.cc:492
0xc97d34 gimplify_decl_expr
        ../../gcc-13-20230219/gcc/gimplify.cc:1936
0xc88132 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-13-20230219/gcc/gimplify.cc:16558
0xc8a316 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc88c38 gimplify_statement_list
        ../../gcc-13-20230219/gcc/gimplify.cc:2019
0xc88c38 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-13-20230219/gcc/gimplify.cc:16806
0xc8a316 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc8aa47 gimplify_bind_expr
        ../../gcc-13-20230219/gcc/gimplify.cc:1430
0xc87c95 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-13-20230219/gcc/gimplify.cc:16562
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug c/109619] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc
  2023-04-25  5:54 [Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc anbu1024.me at gmail dot com
@ 2023-04-25  6:38 ` rguenth at gcc dot gnu.org
  2023-04-27  6:58 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-25  6:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-04-25
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

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

* [Bug c/109619] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc
  2023-04-25  5:54 [Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc anbu1024.me at gmail dot com
  2023-04-25  6:38 ` [Bug c/109619] " rguenth at gcc dot gnu.org
@ 2023-04-27  6:58 ` marxin at gcc dot gnu.org
  2024-03-08  4:04 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-04-27  6:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |sayle at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-3278-g823685221de986.

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

* [Bug c/109619] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc
  2023-04-25  5:54 [Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc anbu1024.me at gmail dot com
  2023-04-25  6:38 ` [Bug c/109619] " rguenth at gcc dot gnu.org
  2023-04-27  6:58 ` marxin at gcc dot gnu.org
@ 2024-03-08  4:04 ` pinskia at gcc dot gnu.org
  2024-03-21 22:19 ` [Bug c/109619] [12/13/14 Regression] " pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-08  4:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
in fold_builtin_[123], replace `TREE_CODE (*) == ERROR_MARK` with
`error_operand_p (*)` will fix this.

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

* [Bug c/109619] [12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc
  2023-04-25  5:54 [Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc anbu1024.me at gmail dot com
                   ` (2 preceding siblings ...)
  2024-03-08  4:04 ` pinskia at gcc dot gnu.org
@ 2024-03-21 22:19 ` pinskia at gcc dot gnu.org
  2024-03-21 22:19 ` [Bug c/109619] [12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc after r12-3278-g823685221de986 pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-21 22:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE: tree check: expected   |[12/13/14 Regression] ICE:
                   |class ‘type’, have          |tree check: expected class
                   |‘exceptional’ (error_mark)  |‘type’, have ‘exceptional’
                   |in fold_const_call_1, at    |(error_mark) in
                   |fold-const-call.cc          |fold_const_call_1, at
                   |                            |fold-const-call.cc
   Target Milestone|---                         |12.4

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

* [Bug c/109619] [12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc after r12-3278-g823685221de986.
  2023-04-25  5:54 [Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc anbu1024.me at gmail dot com
                   ` (3 preceding siblings ...)
  2024-03-21 22:19 ` [Bug c/109619] [12/13/14 Regression] " pinskia at gcc dot gnu.org
@ 2024-03-21 22:19 ` pinskia at gcc dot gnu.org
  2024-03-22  4:19 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-21 22:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[12/13/14 Regression] ICE:  |[12/13/14 Regression] ICE:
                   |tree check: expected class  |tree check: expected class
                   |‘type’, have ‘exceptional’  |‘type’, have ‘exceptional’
                   |(error_mark) in             |(error_mark) in
                   |fold_const_call_1, at       |fold_const_call_1, at
                   |fold-const-call.cc          |fold-const-call.cc after
                   |                            |r12-3278-g823685221de986.
           Priority|P3                          |P2

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

* [Bug c/109619] [12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc after r12-3278-g823685221de986.
  2023-04-25  5:54 [Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc anbu1024.me at gmail dot com
                   ` (4 preceding siblings ...)
  2024-03-21 22:19 ` [Bug c/109619] [12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc after r12-3278-g823685221de986 pinskia at gcc dot gnu.org
@ 2024-03-22  4:19 ` pinskia at gcc dot gnu.org
  2024-03-22  9:20 ` cvs-commit at gcc dot gnu.org
  2024-03-22  9:20 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-22  4:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Patch posted:
https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648202.html

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

* [Bug c/109619] [12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc after r12-3278-g823685221de986.
  2023-04-25  5:54 [Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc anbu1024.me at gmail dot com
                   ` (5 preceding siblings ...)
  2024-03-22  4:19 ` pinskia at gcc dot gnu.org
@ 2024-03-22  9:20 ` cvs-commit at gcc dot gnu.org
  2024-03-22  9:20 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-22  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from GCC 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:dbe9062ce070c861cd3fa6435187618413b1b3d1

commit r14-9613-gdbe9062ce070c861cd3fa6435187618413b1b3d1
Author: Andrew Pinski <quic_apinski@quicinc.com>
Date:   Thu Mar 21 16:29:20 2024 -0700

    Another ICE after conflicting types of redeclaration [PR109619]

    This another one of these ICE after error issues with the
    gimplifier and a fallout from r12-3278-g823685221de986af.
    This case happens when we are trying to fold memcpy/memmove.
    There is already code to try to catch ERROR_MARKs as arguments
    to the builtins so just need to change them to use error_operand_p
    which checks the type of the expression to see if it was an error mark
    also.

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

    gcc/ChangeLog:

            PR c/109619
            * builtins.cc (fold_builtin_1): Use error_operand_p
            instead of checking against ERROR_MARK.
            (fold_builtin_2): Likewise.
            (fold_builtin_3): Likewise.

    gcc/testsuite/ChangeLog:

            PR c/109619
            * gcc.dg/redecl-26.c: New test.

    Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>

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

* [Bug c/109619] [12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc after r12-3278-g823685221de986.
  2023-04-25  5:54 [Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc anbu1024.me at gmail dot com
                   ` (6 preceding siblings ...)
  2024-03-22  9:20 ` cvs-commit at gcc dot gnu.org
@ 2024-03-22  9:20 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-22  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2024-03-22  9:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-25  5:54 [Bug c/109619] New: ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc anbu1024.me at gmail dot com
2023-04-25  6:38 ` [Bug c/109619] " rguenth at gcc dot gnu.org
2023-04-27  6:58 ` marxin at gcc dot gnu.org
2024-03-08  4:04 ` pinskia at gcc dot gnu.org
2024-03-21 22:19 ` [Bug c/109619] [12/13/14 Regression] " pinskia at gcc dot gnu.org
2024-03-21 22:19 ` [Bug c/109619] [12/13/14 Regression] ICE: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in fold_const_call_1, at fold-const-call.cc after r12-3278-g823685221de986 pinskia at gcc dot gnu.org
2024-03-22  4:19 ` pinskia at gcc dot gnu.org
2024-03-22  9:20 ` cvs-commit at gcc dot gnu.org
2024-03-22  9:20 ` 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).