public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107320] New: ICE in fold_binary_loc, at fold-const.cc:11329
@ 2022-10-19 17:33 gscfq@t-online.de
  2022-10-19 17:36 ` [Bug c/107320] " mpolacek at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gscfq@t-online.de @ 2022-10-19 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107320
           Summary: ICE in fold_binary_loc, at fold-const.cc:11329
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.c
unsigned long long int c = 0ULL;
void f ()
{
  if ( isascii(c) )
    return;
}


$ gcc-13-20221016 -c z1.c
z1.c: In function 'f':
z1.c:4:8: warning: implicit declaration of function 'isascii'
[-Wimplicit-function-declaration]
    4 |   if ( isascii(c) )
      |        ^~~~~~~
z1.c:4:16: warning: 'isascii' argument 1 type is 'long long unsigned int' where
'int' is expected in a call to built-in function declared without prototype
[-Wbuiltin-declaration-mismatch]
    4 |   if ( isascii(c) )
      |                ^
<built-in>: note: built-in 'isascii' declared here
z1.c:4:3: internal compiler error: in fold_binary_loc, at fold-const.cc:11329
    4 |   if ( isascii(c) )
      |   ^~
0x9cf3c2 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fold-const.cc:11329
0x9cf62a fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fold-const.cc:13802
0x8689d3 fold_builtin_isascii
        ../../gcc/builtins.cc:8818
0x8689d3 fold_builtin_1
        ../../gcc/builtins.cc:9667
0x86b6e7 fold_builtin_n
        ../../gcc/builtins.cc:9901
0x9e01fa fold(tree_node*)
        ../../gcc/fold-const.cc:13404
0x7dab2f c_fully_fold_internal
        ../../gcc/c/c-fold.cc:244
0x7dc049 c_fully_fold(tree_node*, bool, bool*, bool)
        ../../gcc/c/c-fold.cc:125
0x79ccfd build_binary_op(unsigned int, tree_code, tree_node*, tree_node*, bool)
        ../../gcc/c/c-typeck.cc:12878
0x78b1c2 c_objc_common_truthvalue_conversion(unsigned int, tree_node*)
        ../../gcc/c/c-typeck.cc:13054
0x7b911e c_parser_condition
        ../../gcc/c/c-parser.cc:6500
0x7b91c7 c_parser_paren_condition
        ../../gcc/c/c-parser.cc:6519
0x7ce098 c_parser_if_statement
        ../../gcc/c/c-parser.cc:6698
0x7ce098 c_parser_statement_after_labels
        ../../gcc/c/c-parser.cc:6312
0x7cf9ca c_parser_compound_statement_nostart
        ../../gcc/c/c-parser.cc:5991
0x7d0243 c_parser_compound_statement
        ../../gcc/c/c-parser.cc:5800
0x7d1c64 c_parser_declaration_or_fndef
        ../../gcc/c/c-parser.cc:2651
0x7d944f c_parser_external_declaration
        ../../gcc/c/c-parser.cc:1833
0x7d9d7d c_parser_translation_unit
        ../../gcc/c/c-parser.cc:1695
0x7d9d7d c_parse_file()
        ../../gcc/c/c-parser.cc:24213

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

* [Bug c/107320] ICE in fold_binary_loc, at fold-const.cc:11329
  2022-10-19 17:33 [Bug c/107320] New: ICE in fold_binary_loc, at fold-const.cc:11329 gscfq@t-online.de
@ 2022-10-19 17:36 ` mpolacek at gcc dot gnu.org
  2022-10-20  9:18 ` [Bug middle-end/107320] " rguenth at gcc dot gnu.org
  2022-10-20 15:41 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-10-19 17:36 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-10-19
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org

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

* [Bug middle-end/107320] ICE in fold_binary_loc, at fold-const.cc:11329
  2022-10-19 17:33 [Bug c/107320] New: ICE in fold_binary_loc, at fold-const.cc:11329 gscfq@t-online.de
  2022-10-19 17:36 ` [Bug c/107320] " mpolacek at gcc dot gnu.org
@ 2022-10-20  9:18 ` rguenth at gcc dot gnu.org
  2022-10-20 15:41 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-20  9:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed, the reason is that isascii folding does

8818          arg = fold_build2 (BIT_AND_EXPR, integer_type_node, arg,
8819                             build_int_cst (integer_type_node,
8820                                            ~ (unsigned HOST_WIDE_INT)
0x7f));

with invalid types (because of the invalid input types).

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

* [Bug middle-end/107320] ICE in fold_binary_loc, at fold-const.cc:11329
  2022-10-19 17:33 [Bug c/107320] New: ICE in fold_binary_loc, at fold-const.cc:11329 gscfq@t-online.de
  2022-10-19 17:36 ` [Bug c/107320] " mpolacek at gcc dot gnu.org
  2022-10-20  9:18 ` [Bug middle-end/107320] " rguenth at gcc dot gnu.org
@ 2022-10-20 15:41 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-20 15:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The problem here is the same problem as the underlying problem with PR 102760
so marking as a dup.

*** This bug has been marked as a duplicate of bug 102760 ***

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

end of thread, other threads:[~2022-10-20 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 17:33 [Bug c/107320] New: ICE in fold_binary_loc, at fold-const.cc:11329 gscfq@t-online.de
2022-10-19 17:36 ` [Bug c/107320] " mpolacek at gcc dot gnu.org
2022-10-20  9:18 ` [Bug middle-end/107320] " rguenth at gcc dot gnu.org
2022-10-20 15:41 ` 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).