public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644
@ 2021-02-23 18:29 gscfq@t-online.de
  2021-02-23 18:46 ` [Bug c/99225] [8/9/10/11 Regression] " jakub at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gscfq@t-online.de @ 2021-02-23 18:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99225
           Summary: ICE in wide_int_to_tree_1, at tree.c:1644
           Product: gcc
           Version: 11.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
#define vector __attribute__((vector_size(16)))
int f ()
{
  vector int a = {0, 0, 0, 0};
  vector int b = {1, 0, 0, 0};
  return (a & (1 << b)) != 0;
}


$ gcc-11-20210221 -c z1.c
z1.c: In function 'f':
z1.c:6:3: internal compiler error: in wide_int_to_tree_1, at tree.c:1644
    6 |   return (a & (1 << b)) != 0;
      |   ^~~~~~
0xde3e1e wide_int_to_tree_1
        ../../gcc/tree.c:1644
0xde433b wide_int_to_tree(tree_node*, poly_int<1u,
generic_wide_int<wide_int_ref_storage<false, true> > > const&)
        ../../gcc/tree.c:1756
0xde433b build_int_cst(tree_node*, poly_int<1u, long>)
        ../../gcc/tree.c:1396
0x8945ea fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fold-const.c:12048
0x894caa fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fold-const.c:13715
0x69e80b c_fully_fold_internal
        ../../gcc/c/c-fold.c:371
0x69e00d c_fully_fold_internal
        ../../gcc/c/c-fold.c:623
0x69f0a9 c_fully_fold(tree_node*, bool, bool*, bool)
        ../../gcc/c/c-fold.c:125
0x65c2cd c_finish_return(unsigned int, tree_node*, tree_node*)
        ../../gcc/c/c-typeck.c:10742
0x6918b6 c_parser_statement_after_labels
        ../../gcc/c/c-parser.c:6162
0x69339a c_parser_compound_statement_nostart
        ../../gcc/c/c-parser.c:5788
0x693c13 c_parser_compound_statement
        ../../gcc/c/c-parser.c:5597
0x6954c8 c_parser_declaration_or_fndef
        ../../gcc/c/c-parser.c:2539
0x69c337 c_parser_external_declaration
        ../../gcc/c/c-parser.c:1777
0x69ce59 c_parser_translation_unit
        ../../gcc/c/c-parser.c:1650
0x69ce59 c_parse_file()
        ../../gcc/c/c-parser.c:21984
0x6eccc2 c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1218

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

* [Bug c/99225] [8/9/10/11 Regression] ICE in wide_int_to_tree_1, at tree.c:1644
  2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
@ 2021-02-23 18:46 ` jakub at gcc dot gnu.org
  2021-02-23 18:52 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-23 18:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2021-02-23
            Summary|ICE in wide_int_to_tree_1,  |[8/9/10/11 Regression] ICE
                   |at tree.c:1644              |in wide_int_to_tree_1, at
                   |                            |tree.c:1644
   Target Milestone|---                         |8.5
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
ICEs since r0-119394-ga212e43fca22f730987ad4d15a0bd58efae9677e , before that
it has been rejected.

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

* [Bug c/99225] [8/9/10/11 Regression] ICE in wide_int_to_tree_1, at tree.c:1644
  2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
  2021-02-23 18:46 ` [Bug c/99225] [8/9/10/11 Regression] " jakub at gcc dot gnu.org
@ 2021-02-23 18:52 ` jakub at gcc dot gnu.org
  2021-02-23 19:16 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-23 18:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c/99225] [8/9/10/11 Regression] ICE in wide_int_to_tree_1, at tree.c:1644
  2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
  2021-02-23 18:46 ` [Bug c/99225] [8/9/10/11 Regression] " jakub at gcc dot gnu.org
  2021-02-23 18:52 ` jakub at gcc dot gnu.org
@ 2021-02-23 19:16 ` jakub at gcc dot gnu.org
  2021-02-24 11:11 ` [Bug tree-optimization/99225] " cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-23 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

Untested fix.

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

* [Bug tree-optimization/99225] [8/9/10/11 Regression] ICE in wide_int_to_tree_1, at tree.c:1644
  2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-02-23 19:16 ` jakub at gcc dot gnu.org
@ 2021-02-24 11:11 ` cvs-commit at gcc dot gnu.org
  2021-02-24 11:15 ` [Bug tree-optimization/99225] [8/9/10 " jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-24 11:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:6e646abbe02f2c79cc3ba1f3de705ee62ff9dcd1

commit r11-7356-g6e646abbe02f2c79cc3ba1f3de705ee62ff9dcd1
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Feb 24 12:10:25 2021 +0100

    fold-const: Fix up ((1 << x) & y) != 0 folding for vectors [PR99225]

    This optimization was written purely with scalar integers in mind,
    can work fine even with vectors, but we can't use build_int_cst but
    need to use build_one_cst instead.

    2021-02-24  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/99225
            * fold-const.c (fold_binary_loc) <case NE_EXPR>: In (x & (1 << y))
!= 0
            to ((x >> y) & 1) != 0 simplifications use build_one_cst instead of
            build_int_cst (..., 1).  Formatting fixes.

            * gcc.c-torture/compile/pr99225.c: New test.

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

* [Bug tree-optimization/99225] [8/9/10 Regression] ICE in wide_int_to_tree_1, at tree.c:1644
  2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-02-24 11:11 ` [Bug tree-optimization/99225] " cvs-commit at gcc dot gnu.org
@ 2021-02-24 11:15 ` jakub at gcc dot gnu.org
  2021-03-19 23:29 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-24 11:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[8/9/10/11 Regression] ICE  |[8/9/10 Regression] ICE in
                   |in wide_int_to_tree_1, at   |wide_int_to_tree_1, at
                   |tree.c:1644                 |tree.c:1644

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.

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

* [Bug tree-optimization/99225] [8/9/10 Regression] ICE in wide_int_to_tree_1, at tree.c:1644
  2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-02-24 11:15 ` [Bug tree-optimization/99225] [8/9/10 " jakub at gcc dot gnu.org
@ 2021-03-19 23:29 ` cvs-commit at gcc dot gnu.org
  2021-03-20  8:08 ` [Bug tree-optimization/99225] [8/9 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-19 23:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:4de402ab60c54fff48cb7371644b024d10d7e5bb

commit r10-9476-g4de402ab60c54fff48cb7371644b024d10d7e5bb
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Feb 24 12:10:25 2021 +0100

    fold-const: Fix up ((1 << x) & y) != 0 folding for vectors [PR99225]

    This optimization was written purely with scalar integers in mind,
    can work fine even with vectors, but we can't use build_int_cst but
    need to use build_one_cst instead.

    2021-02-24  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/99225
            * fold-const.c (fold_binary_loc) <case NE_EXPR>: In (x & (1 << y))
!= 0
            to ((x >> y) & 1) != 0 simplifications use build_one_cst instead of
            build_int_cst (..., 1).  Formatting fixes.

            * gcc.c-torture/compile/pr99225.c: New test.

    (cherry picked from commit 6e646abbe02f2c79cc3ba1f3de705ee62ff9dcd1)

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

* [Bug tree-optimization/99225] [8/9 Regression] ICE in wide_int_to_tree_1, at tree.c:1644
  2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-03-19 23:29 ` cvs-commit at gcc dot gnu.org
@ 2021-03-20  8:08 ` jakub at gcc dot gnu.org
  2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-20  8:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[8/9/10 Regression] ICE in  |[8/9 Regression] ICE in
                   |wide_int_to_tree_1, at      |wide_int_to_tree_1, at
                   |tree.c:1644                 |tree.c:1644

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.3 too.

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

* [Bug tree-optimization/99225] [8/9 Regression] ICE in wide_int_to_tree_1, at tree.c:1644
  2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-03-20  8:08 ` [Bug tree-optimization/99225] [8/9 " jakub at gcc dot gnu.org
@ 2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
  2021-04-22 16:51 ` cvs-commit at gcc dot gnu.org
  2021-04-22 17:11 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-20 23:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:7c9f7293c995b662457b4e7aba97a6faa4d86dc5

commit r9-9426-g7c9f7293c995b662457b4e7aba97a6faa4d86dc5
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Feb 24 12:10:25 2021 +0100

    fold-const: Fix up ((1 << x) & y) != 0 folding for vectors [PR99225]

    This optimization was written purely with scalar integers in mind,
    can work fine even with vectors, but we can't use build_int_cst but
    need to use build_one_cst instead.

    2021-02-24  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/99225
            * fold-const.c (fold_binary_loc) <case NE_EXPR>: In (x & (1 << y))
!= 0
            to ((x >> y) & 1) != 0 simplifications use build_one_cst instead of
            build_int_cst (..., 1).  Formatting fixes.

            * gcc.c-torture/compile/pr99225.c: New test.

    (cherry picked from commit 4de402ab60c54fff48cb7371644b024d10d7e5bb)

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

* [Bug tree-optimization/99225] [8/9 Regression] ICE in wide_int_to_tree_1, at tree.c:1644
  2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 16:51 ` cvs-commit at gcc dot gnu.org
  2021-04-22 17:11 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-22 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r8-10891-gcf570d10449a35fe4f5e45db087a527eefd0dcf3
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Feb 24 12:10:25 2021 +0100

    fold-const: Fix up ((1 << x) & y) != 0 folding for vectors [PR99225]

    This optimization was written purely with scalar integers in mind,
    can work fine even with vectors, but we can't use build_int_cst but
    need to use build_one_cst instead.

    2021-02-24  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/99225
            * fold-const.c (fold_binary_loc) <case NE_EXPR>: In (x & (1 << y))
!= 0
            to ((x >> y) & 1) != 0 simplifications use build_one_cst instead of
            build_int_cst (..., 1).  Formatting fixes.

            * gcc.c-torture/compile/pr99225.c: New test.

    (cherry picked from commit 4de402ab60c54fff48cb7371644b024d10d7e5bb)

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

* [Bug tree-optimization/99225] [8/9 Regression] ICE in wide_int_to_tree_1, at tree.c:1644
  2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
                   ` (8 preceding siblings ...)
  2021-04-22 16:51 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 17:11 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-22 17:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-04-22 17:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 18:29 [Bug c/99225] New: ICE in wide_int_to_tree_1, at tree.c:1644 gscfq@t-online.de
2021-02-23 18:46 ` [Bug c/99225] [8/9/10/11 Regression] " jakub at gcc dot gnu.org
2021-02-23 18:52 ` jakub at gcc dot gnu.org
2021-02-23 19:16 ` jakub at gcc dot gnu.org
2021-02-24 11:11 ` [Bug tree-optimization/99225] " cvs-commit at gcc dot gnu.org
2021-02-24 11:15 ` [Bug tree-optimization/99225] [8/9/10 " jakub at gcc dot gnu.org
2021-03-19 23:29 ` cvs-commit at gcc dot gnu.org
2021-03-20  8:08 ` [Bug tree-optimization/99225] [8/9 " jakub at gcc dot gnu.org
2021-04-20 23:32 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:51 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:11 ` 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).