public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/114975] New: [AVR] Using popcounthi2 for 8-bit values despit popcountqi2
@ 2024-05-07 15:11 gjl at gcc dot gnu.org
  2024-05-08  8:41 ` [Bug middle-end/114975] [AVR] Using popcounthi2 for 8-bit values despite popcountqi2 cvs-commit at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gjl at gcc dot gnu.org @ 2024-05-07 15:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114975
           Summary: [AVR] Using popcounthi2 for 8-bit values despit
                    popcountqi2
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

C test case

typedef __UINT8_TYPE__ uint8_t;

uint8_t use_pop (uint8_t x)
{
    return __builtin_popcount (x);
}

compiles with

$ avr-gcc pop.c -Os -S

to:

use_pop:
        ldi r25,0
        rcall __popcounthi2
        ret

        .ident  "GCC: (GNU) 14.0.1 20240421 (experimental)"

despite libgcc providing __popcountqi2.

I am not even sure which component is supposed to treat this.  The tree
optimizers do only __builtin_popcount, and as there's nothing like popcount_u8
they cannot do anything about it.  So blaming the middle-end for now.

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

* [Bug middle-end/114975] [AVR] Using popcounthi2 for 8-bit values despite popcountqi2
  2024-05-07 15:11 [Bug middle-end/114975] New: [AVR] Using popcounthi2 for 8-bit values despit popcountqi2 gjl at gcc dot gnu.org
@ 2024-05-08  8:41 ` cvs-commit at gcc dot gnu.org
  2024-05-08  8:41 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-08  8:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Georg-Johann Lay <gjl@gcc.gnu.org>:

https://gcc.gnu.org/g:c8f4bbb824fafecf021a802324cd79e64b03b947

commit r15-317-gc8f4bbb824fafecf021a802324cd79e64b03b947
Author: Georg-Johann Lay <avr@gjlay.de>
Date:   Tue May 7 19:39:55 2024 +0200

    AVR: target/114975 - Add combine-pattern for __popcountqi2.

            PR target/114975
    gcc/
            * config/avr/avr.md: Add combine pattern for
            8-bit popcount detection.

    gcc/testsuite/
            * gcc.target/avr/pr114975-popcount.c: New test.

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

* [Bug middle-end/114975] [AVR] Using popcounthi2 for 8-bit values despite popcountqi2
  2024-05-07 15:11 [Bug middle-end/114975] New: [AVR] Using popcounthi2 for 8-bit values despit popcountqi2 gjl at gcc dot gnu.org
  2024-05-08  8:41 ` [Bug middle-end/114975] [AVR] Using popcounthi2 for 8-bit values despite popcountqi2 cvs-commit at gcc dot gnu.org
@ 2024-05-08  8:41 ` cvs-commit at gcc dot gnu.org
  2024-05-08  8:44 ` [Bug target/114975] " gjl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-08  8:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Georg-Johann Lay <gjl@gcc.gnu.org>:

https://gcc.gnu.org/g:41bc359c322d45ec1adfb51f7a45c7ef02ce6ca9

commit r15-318-g41bc359c322d45ec1adfb51f7a45c7ef02ce6ca9
Author: Georg-Johann Lay <avr@gjlay.de>
Date:   Tue May 7 19:42:30 2024 +0200

    AVR: target/114975 - Add combine-pattern for __parityqi2.

            PR target/114975
    gcc/
            * config/avr/avr.md: Add combine pattern for
            8-bit parity detection.

    gcc/testsuite/
            * gcc.target/avr/pr114975-parity.c: New test.

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

* [Bug target/114975] [AVR] Using popcounthi2 for 8-bit values despite popcountqi2
  2024-05-07 15:11 [Bug middle-end/114975] New: [AVR] Using popcounthi2 for 8-bit values despit popcountqi2 gjl at gcc dot gnu.org
  2024-05-08  8:41 ` [Bug middle-end/114975] [AVR] Using popcounthi2 for 8-bit values despite popcountqi2 cvs-commit at gcc dot gnu.org
  2024-05-08  8:41 ` cvs-commit at gcc dot gnu.org
@ 2024-05-08  8:44 ` gjl at gcc dot gnu.org
  2024-05-09  9:02 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: gjl at gcc dot gnu.org @ 2024-05-08  8:44 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
          Component|middle-end                  |target
   Target Milestone|---                         |15.0

--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Fixed in v15.

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

* [Bug target/114975] [AVR] Using popcounthi2 for 8-bit values despite popcountqi2
  2024-05-07 15:11 [Bug middle-end/114975] New: [AVR] Using popcounthi2 for 8-bit values despit popcountqi2 gjl at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-05-08  8:44 ` [Bug target/114975] " gjl at gcc dot gnu.org
@ 2024-05-09  9:02 ` cvs-commit at gcc dot gnu.org
  2024-05-09  9:02 ` cvs-commit at gcc dot gnu.org
  2024-05-09  9:03 ` gjl at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-09  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Georg-Johann Lay
<gjl@gcc.gnu.org>:

https://gcc.gnu.org/g:4ef09dd8ce8866e4f64dd918890c97a67af8fd15

commit r14-10187-g4ef09dd8ce8866e4f64dd918890c97a67af8fd15
Author: Georg-Johann Lay <avr@gjlay.de>
Date:   Tue May 7 19:39:55 2024 +0200

    AVR: target/114975 - Add combine-pattern for __popcountqi2.

            PR target/114975
    gcc/
            * config/avr/avr.md: Add combine pattern for
            8-bit popcount detection.

    gcc/testsuite/
            * gcc.target/avr/pr114975-popcount.c: New test.

    (cherry picked from commit c8f4bbb824fafecf021a802324cd79e64b03b947)

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

* [Bug target/114975] [AVR] Using popcounthi2 for 8-bit values despite popcountqi2
  2024-05-07 15:11 [Bug middle-end/114975] New: [AVR] Using popcounthi2 for 8-bit values despit popcountqi2 gjl at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-05-09  9:02 ` cvs-commit at gcc dot gnu.org
@ 2024-05-09  9:02 ` cvs-commit at gcc dot gnu.org
  2024-05-09  9:03 ` gjl at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-09  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Georg-Johann Lay
<gjl@gcc.gnu.org>:

https://gcc.gnu.org/g:bbb76ac0a06ae3a469f2acc2d5d63e63160bd9e5

commit r14-10188-gbbb76ac0a06ae3a469f2acc2d5d63e63160bd9e5
Author: Georg-Johann Lay <avr@gjlay.de>
Date:   Tue May 7 19:42:30 2024 +0200

    AVR: target/114975 - Add combine-pattern for __parityqi2.

            PR target/114975
    gcc/
            * config/avr/avr.md: Add combine pattern for
            8-bit parity detection.

    gcc/testsuite/
            * gcc.target/avr/pr114975-parity.c: New test.

    (cherry picked from commit 41bc359c322d45ec1adfb51f7a45c7ef02ce6ca9)

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

* [Bug target/114975] [AVR] Using popcounthi2 for 8-bit values despite popcountqi2
  2024-05-07 15:11 [Bug middle-end/114975] New: [AVR] Using popcounthi2 for 8-bit values despit popcountqi2 gjl at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-05-09  9:02 ` cvs-commit at gcc dot gnu.org
@ 2024-05-09  9:03 ` gjl at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: gjl at gcc dot gnu.org @ 2024-05-09  9:03 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|15.0                        |14.2

--- Comment #6 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Fixed in v14.2+

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

end of thread, other threads:[~2024-05-09  9:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-07 15:11 [Bug middle-end/114975] New: [AVR] Using popcounthi2 for 8-bit values despit popcountqi2 gjl at gcc dot gnu.org
2024-05-08  8:41 ` [Bug middle-end/114975] [AVR] Using popcounthi2 for 8-bit values despite popcountqi2 cvs-commit at gcc dot gnu.org
2024-05-08  8:41 ` cvs-commit at gcc dot gnu.org
2024-05-08  8:44 ` [Bug target/114975] " gjl at gcc dot gnu.org
2024-05-09  9:02 ` cvs-commit at gcc dot gnu.org
2024-05-09  9:02 ` cvs-commit at gcc dot gnu.org
2024-05-09  9:03 ` gjl 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).