public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/80491] [9/10/11/12 Regression] Compiler regression for long-add case.
       [not found] <bug-80491-4@http.gcc.gnu.org/bugzilla/>
@ 2021-09-21  7:22 ` pinskia at gcc dot gnu.org
  2021-09-21  7:25 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-21  7:22 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEW
      Known to work|8.0                         |
            Summary|[7 Regression] Compiler     |[9/10/11/12 Regression]
                   |regression for long-add     |Compiler regression for
                   |case.                       |long-add case.
   Target Milestone|8.0                         |9.5
          Component|rtl-optimization            |target

--- Comment #19 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed again on the trunk.  Note arm64 produces decent code:
        ldp     x2, x4, [x0]
        ldp     x3, x1, [x1]
        adds    x0, x2, x3
        adc     x1, x1, x4
        ret

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

* [Bug target/80491] [9/10/11/12 Regression] Compiler regression for long-add case.
       [not found] <bug-80491-4@http.gcc.gnu.org/bugzilla/>
  2021-09-21  7:22 ` [Bug target/80491] [9/10/11/12 Regression] Compiler regression for long-add case pinskia at gcc dot gnu.org
@ 2021-09-21  7:25 ` pinskia at gcc dot gnu.org
  2022-05-27  9:37 ` [Bug target/80491] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-21  7:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is the full testcase:
#include <stdint.h>
struct pair {
  uint64_t low;
  uint64_t hi;
};

pair add(pair& a, pair& b) {
 pair s;
 s.low = a.low + b.low;
 s.hi = ((s.low < a.low)+b.hi )+ a.hi ; //carry
 return s;
}

pair add1(pair& a, pair& b) {
 pair s;
 uint64_t t = __builtin_add_overflow ( a.low, b.low, &s.low);
 s.hi = b.hi + a.hi +t; //carry
 return s;
}
----- CUT -----
At -O1 add gets it correct and has no setc

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

* [Bug target/80491] [10/11/12/13 Regression] Compiler regression for long-add case.
       [not found] <bug-80491-4@http.gcc.gnu.org/bugzilla/>
  2021-09-21  7:22 ` [Bug target/80491] [9/10/11/12 Regression] Compiler regression for long-add case pinskia at gcc dot gnu.org
  2021-09-21  7:25 ` pinskia at gcc dot gnu.org
@ 2022-05-27  9:37 ` rguenth at gcc dot gnu.org
  2022-06-28 10:33 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #21 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug target/80491] [10/11/12/13 Regression] Compiler regression for long-add case.
       [not found] <bug-80491-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2022-05-27  9:37 ` [Bug target/80491] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:33 ` jakub at gcc dot gnu.org
  2022-06-28 10:45 ` zimmerma+gcc at loria dot fr
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #22 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug target/80491] [10/11/12/13 Regression] Compiler regression for long-add case.
       [not found] <bug-80491-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2022-06-28 10:33 ` jakub at gcc dot gnu.org
@ 2022-06-28 10:45 ` zimmerma+gcc at loria dot fr
  2023-07-07 10:32 ` [Bug target/80491] [11/12/13/14 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2022-06-28 10:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 from Paul Zimmermann <zimmerma+gcc at loria dot fr> ---
for the record here is what I get with the code from comment 20 with gcc 11.3.0
from Debian on a x86_64:

$ gcc -S -O1 test.cc -o- 
        .file   "test.cc"
        .text
        .globl  _Z3addR4pairS0_
        .type   _Z3addR4pairS0_, @function
_Z3addR4pairS0_:
.LFB0:
        .cfi_startproc
        movq    (%rdi), %rax
        movq    8(%rdi), %rdx
        addq    (%rsi), %rax
        adcq    8(%rsi), %rdx
        ret
        .cfi_endproc
.LFE0:
        .size   _Z3addR4pairS0_, .-_Z3addR4pairS0_
        .globl  _Z4add1R4pairS0_
        .type   _Z4add1R4pairS0_, @function
_Z4add1R4pairS0_:
.LFB1:
        .cfi_startproc
        movq    (%rsi), %rax
        addq    (%rdi), %rax
        setc    %cl
        movzbl  %cl, %ecx
        movq    8(%rdi), %rdx
        addq    8(%rsi), %rdx
        addq    %rcx, %rdx
        ret
        .cfi_endproc
.LFE1:
        .size   _Z4add1R4pairS0_, .-_Z4add1R4pairS0_
        .ident  "GCC: (Debian 11.3.0-3) 11.3.0"
        .section        .note.GNU-stack,"",@progbits

$ gcc -S -O3 test.cc -o- 
        .file   "test.cc"
        .text
        .p2align 4
        .globl  _Z3addR4pairS0_
        .type   _Z3addR4pairS0_, @function
_Z3addR4pairS0_:
.LFB0:
        .cfi_startproc
        movq    (%rsi), %rax
        xorl    %ecx, %ecx
        addq    (%rdi), %rax
        setc    %cl
        movq    8(%rdi), %rdx
        addq    8(%rsi), %rdx
        addq    %rcx, %rdx
        ret
        .cfi_endproc
.LFE0:
        .size   _Z3addR4pairS0_, .-_Z3addR4pairS0_
        .p2align 4
        .globl  _Z4add1R4pairS0_
        .type   _Z4add1R4pairS0_, @function
_Z4add1R4pairS0_:
.LFB1:
        .cfi_startproc
        movq    (%rsi), %rax
        xorl    %ecx, %ecx
        addq    (%rdi), %rax
        setc    %cl
        movq    8(%rdi), %rdx
        addq    8(%rsi), %rdx
        addq    %rcx, %rdx
        ret
        .cfi_endproc
.LFE1:
        .size   _Z4add1R4pairS0_, .-_Z4add1R4pairS0_
        .ident  "GCC: (Debian 11.3.0-3) 11.3.0"
        .section        .note.GNU-stack,"",@progbits

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

* [Bug target/80491] [11/12/13/14 Regression] Compiler regression for long-add case.
       [not found] <bug-80491-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2022-06-28 10:45 ` zimmerma+gcc at loria dot fr
@ 2023-07-07 10:32 ` rguenth at gcc dot gnu.org
  2023-08-03 22:08 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #24 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

* [Bug target/80491] [11/12/13/14 Regression] Compiler regression for long-add case.
       [not found] <bug-80491-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2023-07-07 10:32 ` [Bug target/80491] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2023-08-03 22:08 ` pinskia at gcc dot gnu.org
  2024-02-21  7:07 ` pinskia at gcc dot gnu.org
  2024-03-12 13:37 ` [Bug target/80491] [11/12/13 " law at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-03 22:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #25 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Hmm, I thought Jakub's recent work on PR 79173 would have fixed this but no it
didn't.

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

* [Bug target/80491] [11/12/13/14 Regression] Compiler regression for long-add case.
       [not found] <bug-80491-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2023-08-03 22:08 ` pinskia at gcc dot gnu.org
@ 2024-02-21  7:07 ` pinskia at gcc dot gnu.org
  2024-03-12 13:37 ` [Bug target/80491] [11/12/13 " law at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-21  7:07 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-bisection

--- Comment #26 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #25)
> Hmm, I thought Jakub's recent work on PR 79173 would have fixed this but no
> it didn't.

But it does now, we get at -O2/-O3:
```
_Z3addR4pairS0_:
.LFB0:
        .cfi_startproc
        movq    (%rsi), %rax
        addq    (%rdi), %rax
        movq    %rax, %rdx
        movq    8(%rsi), %rax
        adcq    8(%rdi), %rax
        xchgq   %rdx, %rax
        ret
```
Which is definitely better.

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

* [Bug target/80491] [11/12/13 Regression] Compiler regression for long-add case.
       [not found] <bug-80491-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2024-02-21  7:07 ` pinskia at gcc dot gnu.org
@ 2024-03-12 13:37 ` law at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-12 13:37 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org
            Summary|[11/12/13/14 Regression]    |[11/12/13 Regression]
                   |Compiler regression for     |Compiler regression for
                   |long-add case.              |long-add case.

--- Comment #27 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Per c#26.  Adjusting regression marker.

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

end of thread, other threads:[~2024-03-12 13:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-80491-4@http.gcc.gnu.org/bugzilla/>
2021-09-21  7:22 ` [Bug target/80491] [9/10/11/12 Regression] Compiler regression for long-add case pinskia at gcc dot gnu.org
2021-09-21  7:25 ` pinskia at gcc dot gnu.org
2022-05-27  9:37 ` [Bug target/80491] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:33 ` jakub at gcc dot gnu.org
2022-06-28 10:45 ` zimmerma+gcc at loria dot fr
2023-07-07 10:32 ` [Bug target/80491] [11/12/13/14 " rguenth at gcc dot gnu.org
2023-08-03 22:08 ` pinskia at gcc dot gnu.org
2024-02-21  7:07 ` pinskia at gcc dot gnu.org
2024-03-12 13:37 ` [Bug target/80491] [11/12/13 " law 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).