public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/102760] New: ICE: in decompose, at wide-int.h:984
@ 2021-10-15  2:50 cnsun at uwaterloo dot ca
  2021-10-15  3:12 ` [Bug c/102760] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: cnsun at uwaterloo dot ca @ 2021-10-15  2:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102760
           Summary: ICE: in decompose, at wide-int.h:984
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ 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.gzh6IUhxke-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 20211014 (experimental) [master -gee9fa8a57] (GCC)

$ cat mutant.c
int isascii(enum mm2);
f1(char *type) { isascii(*type); }

$ gcc-trunk -w mutant.c
mutant.c: In function ‘f1’:
mutant.c:2:26: error: type of formal parameter 1 is incomplete
    2 | f1(char *type) { isascii(*type); }
      |                          ^~~~~
mutant.c:2:18: internal compiler error: in decompose, at wide-int.h:984
    2 | f1(char *type) { isascii(*type); }
      |                  ^~~~~~~~~~~~~~
0x84c5a6 wi::int_traits<generic_wide_int<wide_int_ref_storage<false, false> >
>::decompose(long*, unsigned int, generic_wide_int<wide_int_ref_storage<false,
false> > const&)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/wide-int.h:984
0x87be6e wi::int_traits<generic_wide_int<wide_int_ref_storage<false, false> >
>::decompose(long*, unsigned int, generic_wide_int<wide_int_ref_storage<false,
false> > const&)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/tree.h:3612
0x87be6e wide_int_ref_storage<false,
false>::wide_int_ref_storage<generic_wide_int<wide_int_ref_storage<false,
false> > >(generic_wide_int<wide_int_ref_storage<false, false> > const&,
unsigned int)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/wide-int.h:1034
0x87be6e generic_wide_int<wide_int_ref_storage<false, false>
>::generic_wide_int<generic_wide_int<wide_int_ref_storage<false, false> >
>(generic_wide_int<wide_int_ref_storage<false, false> > const&, unsigned int)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/wide-int.h:790
0x87be6e wi::binary_traits<generic_wide_int<wide_int_storage>,
generic_wide_int<wide_int_ref_storage<false, false> >,
wi::int_traits<generic_wide_int<wide_int_storage> >::precision_type,
wi::int_traits<generic_wide_int<wide_int_ref_storage<false, false> >
>::precision_type>::result_type
wi::bit_and_not<generic_wide_int<wide_int_storage>,
generic_wide_int<wide_int_ref_storage<false, false> >
>(generic_wide_int<wide_int_storage> const&,
generic_wide_int<wide_int_ref_storage<false, false> > const&)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/wide-int.h:2343
0x87be6e gimple_simplify_BIT_AND_EXPR
       
/tmp/tmp.gzh6IUhxke-gcc-builder/gcc-build-trunk/gcc/gimple-match.c:124016
0x15a7906 gimple_simplify
       
/tmp/tmp.gzh6IUhxke-gcc-builder/gcc-build-trunk/gcc/gimple-match.c:142649
0x15a930c gimple_resimplify2
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimple-match-head.c:320
0x15d451a gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*))
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimple-match-head.c:959
0xc68926 fold_stmt_1
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimple-fold.c:6212
0xca9b40 gimplify_modify_expr
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimplify.c:6129
0xc9c7d3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimplify.c:14584
0xca04da gimplify_stmt(tree_node**, gimple**)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimplify.c:7018
0xca26c6 gimplify_and_add(tree_node*, gimple**)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimplify.c:494
0xca26c6 internal_get_tmp_var
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimplify.c:647
0xc9bdf7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimplify.c:15587
0xc9c67a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimplify.c:15350
0xca04da gimplify_stmt(tree_node**, gimple**)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimplify.c:7018
0xca0d0e gimplify_bind_expr
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimplify.c:1426
0xc9d00c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/gimplify.c:14785
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] 10+ messages in thread

* [Bug c/102760] ICE: in decompose, at wide-int.h:984
  2021-10-15  2:50 [Bug c/102760] New: ICE: in decompose, at wide-int.h:984 cnsun at uwaterloo dot ca
@ 2021-10-15  3:12 ` pinskia at gcc dot gnu.org
  2021-10-15  8:26 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-15  3:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
           Keywords|                            |ice-checking
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-10-15
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There is a types which are not the same issue.

(gdb) p debug_tree(*expr_p)
 <init_expr 0x7ffff737de88
    type <integer_type 0x7ffff725f5e8 int public SI
        size <integer_cst 0x7ffff7244f78 constant 32>
        unit-size <integer_cst 0x7ffff7244f90 constant 4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff725f5e8 precision:32 min <integer_cst 0x7ffff7244f30 -2147483648> max
<integer_cst 0x7ffff7244f48 2147483647>
        pointer_to_this <pointer_type 0x7ffff7267a80>>
    side-effects
    arg:0 <ssa_name 0x7ffff724fe10 type <integer_type 0x7ffff725f5e8 int>

        def_stmt _2 = _1 & -128;
        version:2>
    arg:1 <bit_and_expr 0x7ffff737de60 type <integer_type 0x7ffff725f5e8 int>

        arg:0 <ssa_name 0x7ffff724fdc8 type <integer_type 0x7ffff725f3f0 char>

            def_stmt _1 = *type;
            version:1>
        arg:1 <integer_cst 0x7ffff7263420 constant -128>>
    t.c:3:18 start: t.c:3:18 finish: t.c:3:31>

This shows up in GCC 11 (with checking enabled).

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

* [Bug c/102760] ICE: in decompose, at wide-int.h:984
  2021-10-15  2:50 [Bug c/102760] New: ICE: in decompose, at wide-int.h:984 cnsun at uwaterloo dot ca
  2021-10-15  3:12 ` [Bug c/102760] " pinskia at gcc dot gnu.org
@ 2021-10-15  8:26 ` marxin at gcc dot gnu.org
  2021-10-15  8:46 ` glisse at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-15  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Likely triggered with r7-821-gc7986356a1ca8e8e.

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

* [Bug c/102760] ICE: in decompose, at wide-int.h:984
  2021-10-15  2:50 [Bug c/102760] New: ICE: in decompose, at wide-int.h:984 cnsun at uwaterloo dot ca
  2021-10-15  3:12 ` [Bug c/102760] " pinskia at gcc dot gnu.org
  2021-10-15  8:26 ` marxin at gcc dot gnu.org
@ 2021-10-15  8:46 ` glisse at gcc dot gnu.org
  2021-10-15 21:21 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: glisse at gcc dot gnu.org @ 2021-10-15  8:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #2)
> Likely triggered with r7-821-gc7986356a1ca8e8e.

>From Andrew's comment, it looks like the bug is before that transformation,
since it receives a bit_and_expr of type int with an argument of type char, no?

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

* [Bug c/102760] ICE: in decompose, at wide-int.h:984
  2021-10-15  2:50 [Bug c/102760] New: ICE: in decompose, at wide-int.h:984 cnsun at uwaterloo dot ca
                   ` (2 preceding siblings ...)
  2021-10-15  8:46 ` glisse at gcc dot gnu.org
@ 2021-10-15 21:21 ` pinskia at gcc dot gnu.org
  2022-10-20 15:41 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-15 21:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #3)
> (In reply to Martin Liška from comment #2)
> > Likely triggered with r7-821-gc7986356a1ca8e8e.
> 
> From Andrew's comment, it looks like the bug is before that transformation,
> since it receives a bit_and_expr of type int with an argument of type char,
> no?

Correct the bug was latent before that commit and I had already figured that
commit had exposed it but I did not want to report though.

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

* [Bug c/102760] ICE: in decompose, at wide-int.h:984
  2021-10-15  2:50 [Bug c/102760] New: ICE: in decompose, at wide-int.h:984 cnsun at uwaterloo dot ca
                   ` (3 preceding siblings ...)
  2021-10-15 21:21 ` pinskia at gcc dot gnu.org
@ 2022-10-20 15:41 ` pinskia at gcc dot gnu.org
  2023-01-25 18:21 ` dcb314 at hotmail dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ 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=102760

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gscfq@t-online.de

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

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

* [Bug c/102760] ICE: in decompose, at wide-int.h:984
  2021-10-15  2:50 [Bug c/102760] New: ICE: in decompose, at wide-int.h:984 cnsun at uwaterloo dot ca
                   ` (4 preceding siblings ...)
  2022-10-20 15:41 ` pinskia at gcc dot gnu.org
@ 2023-01-25 18:21 ` dcb314 at hotmail dot com
  2023-01-25 18:23 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dcb314 at hotmail dot com @ 2023-01-25 18:21 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
I see very similar for this legal C code:

int li_4, li_5, us_8;
unsigned char func_7_ptr_13, func_7_uc_14;
void func_7_ptr_18() {
  if (li_5) {
    for (;;)
      ;
    short s_15;
    for (; func_7_uc_14;) {
      us_8 = 7;
      for (; us_8; us_8 += 1)
      lblD2AF1FAB:
        if (us_8)
          li_4 = 1;
      func_7_uc_14 += func_7_ptr_18;
      if (func_7_ptr_13 & 1 && (func_7_uc_14 &= func_7_ptr_13))
        s_15 %= func_7_uc_10li_19(s_15);
    }
  }
  goto lblD2AF1FAB;
}

when compiled as follows:

$ ~/gcc/results//bin/gcc -c -O2 -Wall bug876.c 
bug876.c: In function ‘func_7_ptr_18’:
bug876.c:14:20: warning: assignment to ‘unsigned char’ from ‘void (*)()’ makes
integer from pointer without a cast [-Wint-conversion]
   14 |       func_7_uc_14 += func_7_ptr_18;
      |                    ^~
bug876.c:16:17: warning: implicit declaration of function ‘func_7_uc_10li_19’
[-Wimplicit-function-declaration]
   16 |         s_15 %= func_7_uc_10li_19(s_15);
      |                 ^~~~~~~~~~~~~~~~~
during GIMPLE pass: uninit
bug876.c:3:6: internal compiler error: in decompose, at wide-int.h:984
    3 | void func_7_ptr_18() {

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

* [Bug c/102760] ICE: in decompose, at wide-int.h:984
  2021-10-15  2:50 [Bug c/102760] New: ICE: in decompose, at wide-int.h:984 cnsun at uwaterloo dot ca
                   ` (5 preceding siblings ...)
  2023-01-25 18:21 ` dcb314 at hotmail dot com
@ 2023-01-25 18:23 ` pinskia at gcc dot gnu.org
  2023-01-25 18:29 ` dcb314 at hotmail dot com
  2024-03-08  4:00 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-25 18:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to David Binderman from comment #6)
> I see very similar for this legal C code:

That seems like a different issue, please file it seperately.

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

* [Bug c/102760] ICE: in decompose, at wide-int.h:984
  2021-10-15  2:50 [Bug c/102760] New: ICE: in decompose, at wide-int.h:984 cnsun at uwaterloo dot ca
                   ` (6 preceding siblings ...)
  2023-01-25 18:23 ` pinskia at gcc dot gnu.org
@ 2023-01-25 18:29 ` dcb314 at hotmail dot com
  2024-03-08  4:00 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: dcb314 at hotmail dot com @ 2023-01-25 18:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Andrew Pinski from comment #7)
> (In reply to David Binderman from comment #6)
> > I see very similar for this legal C code:
> 
> That seems like a different issue, please file it seperately.

Done, see 108547.

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

* [Bug c/102760] ICE: in decompose, at wide-int.h:984
  2021-10-15  2:50 [Bug c/102760] New: ICE: in decompose, at wide-int.h:984 cnsun at uwaterloo dot ca
                   ` (7 preceding siblings ...)
  2023-01-25 18:29 ` dcb314 at hotmail dot com
@ 2024-03-08  4:00 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-08  4:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-bisection

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I can't reproduce this on the trunk any more.

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

end of thread, other threads:[~2024-03-08  4:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15  2:50 [Bug c/102760] New: ICE: in decompose, at wide-int.h:984 cnsun at uwaterloo dot ca
2021-10-15  3:12 ` [Bug c/102760] " pinskia at gcc dot gnu.org
2021-10-15  8:26 ` marxin at gcc dot gnu.org
2021-10-15  8:46 ` glisse at gcc dot gnu.org
2021-10-15 21:21 ` pinskia at gcc dot gnu.org
2022-10-20 15:41 ` pinskia at gcc dot gnu.org
2023-01-25 18:21 ` dcb314 at hotmail dot com
2023-01-25 18:23 ` pinskia at gcc dot gnu.org
2023-01-25 18:29 ` dcb314 at hotmail dot com
2024-03-08  4:00 ` 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).