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...

Reply via email to