public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/114042] New: diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg()
@ 2024-02-22 5:32 zsojka at seznam dot cz
2024-02-22 7:25 ` [Bug c/114042] " pinskia at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2024-02-22 5:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114042
Bug ID: 114042
Summary: diagnostics about __builtin_stdc_bit_ceil() mentions
__builtin_clzg()
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: zsojka at seznam dot cz
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Created attachment 57487
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57487&action=edit
reduced testcase
Compiler output:
$ gcc-14 bc.c
bc.c: In function ‘foo’:
bc.c:4:36: error: argument 1 in call to function ‘__builtin_clzg’ has signed
type
4 | return __builtin_stdc_bit_ceil(i);
| ^
but it should talk about __builtin_stdc_bit_ceil()
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/114042] diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg()
2024-02-22 5:32 [Bug c/114042] New: diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg() zsojka at seznam dot cz
@ 2024-02-22 7:25 ` pinskia at gcc dot gnu.org
2024-02-22 8:29 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-22 7:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114042
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2024-02-22
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/114042] diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg()
2024-02-22 5:32 [Bug c/114042] New: diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg() zsojka at seznam dot cz
2024-02-22 7:25 ` [Bug c/114042] " pinskia at gcc dot gnu.org
@ 2024-02-22 8:29 ` jakub at gcc dot gnu.org
2024-02-22 8:31 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-22 8:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114042
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
No idea how we could do that, __builtin_stdc_bit* is intentionally lowered very
early, so the diagnostics doesn't know it is not __builtin_clzg.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/114042] diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg()
2024-02-22 5:32 [Bug c/114042] New: diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg() zsojka at seznam dot cz
2024-02-22 7:25 ` [Bug c/114042] " pinskia at gcc dot gnu.org
2024-02-22 8:29 ` jakub at gcc dot gnu.org
@ 2024-02-22 8:31 ` jakub at gcc dot gnu.org
2024-02-22 17:30 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-22 8:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114042
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Sure, we could repeat some of the checks we do for __builtin_clzg etc. before
we lower __builtin_stdc_*, but wouldn't that be a maintainance nightmare?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/114042] diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg()
2024-02-22 5:32 [Bug c/114042] New: diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg() zsojka at seznam dot cz
` (2 preceding siblings ...)
2024-02-22 8:31 ` jakub at gcc dot gnu.org
@ 2024-02-22 17:30 ` jakub at gcc dot gnu.org
2024-02-26 15:31 ` cvs-commit at gcc dot gnu.org
2024-02-26 15:31 ` jakub at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-22 17:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114042
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 57502
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57502&action=edit
gcc14-pr114042.patch
Actually it isn't that bad.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/114042] diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg()
2024-02-22 5:32 [Bug c/114042] New: diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg() zsojka at seznam dot cz
` (3 preceding siblings ...)
2024-02-22 17:30 ` jakub at gcc dot gnu.org
@ 2024-02-26 15:31 ` cvs-commit at gcc dot gnu.org
2024-02-26 15:31 ` jakub at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-26 15:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114042
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:77576915cfd26e603aba5295dfdac54a5545f5f2
commit r14-9184-g77576915cfd26e603aba5295dfdac54a5545f5f2
Author: Jakub Jelinek <jakub@redhat.com>
Date: Mon Feb 26 16:30:16 2024 +0100
c: Improve some diagnostics for __builtin_stdc_bit_* [PR114042]
The PR complains that for the __builtin_stdc_bit_* "builtins" the
diagnostics doesn't mention the name of the builtin the user used, but
instead __builtin_{clz,ctz,popcount}g instead (which is what the FE
immediately lowers it to).
The following patch repeats the checks from
check_builtin_function_arguments
which are there done on BUILT_IN_{CLZ,CTZ,POPCOUNT}G, such that they
diagnose it with the name of the "builtin" user actually used before it
is gone.
2024-02-26 Jakub Jelinek <jakub@redhat.com>
PR c/114042
* c-parser.cc (c_parser_postfix_expression): Diagnose
__builtin_stdc_bit_* argument with ENUMERAL_TYPE or BOOLEAN_TYPE
type or if signed here rather than on the replacement builtins
in check_builtin_function_arguments.
* gcc.dg/builtin-stdc-bit-2.c: Adjust testcase for actual builtin
names rather than names of builtin replacements.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/114042] diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg()
2024-02-22 5:32 [Bug c/114042] New: diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg() zsojka at seznam dot cz
` (4 preceding siblings ...)
2024-02-26 15:31 ` cvs-commit at gcc dot gnu.org
@ 2024-02-26 15:31 ` jakub at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-26 15:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114042
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-02-26 15:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-22 5:32 [Bug c/114042] New: diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg() zsojka at seznam dot cz
2024-02-22 7:25 ` [Bug c/114042] " pinskia at gcc dot gnu.org
2024-02-22 8:29 ` jakub at gcc dot gnu.org
2024-02-22 8:31 ` jakub at gcc dot gnu.org
2024-02-22 17:30 ` jakub at gcc dot gnu.org
2024-02-26 15:31 ` cvs-commit at gcc dot gnu.org
2024-02-26 15:31 ` jakub 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).