public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/96426] New: __builtin_convertvector ICE without lhs
@ 2020-08-03  8:28 glisse at gcc dot gnu.org
  2020-08-03  8:58 ` [Bug middle-end/96426] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: glisse at gcc dot gnu.org @ 2020-08-03  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96426
           Summary: __builtin_convertvector ICE without lhs
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org
  Target Milestone: ---

typedef long long veci __attribute__((vector_size(16)));
typedef double vecf __attribute__((vector_size(16)));
void f(veci v){
  __builtin_convertvector(v,vecf);
}

$ gcc u.c
during GIMPLE pass: veclower
u.c: In function 'f':
u.c:3:6: internal compiler error: Segmentation fault
    3 | void f(veci v){
      |      ^

Found by inspection, I wanted to introduce another conversion-like IFN (not
pure) and didn't know where to store the result type in case the lhs is
missing. Here the easiest would be to skip the stmt if there is no lhs, even if
that's not perfect for -O0, but I am also interested in how to handle the
non-pure case, if you have ideas...

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

* [Bug middle-end/96426] __builtin_convertvector ICE without lhs
  2020-08-03  8:28 [Bug middle-end/96426] New: __builtin_convertvector ICE without lhs glisse at gcc dot gnu.org
@ 2020-08-03  8:58 ` rguenth at gcc dot gnu.org
  2020-08-04  9:33 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-08-03  8:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Guess you need explicit knowledge somewhere, if only with a fake argument...

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

* [Bug middle-end/96426] __builtin_convertvector ICE without lhs
  2020-08-03  8:28 [Bug middle-end/96426] New: __builtin_convertvector ICE without lhs glisse at gcc dot gnu.org
  2020-08-03  8:58 ` [Bug middle-end/96426] " rguenth at gcc dot gnu.org
@ 2020-08-04  9:33 ` cvs-commit at gcc dot gnu.org
  2020-08-04  9:46 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-04  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:95f5a3258dd8a9584f2b10304f79441ef2d4c64c

commit r11-2540-g95f5a3258dd8a9584f2b10304f79441ef2d4c64c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Aug 4 11:33:18 2020 +0200

    veclower: Don't ICE on .VEC_CONVERT calls with no lhs [PR96426]

    .VEC_CONVERT is a const internal call, so normally if the lhs is not used,
    we'd DCE it far before getting to veclower, but with -O0 (or perhaps
    -fno-tree-dce and some other -fno-* options) it can happen.
    But as the internal fn needs the lhs to know the type to which the
    conversion is done (and I think that is a reasonable representation, having
    some magic another argument and having to create constants with that type
    looks overkill to me), we just should DCE those calls ourselves.
    During veclower, we can't really remove insns, as the callers would be
    upset, so this just replaces it with a GIMPLE_NOP.

    2020-08-04  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/96426
            * tree-vect-generic.c (expand_vector_conversion): Replace
.VEC_CONVERT
            call with GIMPLE_NOP if there is no lhs.

            * gcc.c-torture/compile/pr96426.c: New test.

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

* [Bug middle-end/96426] __builtin_convertvector ICE without lhs
  2020-08-03  8:28 [Bug middle-end/96426] New: __builtin_convertvector ICE without lhs glisse at gcc dot gnu.org
  2020-08-03  8:58 ` [Bug middle-end/96426] " rguenth at gcc dot gnu.org
  2020-08-04  9:33 ` cvs-commit at gcc dot gnu.org
@ 2020-08-04  9:46 ` cvs-commit at gcc dot gnu.org
  2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-04  9:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:046501dc30f9b0fe31385698af4fd27b464af6ba

commit r10-8570-g046501dc30f9b0fe31385698af4fd27b464af6ba
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Aug 4 11:33:18 2020 +0200

    veclower: Don't ICE on .VEC_CONVERT calls with no lhs [PR96426]

    .VEC_CONVERT is a const internal call, so normally if the lhs is not used,
    we'd DCE it far before getting to veclower, but with -O0 (or perhaps
    -fno-tree-dce and some other -fno-* options) it can happen.
    But as the internal fn needs the lhs to know the type to which the
    conversion is done (and I think that is a reasonable representation, having
    some magic another argument and having to create constants with that type
    looks overkill to me), we just should DCE those calls ourselves.
    During veclower, we can't really remove insns, as the callers would be
    upset, so this just replaces it with a GIMPLE_NOP.

    2020-08-04  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/96426
            * tree-vect-generic.c (expand_vector_conversion): Replace
.VEC_CONVERT
            call with GIMPLE_NOP if there is no lhs.

            * gcc.c-torture/compile/pr96426.c: New test.

    (cherry picked from commit 95f5a3258dd8a9584f2b10304f79441ef2d4c64c)

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

* [Bug middle-end/96426] __builtin_convertvector ICE without lhs
  2020-08-03  8:28 [Bug middle-end/96426] New: __builtin_convertvector ICE without lhs glisse at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-08-04  9:46 ` cvs-commit at gcc dot gnu.org
@ 2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
  2021-08-07 19:59 ` pinskia at gcc dot gnu.org
  2021-08-07 19:59 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-16 19:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:3f804f63cde54ff94f35abd00953b050a4c861c7

commit r9-8905-g3f804f63cde54ff94f35abd00953b050a4c861c7
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Aug 4 11:33:18 2020 +0200

    veclower: Don't ICE on .VEC_CONVERT calls with no lhs [PR96426]

    .VEC_CONVERT is a const internal call, so normally if the lhs is not used,
    we'd DCE it far before getting to veclower, but with -O0 (or perhaps
    -fno-tree-dce and some other -fno-* options) it can happen.
    But as the internal fn needs the lhs to know the type to which the
    conversion is done (and I think that is a reasonable representation, having
    some magic another argument and having to create constants with that type
    looks overkill to me), we just should DCE those calls ourselves.
    During veclower, we can't really remove insns, as the callers would be
    upset, so this just replaces it with a GIMPLE_NOP.

    2020-08-04  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/96426
            * tree-vect-generic.c (expand_vector_conversion): Replace
.VEC_CONVERT
            call with GIMPLE_NOP if there is no lhs.

            * gcc.c-torture/compile/pr96426.c: New test.

    (cherry picked from commit 95f5a3258dd8a9584f2b10304f79441ef2d4c64c)

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

* [Bug middle-end/96426] __builtin_convertvector ICE without lhs
  2020-08-03  8:28 [Bug middle-end/96426] New: __builtin_convertvector ICE without lhs glisse at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
@ 2021-08-07 19:59 ` pinskia at gcc dot gnu.org
  2021-08-07 19:59 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-07 19:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug middle-end/96426] __builtin_convertvector ICE without lhs
  2020-08-03  8:28 [Bug middle-end/96426] New: __builtin_convertvector ICE without lhs glisse at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-08-07 19:59 ` pinskia at gcc dot gnu.org
@ 2021-08-07 19:59 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-07 19:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-08-07 19:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03  8:28 [Bug middle-end/96426] New: __builtin_convertvector ICE without lhs glisse at gcc dot gnu.org
2020-08-03  8:58 ` [Bug middle-end/96426] " rguenth at gcc dot gnu.org
2020-08-04  9:33 ` cvs-commit at gcc dot gnu.org
2020-08-04  9:46 ` cvs-commit at gcc dot gnu.org
2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
2021-08-07 19:59 ` pinskia at gcc dot gnu.org
2021-08-07 19:59 ` pinskia 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).