public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/113262] New: ICE when using [[gnu::copy("")]] attribute
@ 2024-01-08  4:20 gabravier at gmail dot com
  2024-01-08  4:37 ` [Bug c/113262] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gabravier at gmail dot com @ 2024-01-08  4:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113262
           Summary: ICE when using [[gnu::copy("")]] attribute
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

int[[gnu::copy("")]]a;

This crashes trunk GCC with the following error:

<source>:1:1: internal compiler error: tree check: expected tree that contains
'decl minimal' structure, have 'integer_type' in handle_copy_attribute, at
c-family/c-attribs.cc:3150
    1 | int[[gnu::copy("")]]a;
      | ^~~
0x232d4fc internal_error(char const*, ...)
        ???:0
0x87efb9 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        ???:0
0x983af3 decl_attributes(tree_node**, tree_node*, int, tree_node*)
        ???:0
0x996328 finish_declspecs(c_declspecs*)
        ???:0
0xa1c31b c_parse_file()
        ???:0
0xa93da9 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

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

* [Bug c/113262] [11/12/13/14 Regression] ICE when using [[gnu::copy("")]] attribute
  2024-01-08  4:20 [Bug c/113262] New: ICE when using [[gnu::copy("")]] attribute gabravier at gmail dot com
@ 2024-01-08  4:37 ` pinskia at gcc dot gnu.org
  2024-01-08 20:55 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-08  4:37 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |11.1.0
   Last reconfirmed|                            |2024-01-08
   Target Milestone|---                         |11.5
     Ever confirmed|0                           |1
      Known to work|                            |10.5.0
             Status|UNCONFIRMED                 |NEW
            Summary|ICE when using              |[11/12/13/14 Regression]
                   |[[gnu::copy("")]] attribute |ICE when using
                   |                            |[[gnu::copy("")]] attribute

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, GCC 10 and before errored out correctly though with a bogus
location:
<source>:376772:107: error: 'copy' attribute argument cannot be a string

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

* [Bug c/113262] [11/12/13/14 Regression] ICE when using [[gnu::copy("")]] attribute
  2024-01-08  4:20 [Bug c/113262] New: ICE when using [[gnu::copy("")]] attribute gabravier at gmail dot com
  2024-01-08  4:37 ` [Bug c/113262] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
@ 2024-01-08 20:55 ` jakub at gcc dot gnu.org
  2024-01-08 21:22 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 20:55 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
Started to ICE with r10-4969-g1723e1bedb9545c45619c4023729755243524584

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

* [Bug c/113262] [11/12/13/14 Regression] ICE when using [[gnu::copy("")]] attribute
  2024-01-08  4:20 [Bug c/113262] New: ICE when using [[gnu::copy("")]] attribute gabravier at gmail dot com
  2024-01-08  4:37 ` [Bug c/113262] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
  2024-01-08 20:55 ` jakub at gcc dot gnu.org
@ 2024-01-08 21:22 ` jakub at gcc dot gnu.org
  2024-01-09 14:37 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-08 21:22 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 57010
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57010&action=edit
gcc14-pr113262.patch

Ugh, what a mess.  The function uses DECL_SOURCE_LOCATION (*node) heavily,
even when it allows to be present also on types.

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

* [Bug c/113262] [11/12/13/14 Regression] ICE when using [[gnu::copy("")]] attribute
  2024-01-08  4:20 [Bug c/113262] New: ICE when using [[gnu::copy("")]] attribute gabravier at gmail dot com
                   ` (2 preceding siblings ...)
  2024-01-08 21:22 ` jakub at gcc dot gnu.org
@ 2024-01-09 14:37 ` cvs-commit at gcc dot gnu.org
  2024-01-09 14:39 ` [Bug c/113262] [11/12/13 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-09 14:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:c9fc7f398e8b330ff12ec8a29bfa058b6daf6624

commit r14-7066-gc9fc7f398e8b330ff12ec8a29bfa058b6daf6624
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jan 9 15:37:04 2024 +0100

    c-family: copy attribute diagnostic fixes [PR113262]

    The copy attributes is allowed on decls as well as types and even has
    checks whether decl (set to *node) is DECL_P or TYPE_P, but for diagnostics
    unconditionally uses DECL_SOURCE_LOCATION (decl), which obviously only
works
    if it applies to a decl.

    2024-01-09  Jakub Jelinek  <jakub@redhat.com>

            PR c/113262
            * c-attribs.cc (handle_copy_attribute): Don't use
            DECL_SOURCE_LOCATION (decl) if decl is not DECL_P, use
input_location
            instead.  Formatting fixes.

            * gcc.dg/pr113262.c: New test.

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

* [Bug c/113262] [11/12/13 Regression] ICE when using [[gnu::copy("")]] attribute
  2024-01-08  4:20 [Bug c/113262] New: ICE when using [[gnu::copy("")]] attribute gabravier at gmail dot com
                   ` (3 preceding siblings ...)
  2024-01-09 14:37 ` cvs-commit at gcc dot gnu.org
@ 2024-01-09 14:39 ` jakub at gcc dot gnu.org
  2024-03-02  0:38 ` cvs-commit at gcc dot gnu.org
  2024-03-04 12:08 ` [Bug c/113262] [11/12 " jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-09 14:39 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12/13/14 Regression]    |[11/12/13 Regression] ICE
                   |ICE when using              |when using
                   |[[gnu::copy("")]] attribute |[[gnu::copy("")]] attribute

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed on the trunk.

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

* [Bug c/113262] [11/12/13 Regression] ICE when using [[gnu::copy("")]] attribute
  2024-01-08  4:20 [Bug c/113262] New: ICE when using [[gnu::copy("")]] attribute gabravier at gmail dot com
                   ` (4 preceding siblings ...)
  2024-01-09 14:39 ` [Bug c/113262] [11/12/13 " jakub at gcc dot gnu.org
@ 2024-03-02  0:38 ` cvs-commit at gcc dot gnu.org
  2024-03-04 12:08 ` [Bug c/113262] [11/12 " jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-02  0:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:7d49a382a6b1b08bda6761b93c27de13397aa630

commit r13-8381-g7d49a382a6b1b08bda6761b93c27de13397aa630
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jan 9 15:37:04 2024 +0100

    c-family: copy attribute diagnostic fixes [PR113262]

    The copy attributes is allowed on decls as well as types and even has
    checks whether decl (set to *node) is DECL_P or TYPE_P, but for diagnostics
    unconditionally uses DECL_SOURCE_LOCATION (decl), which obviously only
works
    if it applies to a decl.

    2024-01-09  Jakub Jelinek  <jakub@redhat.com>

            PR c/113262
            * c-attribs.cc (handle_copy_attribute): Don't use
            DECL_SOURCE_LOCATION (decl) if decl is not DECL_P, use
input_location
            instead.  Formatting fixes.

            * gcc.dg/pr113262.c: New test.

    (cherry picked from commit c9fc7f398e8b330ff12ec8a29bfa058b6daf6624)

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

* [Bug c/113262] [11/12 Regression] ICE when using [[gnu::copy("")]] attribute
  2024-01-08  4:20 [Bug c/113262] New: ICE when using [[gnu::copy("")]] attribute gabravier at gmail dot com
                   ` (5 preceding siblings ...)
  2024-03-02  0:38 ` cvs-commit at gcc dot gnu.org
@ 2024-03-04 12:08 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-04 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12/13 Regression] ICE   |[11/12 Regression] ICE when
                   |when using                  |using [[gnu::copy("")]]
                   |[[gnu::copy("")]] attribute |attribute

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be now fixed for GCC 13.3+ too.

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

end of thread, other threads:[~2024-03-04 12:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-08  4:20 [Bug c/113262] New: ICE when using [[gnu::copy("")]] attribute gabravier at gmail dot com
2024-01-08  4:37 ` [Bug c/113262] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2024-01-08 20:55 ` jakub at gcc dot gnu.org
2024-01-08 21:22 ` jakub at gcc dot gnu.org
2024-01-09 14:37 ` cvs-commit at gcc dot gnu.org
2024-01-09 14:39 ` [Bug c/113262] [11/12/13 " jakub at gcc dot gnu.org
2024-03-02  0:38 ` cvs-commit at gcc dot gnu.org
2024-03-04 12:08 ` [Bug c/113262] [11/12 " 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).