public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/112738] New: forwprop4 introduces invalid wide signed Boolean values
@ 2023-11-27 23:21 kristerw at gcc dot gnu.org
  2023-11-27 23:26 ` [Bug tree-optimization/112738] [14 Regression] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: kristerw at gcc dot gnu.org @ 2023-11-27 23:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112738
           Summary: forwprop4 introduces invalid wide signed Boolean
                    values
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kristerw at gcc dot gnu.org
  Target Milestone: ---

The forwprop4 pass introduces an invalid wide Boolean when compiling the
following function with -O3 for X86_64:

  int *a, b, c, d;
  void
  foo (void)
  {
    for (; d <= 0; d++)
      b &= ((a || d) ^ c) == 1;
  }

What is happening is that forwprop4 changes the IR

  _38 = (signed int) _16;
  _59 = -_38;
  _65 = (<signed-boolean:32>) _59;

to the incorrect

  _55 = (<signed-boolean:32>) _16;
  _65 = -_55;

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

end of thread, other threads:[~2023-11-28 17:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-27 23:21 [Bug tree-optimization/112738] New: forwprop4 introduces invalid wide signed Boolean values kristerw at gcc dot gnu.org
2023-11-27 23:26 ` [Bug tree-optimization/112738] [14 Regression] " pinskia at gcc dot gnu.org
2023-11-27 23:34 ` pinskia at gcc dot gnu.org
2023-11-28 17:52 ` cvs-commit at gcc dot gnu.org
2023-11-28 17:52 ` 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).