* [Bug c++/108980] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
@ 2023-03-01 4:19 ` thiago at kde dot org
2023-03-01 4:20 ` [Bug tree-optimization/108980] " pinskia at gcc dot gnu.org
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: thiago at kde dot org @ 2023-03-01 4:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
--- Comment #1 from Thiago Macieira <thiago at kde dot org> ---
GCC 13 (trunk) built today.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
2023-03-01 4:19 ` [Bug c++/108980] " thiago at kde dot org
@ 2023-03-01 4:20 ` pinskia at gcc dot gnu.org
2023-03-01 4:26 ` [Bug tree-optimization/108980] [13 Regression] " pinskia at gcc dot gnu.org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-01 4:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The problem is obviously in array_bounds_checker::check_array_ref .
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
2023-03-01 4:19 ` [Bug c++/108980] " thiago at kde dot org
2023-03-01 4:20 ` [Bug tree-optimization/108980] " pinskia at gcc dot gnu.org
@ 2023-03-01 4:26 ` pinskia at gcc dot gnu.org
2023-03-01 4:27 ` pinskia at gcc dot gnu.org
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-01 4:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Warning text missing the |[13 Regression] Warning
|warning itself (GCC 13) |text missing the warning
| |itself (GCC 13)
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The logic is:
if (warned || out_of_bound)
{
if ((out_of_bound && warn_strict_flex_arrays)
&& (((sam == special_array_member::trail_0)
|| (sam == special_array_member::trail_1)
|| (sam == special_array_member::trail_n))
&& DECL_NOT_FLEXARRAY (afield_decl)))
warned = warning_at (location,
...
if (DECL_P (ref))
inform (DECL_SOURCE_LOCATION (ref), "while referencing %qD", ref);
if (rec && DECL_P (rec))
inform (DECL_SOURCE_LOCATION (rec), "defined here %qD", rec);
The checks before calling inform should include a check for warned .
Started with r13-4748-g2a27ae32fabf85 .
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (2 preceding siblings ...)
2023-03-01 4:26 ` [Bug tree-optimization/108980] [13 Regression] " pinskia at gcc dot gnu.org
@ 2023-03-01 4:27 ` pinskia at gcc dot gnu.org
2023-03-01 4:27 ` pinskia at gcc dot gnu.org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-01 4:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Target Milestone|--- |13.0
Ever confirmed|0 |1
Last reconfirmed| |2023-03-01
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (3 preceding siblings ...)
2023-03-01 4:27 ` pinskia at gcc dot gnu.org
@ 2023-03-01 4:27 ` pinskia at gcc dot gnu.org
2023-03-01 7:54 ` rguenth at gcc dot gnu.org
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-01 4:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 54562
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54562&action=edit
Patch which I think is correct but not 100% sure
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (4 preceding siblings ...)
2023-03-01 4:27 ` pinskia at gcc dot gnu.org
@ 2023-03-01 7:54 ` rguenth at gcc dot gnu.org
2023-03-01 18:02 ` thiago at kde dot org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-01 7:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu.org
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> Created attachment 54562 [details]
> Patch which I think is correct but not 100% sure
LGTM. Please test & post.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (5 preceding siblings ...)
2023-03-01 7:54 ` rguenth at gcc dot gnu.org
@ 2023-03-01 18:02 ` thiago at kde dot org
2023-03-01 18:34 ` thiago at kde dot org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: thiago at kde dot org @ 2023-03-01 18:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
--- Comment #6 from Thiago Macieira <thiago at kde dot org> ---
Testing.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (6 preceding siblings ...)
2023-03-01 18:02 ` thiago at kde dot org
@ 2023-03-01 18:34 ` thiago at kde dot org
2023-03-01 18:46 ` pinskia at gcc dot gnu.org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: thiago at kde dot org @ 2023-03-01 18:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
--- Comment #7 from Thiago Macieira <thiago at kde dot org> ---
The duplicate "note:" disappeared. But now there's no warning at all on the
same file, with the same options. Was that intended?
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (7 preceding siblings ...)
2023-03-01 18:34 ` thiago at kde dot org
@ 2023-03-01 18:46 ` pinskia at gcc dot gnu.org
2023-03-01 19:05 ` thiago at kde dot org
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-01 18:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Thiago Macieira from comment #7)
> The duplicate "note:" disappeared. But now there's no warning at all on the
> same file, with the same options. Was that intended?
Yes that was the intent of the patch. There is not supposed to be any warning
here at all. It was a mistake that an note (inform call) was emitted in the
first place.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (8 preceding siblings ...)
2023-03-01 18:46 ` pinskia at gcc dot gnu.org
@ 2023-03-01 19:05 ` thiago at kde dot org
2023-03-01 20:16 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: thiago at kde dot org @ 2023-03-01 19:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
--- Comment #9 from Thiago Macieira <thiago at kde dot org> ---
Ah, got it. That also explains why I couldn't find anything wrong with my code,
and nothing I did that could likely be it made the warning go away.
Thanks for the quick turnaround.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (9 preceding siblings ...)
2023-03-01 19:05 ` thiago at kde dot org
@ 2023-03-01 20:16 ` pinskia at gcc dot gnu.org
2023-03-01 23:27 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-01 20:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Mine, the patch which I am testing (and will be submitting) is different from
the attached one because there could be a case were the inner warning could
return false but we still want to emit the note as we did a warning before
hand.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (10 preceding siblings ...)
2023-03-01 20:16 ` pinskia at gcc dot gnu.org
@ 2023-03-01 23:27 ` pinskia at gcc dot gnu.org
2023-03-09 18:04 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-01 23:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
URL| |https://gcc.gnu.org/piperma
| |il/gcc-patches/2023-March/6
| |13130.html
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Patch submitted:
https://gcc.gnu.org/pipermail/gcc-patches/2023-March/613130.html
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (11 preceding siblings ...)
2023-03-01 23:27 ` pinskia at gcc dot gnu.org
@ 2023-03-09 18:04 ` pinskia at gcc dot gnu.org
2023-03-09 18:28 ` cvs-commit at gcc dot gnu.org
2023-03-09 18:29 ` pinskia at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-09 18:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
URL|https://gcc.gnu.org/piperma |https://gcc.gnu.org/piperma
|il/gcc-patches/2023-March/6 |il/gcc-patches/2023-March/6
|13130.html |13662.html
--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Updated patch for Jakub's comments:
https://gcc.gnu.org/pipermail/gcc-patches/2023-March/613662.html
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (12 preceding siblings ...)
2023-03-09 18:04 ` pinskia at gcc dot gnu.org
@ 2023-03-09 18:28 ` cvs-commit at gcc dot gnu.org
2023-03-09 18:29 ` pinskia at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-09 18:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:
https://gcc.gnu.org/g:c6232ba229a4fcd453b50f11351fcbd35296809c
commit r13-6559-gc6232ba229a4fcd453b50f11351fcbd35296809c
Author: Andrew Pinski <apinski@marvell.com>
Date: Wed Mar 1 11:13:21 2023 -0800
Fix PR 108980: note without warning due to array bounds check
The problem here is after r13-4748-g2a27ae32fabf85, in some
cases we were calling inform without a corresponding warning.
This changes the logic such that we only cause that to happen
if there was a warning happened before hand.
Changes since
* v1: Fix formating and dump message as suggested by Jakub.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
gcc/ChangeLog:
PR tree-optimization/108980
* gimple-array-bounds.cc (array_bounds_checker::check_array_ref):
Reorgnize the call to warning for not strict flexible arrays
to be before the check of warned.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/108980] [13 Regression] Warning text missing the warning itself (GCC 13)
2023-03-01 4:18 [Bug c++/108980] New: Warning text missing the warning itself (GCC 13) thiago at kde dot org
` (13 preceding siblings ...)
2023-03-09 18:28 ` cvs-commit at gcc dot gnu.org
@ 2023-03-09 18:29 ` pinskia at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-09 18:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108980
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 16+ messages in thread