public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter
@ 2020-11-19  0:46 Jonathan.Strobl at gmx dot de
  2020-11-19  0:49 ` [Bug c++/97900] " Jonathan.Strobl at gmx dot de
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Jonathan.Strobl at gmx dot de @ 2020-11-19  0:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97900
           Summary: g++ crashes when instantiating a templated function
                    with a template-type vector parameter
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Jonathan.Strobl at gmx dot de
  Target Milestone: ---

Dear GCC maintainers, I have managed to crash the compiler with the following
template instantiation. This happens on version 10.2.0 (on Debian Testing), as
well as on 11.0.0 20201114 (experimental) on compiler explorer:
https://godbolt.org/z/57xYb7

g++ -x c++ - <<EOF  
template<typename T>
T test(T __attribute__((vector_size(2 * sizeof(T)))) vec) {
    return vec[0] + vec[1];
}
typedef int v2si __attribute__((vector_size(2 * sizeof(int))));
int run(v2si vec) {
    return test<int>(vec);
}
EOF


I have attached the output of "gcc -v" as well as the full backtrace. Thank you
very much for your support.

Yours sincerely,
Jonathan Strobl

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

* [Bug c++/97900] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
@ 2020-11-19  0:49 ` Jonathan.Strobl at gmx dot de
  2020-11-19  1:25 ` mpolacek at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Jonathan.Strobl at gmx dot de @ 2020-11-19  0:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Strobl <Jonathan.Strobl at gmx dot de> ---
Created attachment 49593
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49593&action=edit
gcc -v and crash output

Attaching the output seems to have failed last time. Here it is.

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

* [Bug c++/97900] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
  2020-11-19  0:49 ` [Bug c++/97900] " Jonathan.Strobl at gmx dot de
@ 2020-11-19  1:25 ` mpolacek at gcc dot gnu.org
  2020-11-19  1:26 ` [Bug c++/97900] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19  1:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.  Started with r266055.

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

* [Bug c++/97900] [9/10/11 Regression] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
  2020-11-19  0:49 ` [Bug c++/97900] " Jonathan.Strobl at gmx dot de
  2020-11-19  1:25 ` mpolacek at gcc dot gnu.org
@ 2020-11-19  1:26 ` mpolacek at gcc dot gnu.org
  2020-11-19  1:26 ` mpolacek at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19  1:26 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org
            Summary|g++ crashes when            |[9/10/11 Regression] g++
                   |instantiating a templated   |crashes when instantiating
                   |function with a             |a templated function with a
                   |template-type vector        |template-type vector
                   |parameter                   |parameter
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |9.4

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

* [Bug c++/97900] [9/10/11 Regression] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
                   ` (2 preceding siblings ...)
  2020-11-19  1:26 ` [Bug c++/97900] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
@ 2020-11-19  1:26 ` mpolacek at gcc dot gnu.org
  2021-04-02 18:35 ` jason at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19  1:26 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-11-19
     Ever confirmed|0                           |1

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

* [Bug c++/97900] [9/10/11 Regression] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
                   ` (3 preceding siblings ...)
  2020-11-19  1:26 ` mpolacek at gcc dot gnu.org
@ 2021-04-02 18:35 ` jason at gcc dot gnu.org
  2021-04-03  5:54 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-02 18:35 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

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

* [Bug c++/97900] [9/10/11 Regression] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
                   ` (4 preceding siblings ...)
  2021-04-02 18:35 ` jason at gcc dot gnu.org
@ 2021-04-03  5:54 ` cvs-commit at gcc dot gnu.org
  2021-04-04 15:56 ` [Bug c++/97900] [9/10 " jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-03  5:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:23be03a0f243a084a0fe03d0b96a3d045e1a2b65

commit r11-7965-g23be03a0f243a084a0fe03d0b96a3d045e1a2b65
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Apr 2 14:49:15 2021 -0400

    c++: dependent attribute on parameter [PR97900]

    We were copying attributes from the template to the instantiation without
    considering that they might be dependent.  To make sure that the new parms
    have the appropriate properties for the code pattern, let's just regenerate
    them.

    gcc/cp/ChangeLog:

            PR c++/97900
            * pt.c (regenerate_decl_from_template): tsubst_decl
            the parms.

    gcc/testsuite/ChangeLog:

            PR c++/97900
            * g++.dg/ext/vector40.C: New test.

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

* [Bug c++/97900] [9/10 Regression] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
                   ` (5 preceding siblings ...)
  2021-04-03  5:54 ` cvs-commit at gcc dot gnu.org
@ 2021-04-04 15:56 ` jason at gcc dot gnu.org
  2021-04-06  9:47 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-04 15:56 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10/11 Regression] g++    |[9/10 Regression] g++
                   |crashes when instantiating  |crashes when instantiating
                   |a templated function with a |a templated function with a
                   |template-type vector        |template-type vector
                   |parameter                   |parameter

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for GCC 11 so far.

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

* [Bug c++/97900] [9/10 Regression] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
                   ` (6 preceding siblings ...)
  2021-04-04 15:56 ` [Bug c++/97900] [9/10 " jason at gcc dot gnu.org
@ 2021-04-06  9:47 ` cvs-commit at gcc dot gnu.org
  2021-06-01  8:18 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-06  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:ffc2331d7994d7fabb1f6ebed931024a9bbe69f2

commit r11-8000-gffc2331d7994d7fabb1f6ebed931024a9bbe69f2
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Apr 6 11:46:32 2021 +0200

    testsuite: Fix up g++.dg/ext/vector40.C test

    The test FAILs on i686-linux due to -Wpsabi diagnostics.

    2021-04-06  Jakub Jelinek  <jakub@redhat.com>

            PR c++/97900
            * g++.dg/ext/vector40.C: Add -Wno-psabi -w to dg-options.

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

* [Bug c++/97900] [9/10 Regression] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
                   ` (7 preceding siblings ...)
  2021-04-06  9:47 ` cvs-commit at gcc dot gnu.org
@ 2021-06-01  8:18 ` rguenth at gcc dot gnu.org
  2022-05-27  9:43 ` [Bug c++/97900] [10 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug c++/97900] [10 Regression] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
                   ` (8 preceding siblings ...)
  2021-06-01  8:18 ` rguenth at gcc dot gnu.org
@ 2022-05-27  9:43 ` rguenth at gcc dot gnu.org
  2022-06-28 10:42 ` jakub at gcc dot gnu.org
  2023-07-07  9:12 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug c++/97900] [10 Regression] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
                   ` (9 preceding siblings ...)
  2022-05-27  9:43 ` [Bug c++/97900] [10 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:42 ` jakub at gcc dot gnu.org
  2023-07-07  9:12 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug c++/97900] [10 Regression] g++ crashes when instantiating a templated function with a template-type vector parameter
  2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
                   ` (10 preceding siblings ...)
  2022-06-28 10:42 ` jakub at gcc dot gnu.org
@ 2023-07-07  9:12 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |11.1.0
   Target Milestone|10.5                        |11.0
      Known to fail|                            |10.5.0
         Resolution|---                         |FIXED

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed in GCC 11.

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

end of thread, other threads:[~2023-07-07  9:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19  0:46 [Bug c++/97900] New: g++ crashes when instantiating a templated function with a template-type vector parameter Jonathan.Strobl at gmx dot de
2020-11-19  0:49 ` [Bug c++/97900] " Jonathan.Strobl at gmx dot de
2020-11-19  1:25 ` mpolacek at gcc dot gnu.org
2020-11-19  1:26 ` [Bug c++/97900] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
2020-11-19  1:26 ` mpolacek at gcc dot gnu.org
2021-04-02 18:35 ` jason at gcc dot gnu.org
2021-04-03  5:54 ` cvs-commit at gcc dot gnu.org
2021-04-04 15:56 ` [Bug c++/97900] [9/10 " jason at gcc dot gnu.org
2021-04-06  9:47 ` cvs-commit at gcc dot gnu.org
2021-06-01  8:18 ` rguenth at gcc dot gnu.org
2022-05-27  9:43 ` [Bug c++/97900] [10 " rguenth at gcc dot gnu.org
2022-06-28 10:42 ` jakub at gcc dot gnu.org
2023-07-07  9:12 ` rguenth 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).