public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/94613] New: combine: Wrong code due to splitting a simplified IF_THEN_ELSE
@ 2020-04-16  7:01 krebbel at gcc dot gnu.org
  2020-04-16  7:02 ` [Bug rtl-optimization/94613] " krebbel at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: krebbel at gcc dot gnu.org @ 2020-04-16  7:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94613
           Summary: combine: Wrong code due to splitting a simplified
                    IF_THEN_ELSE
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: krebbel at gcc dot gnu.org
  Target Milestone: ---

Created attachment 48284
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48284&action=edit
autoreduced testcase

When compiling the attached testcase for IBM Z GCC optimizes an OR operation
away during combine leading to wrong code being generated:

cc1plus -O3 -march=z14 t.ii -quiet -o t.s

try_combine is invoked for the following 3 insns:

i1: 28: r111 = r110 | r158
i2: 31: r115 = r111 - r94
i3: 36: r122 = (r110 == 0 ? r115 : r177)

i3 becomes the following after inserting i1 and i2

36: r122 = (r110 == 0 ? r110 | r158 - r94 : r177)

simplification omits ORing r110 since it is 0 anyway:

36: r122 = (r110 == 0 ? r158 - r94 : r177)

after not being able to recognize the insn it gets split into parts again:

28: deleted
31: r115 = r158 - r94
36: r122 = (r110 == 0 ? r115 : r177)

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

end of thread, other threads:[~2021-10-28  6:04 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16  7:01 [Bug rtl-optimization/94613] New: combine: Wrong code due to splitting a simplified IF_THEN_ELSE krebbel at gcc dot gnu.org
2020-04-16  7:02 ` [Bug rtl-optimization/94613] " krebbel at gcc dot gnu.org
2020-04-16  7:05 ` krebbel at gcc dot gnu.org
2020-04-16  7:05 ` krebbel at gcc dot gnu.org
2020-04-16  7:09 ` krebbel at gcc dot gnu.org
2020-04-16  7:10 ` rguenth at gcc dot gnu.org
2020-04-16  7:15 ` rguenth at gcc dot gnu.org
2020-04-16  7:37 ` krebbel at gcc dot gnu.org
2020-04-16  8:21 ` [Bug target/94613] Wrong code generated for vec_sel builtin krebbel at gcc dot gnu.org
2020-04-16  8:28 ` [Bug target/94613] S/390: " krebbel at gcc dot gnu.org
2020-04-16 21:18 ` segher at gcc dot gnu.org
2020-04-20 17:39 ` [Bug target/94613] S/390, powerpc: " cvs-commit at gcc dot gnu.org
2020-05-04  8:39 ` cvs-commit at gcc dot gnu.org
2020-05-04  8:43 ` cvs-commit at gcc dot gnu.org
2020-05-07 11:56 ` jakub at gcc dot gnu.org
2020-07-23  6:52 ` rguenth at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-05-04 12:32 ` rguenth at gcc dot gnu.org
2021-05-27  0:57 ` luoxhu at gcc dot gnu.org
2021-10-28  3:18 ` cvs-commit at gcc dot gnu.org
2021-10-28  3:18 ` cvs-commit at gcc dot gnu.org
2021-10-28  6:04 ` luoxhu 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).