public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101511] New: ice in query_relation, at value-relation.cc:879
@ 2021-07-19 13:54 dcb314 at hotmail dot com
  2021-07-19 14:03 ` [Bug c++/101511] " dcb314 at hotmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dcb314 at hotmail dot com @ 2021-07-19 13:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101511
           Summary: ice in query_relation, at value-relation.cc:879
           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 51171
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51171&action=edit
gzipped C++ source code

The attached C++ code does this with recent gcc:

$ /home/dcb/gcc/results/bin/gcc -c -O2 -w bug739.cc 
during GIMPLE pass: evrp
/home/dcb34/rpmbuild/BUILD/glm-0.9.9.8/test/ext/ext_scalar_integer.cpp: In
funct
ion ‘int nextMultiple::test_uint() [with T = unsigned int]’:
/home/dcb34/rpmbuild/BUILD/glm-0.9.9.8/test/ext/ext_scalar_integer.cpp:677:1:
in
ternal compiler error: in query_relation, at value-relation.cc:879
  677 | }
      | ^
0x8caf23 relation_oracle::query_relation(basic_block_def*, tree_node*,
tree_node
*)
        ../../trunk.git/gcc/value-relation.cc:879
0x15ec545 range_query::query_relation(gimple*, tree_node*, tree_node*, bool)
        ../../trunk.git/gcc/value-query.cc:475

The bug first seems to occur sometime between git hash b4e21c80462682c4
and 7dcf139a2b8e1c53

I will have my usual go at reducing the code and I might even 
have a go at finding the git revision that causes the problem.

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

* [Bug c++/101511] ice in query_relation, at value-relation.cc:879
  2021-07-19 13:54 [Bug c++/101511] New: ice in query_relation, at value-relation.cc:879 dcb314 at hotmail dot com
@ 2021-07-19 14:03 ` dcb314 at hotmail dot com
  2021-07-19 14:23 ` [Bug tree-optimization/101511] [12 Regression] " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dcb314 at hotmail dot com @ 2021-07-19 14:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---

Reduced C++ code seems to be:

void __assert_fail(char *, char *, int, const char *)
    __attribute__((__noreturn__));
template <typename T> void test_uint() {
  long __trans_tmp_3, __trans_tmp_1;
  int Error;
  for (;;) {
    {
      unsigned long Tmp = -1;
      __trans_tmp_3 = Tmp - Tmp % 0;
    }
    Error += 0 == __trans_tmp_3 ? 0 : 1;
    !Error ? void() : __assert_fail("", "", 3, __PRETTY_FUNCTION__);
    T Tmp = -1;
    __trans_tmp_1 = Tmp - Tmp % 0;
    Error += 0 == __trans_tmp_1 ? 0 : 1;
    !Error ? void() : __assert_fail("", "", 7, __PRETTY_FUNCTION__);
  }
}
void test() { test_uint<unsigned long>(); }

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

* [Bug tree-optimization/101511] [12 Regression] ice in query_relation, at value-relation.cc:879
  2021-07-19 13:54 [Bug c++/101511] New: ice in query_relation, at value-relation.cc:879 dcb314 at hotmail dot com
  2021-07-19 14:03 ` [Bug c++/101511] " dcb314 at hotmail dot com
@ 2021-07-19 14:23 ` rguenth at gcc dot gnu.org
  2021-07-19 15:25 ` dcb314 at hotmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-19 14:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ice in query_relation, at   |[12 Regression] ice in
                   |value-relation.cc:879       |query_relation, at
                   |                            |value-relation.cc:879
                 CC|                            |amacleod at redhat dot com
   Target Milestone|---                         |12.0
           Keywords|                            |ice-on-valid-code
          Component|c++                         |tree-optimization

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

* [Bug tree-optimization/101511] [12 Regression] ice in query_relation, at value-relation.cc:879
  2021-07-19 13:54 [Bug c++/101511] New: ice in query_relation, at value-relation.cc:879 dcb314 at hotmail dot com
  2021-07-19 14:03 ` [Bug c++/101511] " dcb314 at hotmail dot com
  2021-07-19 14:23 ` [Bug tree-optimization/101511] [12 Regression] " rguenth at gcc dot gnu.org
@ 2021-07-19 15:25 ` dcb314 at hotmail dot com
  2021-07-19 20:59 ` amacleod at redhat dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dcb314 at hotmail dot com @ 2021-07-19 15:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
I've had a go at a git bisect, but couldn't produce any sensible answers ;-<

Richard seems to think Andrew MacLeod may be helpful, so I am happy
to go with that.

For the git range I suggested, commits 
4c85ff754927c518ed97da5e0221eeea742c9aa7,
a03e944e92ee51ae583382079d4739b64bd93b35, 
ca4d381662c37733b2a1d49d6c8f5fcfc1348f3d and
9d674b735f22aa9cf85629851783ce38f25087b5 are by Andrew.

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

* [Bug tree-optimization/101511] [12 Regression] ice in query_relation, at value-relation.cc:879
  2021-07-19 13:54 [Bug c++/101511] New: ice in query_relation, at value-relation.cc:879 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2021-07-19 15:25 ` dcb314 at hotmail dot com
@ 2021-07-19 20:59 ` amacleod at redhat dot com
  2021-07-22 12:53 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2021-07-19 20:59 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org

--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> ---
The new relation code is dominance based,  in the interest of efficiency, it
can currently miss the odd equivalence if things are processed in a
non-dominance order.

Its not incorrect, it just may lead to a missed opportunity.

This testcase triggers an assert which checks for this situation.  There are
numerous UNDEFINED values, and we end up register an equivalences:

 Registering value_relation (Error_18 == _4) (bb4) at Error_18 = _4 + Error_13;
 Registering value_relation (Error_13 == _4) (bb2) at Error_13 = _4 + Error_9;

Not we register the bb4 equivalence first,  and then alter register the one in
bb2.

As a result, we don't currently update post dominated blocks, so we dont
combine these into Error_18, Error_13 and _4 in bb4.
When we later check for an equivalence between we detect this anomaly.
There is nothing incorrect in allowing it, and we'll do so for now.  
Eventually, when its flushed out better, we'll change this back to an assert.

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

* [Bug tree-optimization/101511] [12 Regression] ice in query_relation, at value-relation.cc:879
  2021-07-19 13:54 [Bug c++/101511] New: ice in query_relation, at value-relation.cc:879 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2021-07-19 20:59 ` amacleod at redhat dot com
@ 2021-07-22 12:53 ` cvs-commit at gcc dot gnu.org
  2021-07-22 13:05 ` marxin at gcc dot gnu.org
  2021-07-22 13:06 ` amacleod at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-22 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:d3fa77472b78c5ddada03a1052b229bea11cb76f

commit r12-2466-gd3fa77472b78c5ddada03a1052b229bea11cb76f
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Mon Jul 19 15:54:57 2021 -0400

    Allow non-symmetrical equivalences.

    Don't trap if equivalences are processed out of DOM order, and aren't
    completely symmetrical.  We will eventually resolve this, but its OK for
now.

            gcc/
            PR tree-optimization/101511
            * value-relation.cc (relation_oracle::query_relation): Check if
ssa1
            is in ssa2's equiv set, and don't trap if so.

            gcc/testsuite/
            * g++.dg/pr101511.C: New.

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

* [Bug tree-optimization/101511] [12 Regression] ice in query_relation, at value-relation.cc:879
  2021-07-19 13:54 [Bug c++/101511] New: ice in query_relation, at value-relation.cc:879 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2021-07-22 12:53 ` cvs-commit at gcc dot gnu.org
@ 2021-07-22 13:05 ` marxin at gcc dot gnu.org
  2021-07-22 13:06 ` amacleod at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-07-22 13:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2021-07-22
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

* [Bug tree-optimization/101511] [12 Regression] ice in query_relation, at value-relation.cc:879
  2021-07-19 13:54 [Bug c++/101511] New: ice in query_relation, at value-relation.cc:879 dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2021-07-22 13:05 ` marxin at gcc dot gnu.org
@ 2021-07-22 13:06 ` amacleod at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2021-07-22 13:06 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Macleod <amacleod at redhat dot com> changed:

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

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

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

end of thread, other threads:[~2021-07-22 13:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 13:54 [Bug c++/101511] New: ice in query_relation, at value-relation.cc:879 dcb314 at hotmail dot com
2021-07-19 14:03 ` [Bug c++/101511] " dcb314 at hotmail dot com
2021-07-19 14:23 ` [Bug tree-optimization/101511] [12 Regression] " rguenth at gcc dot gnu.org
2021-07-19 15:25 ` dcb314 at hotmail dot com
2021-07-19 20:59 ` amacleod at redhat dot com
2021-07-22 12:53 ` cvs-commit at gcc dot gnu.org
2021-07-22 13:05 ` marxin at gcc dot gnu.org
2021-07-22 13:06 ` 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).