This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/79450] [5/6/7 Regression] wrong code with loop at -O1


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-02-10
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |segher at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r176984, but likely that just uncovered a latent RTL optimization
bug, because the only difference in *.optimized with that is swapping of
operands in a single stmt:

--- pr79450.c.143t.optimized_   2017-02-10 03:58:22.000000000 -0500
+++ pr79450.c.143t.optimized    2017-02-10 03:58:48.000000000 -0500
@@ -20,7 +20,7 @@ foo (u8 p1, u64 p2)
   D.2710_4 = p2_3(D) == 0;
   D.2711_5 = (signed char) D.2710_4;
   p1.0_6 = (signed char) p1_1;
-  D.2713_7 = p1.0_6 & D.2711_5;
+  D.2713_7 = D.2711_5 & p1.0_6;
   p1_8 = (u8) D.2713_7;
   p1_9 = p1_8 % 24;
   D.2714_10 = (u64) p1_9;

The resulting asm change is:

--- pr79450.s_  2017-02-10 03:58:22.000000000 -0500
+++ pr79450.s   2017-02-10 03:58:48.000000000 -0500
@@ -12,8 +12,7 @@ foo:
        movzbl  %dil, %eax
        cmpq    %rax, %rsi
        ja      .L2
-       movzbl  %dil, %edi
-       leal    (%rdi,%rsi), %eax
+       movl    %esi, %eax
        ret
        .cfi_endproc
 .LFE0:

though.
Things go wrong during combine.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]