[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-15 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 Hongtao.liu changed: What|Removed |Added CC||crazylht at gmail dot com --- Comment #16

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 Jakub Jelinek changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 --- Comment #14 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:29c46490de4616b911fccb34a9479f768fb51e94 commit r12-8141-g29c46490de4616b911fccb34a9479f768fb51e94 Author: Jakub Jelinek Date:

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 --- Comment #13 from Richard Biener --- (In reply to Jakub Jelinek from comment #10) > Created attachment 52796 [details] > gcc12-pr105253.patch > > Now in (untested) patch form. > Note, the kernel still should provide __popcount[sd]i2, but in

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 --- Comment #12 from Richard Biener --- (In reply to Jakub Jelinek from comment #9) > Ah, I see, expression_expensive_p is called, but > number_of_iterations_popcount when creating a CALL_EXPR only cares about > TYPE_PRECISION and happily create

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 Jakub Jelinek changed: What|Removed |Added Target Milestone|--- |12.0 Priority|P3

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 --- Comment #11 from Jakub Jelinek --- This is a regression (as in we don't want such a call in that case for performance reasons and in the past we didn't emit it).

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Assignee|unassigned

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 --- Comment #9 from Jakub Jelinek --- Ah, I see, expression_expensive_p is called, but number_of_iterations_popcount when creating a CALL_EXPR only cares about TYPE_PRECISION and happily creates __builtin_popcountl with unsigned long long argume

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 --- Comment #8 from Jakub Jelinek --- Reduced to just -O2: int foo (unsigned long long *p) { int i, cnt = 0; unsigned long long elem; for (i = 0; i < (256 / 64); i++) { elem = p[i]; for (; elem; cnt++) elem &= elem

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 --- Comment #7 from Richard Biener --- (In reply to Jakub Jelinek from comment #6) > Note, there is some code to not do this if we'd not expand the builtin inline > since r9-4030-g06a6b46a16f9287a98aa , so I wonder what changed. That only appli

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #6

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 --- Comment #5 from Richard Biener --- We're not checking for an optab here (that's on purpose IIRC). The code using the niter analysis result is responsible to do cost checking. The builtin is recognized via number_of_iterations_popcount. If

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 --- Comment #4 from Andrew Pinski --- With 12.0.1 20220213, I didn't get any popcountdi2 calls.

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-12 Thread raj.khem at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 --- Comment #3 from Khem Raj --- (In reply to Andrew Pinski from comment #1) > Two things. First the error message is for arm target but you then reference > x86_64 target options. > > Second there is a loop for popcount which gets translated b

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 Andrew Pinski changed: What|Removed |Added See Also||https://bugzilla.kernel.org

[Bug middle-end/105253] __popcountdi2 calls generated in kernel code with gcc12

2022-04-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253 Andrew Pinski changed: What|Removed |Added Target|x86_64 | --- Comment #1 from Andrew Pinski ---