* [Bug c/104627] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
@ 2022-02-21 23:16 ` pinskia at gcc dot gnu.org
2022-02-21 23:50 ` segher at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-21 23:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't see any changes in the C front-end that would have caused this
diagnostic difference even.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/104627] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
2022-02-21 23:16 ` [Bug c/104627] " pinskia at gcc dot gnu.org
@ 2022-02-21 23:50 ` segher at gcc dot gnu.org
2022-02-21 23:56 ` [Bug c/104627] [12 Regression] " pinskia at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: segher at gcc dot gnu.org @ 2022-02-21 23:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
It started somewhere in the last four days:
-Compiler version: 12.0.1 20220217 (experimental) (GCC)
+Compiler version: 12.0.1 20220221 (experimental) (GCC)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/104627] [12 Regression] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
2022-02-21 23:16 ` [Bug c/104627] " pinskia at gcc dot gnu.org
2022-02-21 23:50 ` segher at gcc dot gnu.org
@ 2022-02-21 23:56 ` pinskia at gcc dot gnu.org
2022-02-22 10:32 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-21 23:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |12.0
Summary|New failure in deprecated.c |[12 Regression] New failure
| |in deprecated.c
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I had missed r12-7287-g1b71bc7c8b18bd1b .
Which I suspect caused this testcase to regress.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/104627] [12 Regression] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
` (2 preceding siblings ...)
2022-02-21 23:56 ` [Bug c/104627] [12 Regression] " pinskia at gcc dot gnu.org
@ 2022-02-22 10:32 ` rguenth at gcc dot gnu.org
2022-02-22 11:59 ` segher at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-22 10:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
Keywords| |diagnostic
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/104627] [12 Regression] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
` (3 preceding siblings ...)
2022-02-22 10:32 ` rguenth at gcc dot gnu.org
@ 2022-02-22 11:59 ` segher at gcc dot gnu.org
2022-02-24 14:25 ` marxin at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: segher at gcc dot gnu.org @ 2022-02-22 11:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
--- Comment #4 from Segher Boessenkool <segher at gcc dot gnu.org> ---
The old warning was more helpful and specific, it would be nice if we could
have that back.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/104627] [12 Regression] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
` (4 preceding siblings ...)
2022-02-22 11:59 ` segher at gcc dot gnu.org
@ 2022-02-24 14:25 ` marxin at gcc dot gnu.org
2022-02-28 11:23 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-02-24 14:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2022-02-24
Status|UNCONFIRMED |NEW
CC| |jason at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/104627] [12 Regression] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
` (5 preceding siblings ...)
2022-02-24 14:25 ` marxin at gcc dot gnu.org
@ 2022-02-28 11:23 ` jakub at gcc dot gnu.org
2022-02-28 12:29 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-28 11:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
On e.g.
struct A {};
struct __attribute__((deprecated)) B {};
typedef struct A C __attribute__((deprecated));
void f1 (struct A *);
void f2 (struct B *);
void f3 (C *);
void f4 (const struct A *);
void f5 (const struct B *);
void f6 (const C *);
the r12-7287 change when compiled by C++ differs just with one extra
+aaa.c:2:36: note: declared here
+ 2 | struct __attribute__((deprecated)) B {};
+ | ^
which wasn't there before, but in C changes:
-aaa.c:6:1: warning: ‘C’ is deprecated [-Wdeprecated-declarations]
+aaa.c:6:1: warning: ‘A’ is deprecated [-Wdeprecated-declarations]
and
-aaa.c:9:1: warning: ‘C’ is deprecated [-Wdeprecated-declarations]
+aaa.c:9:1: warning: ‘A’ is deprecated [-Wdeprecated-declarations]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/104627] [12 Regression] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
` (6 preceding siblings ...)
2022-02-28 11:23 ` jakub at gcc dot gnu.org
@ 2022-02-28 12:29 ` jakub at gcc dot gnu.org
2022-03-01 9:59 ` ro at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-28 12:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
2022-02-28 Jakub Jelinek <jakub@redhat.com>
PR c/104627
* tree.cc (warn_deprecated_use): For types prefer to use node
and only use TYPE_MAIN_VARIANT (node) if TYPE_STUB_DECL (node) is
NULL.
--- gcc/tree.cc.jj 2022-02-18 12:38:06.172391744 +0100
+++ gcc/tree.cc 2022-02-28 13:17:57.223216010 +0100
@@ -12047,8 +12047,11 @@ warn_deprecated_use (tree node, tree att
attr = DECL_ATTRIBUTES (node);
else if (TYPE_P (node))
{
- tree decl = TYPE_STUB_DECL (TYPE_MAIN_VARIANT (node));
+ tree decl = TYPE_STUB_DECL (node);
if (decl)
+ attr = TYPE_ATTRIBUTES (TREE_TYPE (decl));
+ else if ((decl = TYPE_STUB_DECL (TYPE_MAIN_VARIANT (node)))
+ != NULL_TREE)
{
node = TREE_TYPE (decl);
attr = TYPE_ATTRIBUTES (node);
keeps the previous C behavior for gcc.dg/deprecated.c and the #c5 testcase,
while
maintains the C++ behavior for deprecated-16.C and the #c5 testcase.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/104627] [12 Regression] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
` (7 preceding siblings ...)
2022-02-28 12:29 ` jakub at gcc dot gnu.org
@ 2022-03-01 9:59 ` ro at gcc dot gnu.org
2022-03-04 8:54 ` cvs-commit at gcc dot gnu.org
2022-03-04 8:56 ` jakub at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: ro at gcc dot gnu.org @ 2022-03-01 9:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
Rainer Orth <ro at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |seurer at gcc dot gnu.org
--- Comment #7 from Rainer Orth <ro at gcc dot gnu.org> ---
*** Bug 104599 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/104627] [12 Regression] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
` (8 preceding siblings ...)
2022-03-01 9:59 ` ro at gcc dot gnu.org
@ 2022-03-04 8:54 ` cvs-commit at gcc dot gnu.org
2022-03-04 8:56 ` jakub at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-04 8:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
--- Comment #8 from CVS 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:49bc9c6c1ef9441c3db586882e1985da3be9cfa1
commit r12-7473-g49bc9c6c1ef9441c3db586882e1985da3be9cfa1
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Mar 4 09:53:36 2022 +0100
tree: Fix up warn_deprecated_use [PR104627]
The r12-7287-g1b71bc7c8b18bd1b change improved the -Wdeprecated
warning for C++, but regressed it for C, in particular in
gcc.dg/deprecated.c testcase we now report a type that actually isn't
deprecated as deprecated instead of the one that is deprecated.
The following change tries to find the middle ground between what
we used to do before and what r12-7287 change does.
If TYPE_STUB_DECL (node) is non-NULL (that is what happens with
those C tests), then it will do what it used to do before (just smarter,
there is no need to lookup_attribute when it is called again a few lines
below this), if it is NULL, it will try
TYPE_STUB_DECL (TYPE_MAIN_VARIANT (node)) - what the deprecated-16.C
test needs.
2022-03-04 Jakub Jelinek <jakub@redhat.com>
PR c/104627
* tree.cc (warn_deprecated_use): For types prefer to use node
and only use TYPE_MAIN_VARIANT (node) if TYPE_STUB_DECL (node) is
NULL.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/104627] [12 Regression] New failure in deprecated.c
2022-02-21 23:08 [Bug c/104627] New: New failure in deprecated.c segher at gcc dot gnu.org
` (9 preceding siblings ...)
2022-03-04 8:54 ` cvs-commit at gcc dot gnu.org
@ 2022-03-04 8:56 ` jakub at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-04 8:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104627
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Status|NEW |RESOLVED
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread