public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/103003] New: ice in set_relation, at value-relation.cc:592
@ 2021-10-30 12:46 dcb314 at hotmail dot com
  2021-10-30 12:51 ` [Bug c/103003] " dcb314 at hotmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dcb314 at hotmail dot com @ 2021-10-30 12:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103003
           Summary: ice in set_relation, at value-relation.cc:592
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 51702
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51702&action=edit
C source code

The attached C code with recent gcc trunk, does this:

bug767.c: In function ‘func_1’:
bug767.c:10:1: internal compiler error: in set_relation, at
value-relation.cc:592
   10 | func_1() {
      | ^~~~~~
0x1c97b0c path_oracle::register_relation(basic_block_def*, tree_code,
tree_node*, tree_node*)
        ../../trunk.git/gcc/value-relation.cc:0

The code first goes wrong sometime between git hash 22d34a2a50651d01
and ec0124e0acb556cd.

I will try to reduce the code.

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

* [Bug c/103003] ice in set_relation, at value-relation.cc:592
  2021-10-30 12:46 [Bug c/103003] New: ice in set_relation, at value-relation.cc:592 dcb314 at hotmail dot com
@ 2021-10-30 12:51 ` dcb314 at hotmail dot com
  2021-10-30 12:57 ` dcb314 at hotmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dcb314 at hotmail dot com @ 2021-10-30 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
Reduced C code seems to be

 #include <stdint.h>
int8_t c_4, uli_5;
uint16_t us_6;
func_1() {
  int uli_9 = 0;
  uint64_t ptr_11 = uli_9 |= uli_5 != 0;
  uint16_t ptr_16ptr_11 = &uli_9;
  for (; us_6 <= 6;)
    if ((us_6 *= uli_9) < (ptr_11 || 0) ?: ((c_4 = us_6) >= us_6) - uli_5)
      for (uli_9 = 9; uli_9;)
        ;
}

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

* [Bug c/103003] ice in set_relation, at value-relation.cc:592
  2021-10-30 12:46 [Bug c/103003] New: ice in set_relation, at value-relation.cc:592 dcb314 at hotmail dot com
  2021-10-30 12:51 ` [Bug c/103003] " dcb314 at hotmail dot com
@ 2021-10-30 12:57 ` dcb314 at hotmail dot com
  2021-10-30 15:05 ` amacleod at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dcb314 at hotmail dot com @ 2021-10-30 12:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
I am not sure why the #include is in there.

Further reduced code is

typedef char int8_t;
int8_t c_4, uli_5;
unsigned short us_6;
func_1() {
  int uli_9;
  short ptr_16ptr_11 = &uli_9;
  for (; us_6 <= 6;)
    if ((us_6 *= uli_9) < (uli_5 || 0) ?: ((c_4 = us_6) >= us_6) - uli_5)
      uli_9 = 9;
}

Flag -O2 required.

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

* [Bug c/103003] ice in set_relation, at value-relation.cc:592
  2021-10-30 12:46 [Bug c/103003] New: ice in set_relation, at value-relation.cc:592 dcb314 at hotmail dot com
  2021-10-30 12:51 ` [Bug c/103003] " dcb314 at hotmail dot com
  2021-10-30 12:57 ` dcb314 at hotmail dot com
@ 2021-10-30 15:05 ` amacleod at redhat dot com
  2021-10-30 17:08 ` [Bug tree-optimization/103003] [12 regression] " pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: amacleod at redhat dot com @ 2021-10-30 15:05 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |amacleod at redhat dot com
                 CC|                            |amacleod at redhat dot com
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2021-10-30
     Ever confirmed|0                           |1

--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> ---
Created attachment 51703
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51703&action=edit
proposed patch

we know the result is true, so we are trying to register a "<=" expression for:
  _10 = _4 <= _4;
If the 2 ssa names are the same, there is no need o register any relation. 
equality is implied, and nothign else makes sense.

Untested patch for now.

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

* [Bug tree-optimization/103003] [12 regression] ice in set_relation, at value-relation.cc:592
  2021-10-30 12:46 [Bug c/103003] New: ice in set_relation, at value-relation.cc:592 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2021-10-30 15:05 ` amacleod at redhat dot com
@ 2021-10-30 17:08 ` pinskia at gcc dot gnu.org
  2021-11-01 13:19 ` cvs-commit at gcc dot gnu.org
  2021-11-01 13:32 ` amacleod at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-30 17:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug tree-optimization/103003] [12 regression] ice in set_relation, at value-relation.cc:592
  2021-10-30 12:46 [Bug c/103003] New: ice in set_relation, at value-relation.cc:592 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2021-10-30 17:08 ` [Bug tree-optimization/103003] [12 regression] " pinskia at gcc dot gnu.org
@ 2021-11-01 13:19 ` cvs-commit at gcc dot gnu.org
  2021-11-01 13:32 ` amacleod at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-01 13:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Macleod <amacleod@gcc.gnu.org>:

https://gcc.gnu.org/g:0187c03be31a58ba561d535687dc00c94f0ff1aa

commit r12-4821-g0187c03be31a58ba561d535687dc00c94f0ff1aa
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Sat Oct 30 11:00:49 2021 -0400

    Don't register nonsensical relations.

            gcc/
            PR tree-optimization/103003
            * value-relation.cc (dom_oracle::register_relation): If the 2
            ssa names are the same, don't register any relation.

            gcc/testsuite/
            * gcc.dg/pr103003.c: New.

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

* [Bug tree-optimization/103003] [12 regression] ice in set_relation, at value-relation.cc:592
  2021-10-30 12:46 [Bug c/103003] New: ice in set_relation, at value-relation.cc:592 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2021-11-01 13:19 ` cvs-commit at gcc dot gnu.org
@ 2021-11-01 13:32 ` amacleod at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: amacleod at redhat dot com @ 2021-11-01 13:32 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

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

--- Comment #5 from Andrew Macleod <amacleod at redhat dot com> ---
fixed.

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

end of thread, other threads:[~2021-11-01 13:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-30 12:46 [Bug c/103003] New: ice in set_relation, at value-relation.cc:592 dcb314 at hotmail dot com
2021-10-30 12:51 ` [Bug c/103003] " dcb314 at hotmail dot com
2021-10-30 12:57 ` dcb314 at hotmail dot com
2021-10-30 15:05 ` amacleod at redhat dot com
2021-10-30 17:08 ` [Bug tree-optimization/103003] [12 regression] " pinskia at gcc dot gnu.org
2021-11-01 13:19 ` cvs-commit at gcc dot gnu.org
2021-11-01 13:32 ` amacleod at redhat dot com

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).