public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/108209] New: goof in genmatch.cc:commutative_op
@ 2022-12-23 13:30 amonakov at gcc dot gnu.org
  2022-12-23 17:56 ` [Bug middle-end/108209] " amonakov at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: amonakov at gcc dot gnu.org @ 2022-12-23 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108209
           Summary: goof in genmatch.cc:commutative_op
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amonakov at gcc dot gnu.org
  Target Milestone: ---

It pretends that define_operator_list is commutative when its first member is
NOT commutative:

  if (user_id *uid = dyn_cast<user_id *> (id))
    {
      int res = commutative_op (uid->substitutes[0]);
      if (res < 0)
        return 0;
      for (unsigned i = 1; i < uid->substitutes.length (); ++i)
        if (res != commutative_op (uid->substitutes[i]))
          return -1;
      return res;
    }

The first 'return 0' should be 'return -1' instead.

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

* [Bug middle-end/108209] goof in genmatch.cc:commutative_op
  2022-12-23 13:30 [Bug middle-end/108209] New: goof in genmatch.cc:commutative_op amonakov at gcc dot gnu.org
@ 2022-12-23 17:56 ` amonakov at gcc dot gnu.org
  2023-01-09 13:27 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: amonakov at gcc dot gnu.org @ 2022-12-23 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Keeping notes as I go...

Duplicated checks for 'op0' in lower_for are duplicated.

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

* [Bug middle-end/108209] goof in genmatch.cc:commutative_op
  2022-12-23 13:30 [Bug middle-end/108209] New: goof in genmatch.cc:commutative_op amonakov at gcc dot gnu.org
  2022-12-23 17:56 ` [Bug middle-end/108209] " amonakov at gcc dot gnu.org
@ 2023-01-09 13:27 ` rguenth at gcc dot gnu.org
  2023-01-09 14:08 ` cvs-commit at gcc dot gnu.org
  2023-01-09 14:08 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-09 13:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2023-01-09
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.

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

* [Bug middle-end/108209] goof in genmatch.cc:commutative_op
  2022-12-23 13:30 [Bug middle-end/108209] New: goof in genmatch.cc:commutative_op amonakov at gcc dot gnu.org
  2022-12-23 17:56 ` [Bug middle-end/108209] " amonakov at gcc dot gnu.org
  2023-01-09 13:27 ` rguenth at gcc dot gnu.org
@ 2023-01-09 14:08 ` cvs-commit at gcc dot gnu.org
  2023-01-09 14:08 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-09 14:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:46034c46f82dec169fe7fc7c2d82d8321d9a9512

commit r13-5068-g46034c46f82dec169fe7fc7c2d82d8321d9a9512
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jan 9 14:28:03 2023 +0100

    middle-end/108209 - typo in genmatch.cc:commutative_op

    The early out for user-id handling indicated commutative
    rather than not commutative.

            PR middle-end/108209
            * genmatch.cc (commutative_op): Fix return value for
            user-id with non-commutative first replacement.

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

* [Bug middle-end/108209] goof in genmatch.cc:commutative_op
  2022-12-23 13:30 [Bug middle-end/108209] New: goof in genmatch.cc:commutative_op amonakov at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-01-09 14:08 ` cvs-commit at gcc dot gnu.org
@ 2023-01-09 14:08 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-09 14:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-01-09 14:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-23 13:30 [Bug middle-end/108209] New: goof in genmatch.cc:commutative_op amonakov at gcc dot gnu.org
2022-12-23 17:56 ` [Bug middle-end/108209] " amonakov at gcc dot gnu.org
2023-01-09 13:27 ` rguenth at gcc dot gnu.org
2023-01-09 14:08 ` cvs-commit at gcc dot gnu.org
2023-01-09 14:08 ` rguenth 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).