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

            Bug ID: 97005
           Summary: [nvptx] FAIL:
                    c-c++-common/torture/builtin-arith-overflow-15.c   -O0
                     execution test
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Minimized to:
...
$ cat builtin-arith-overflow-15.c
int
main (void)
{
  signed char r;
  unsigned char y = (unsigned char) 0x80;

  if (__builtin_sub_overflow ((unsigned char)0,
                              (unsigned char)y,
                              &r))
    __builtin_abort ();

  return 0;
}
...

Compile like this:
...
$ ./build-gcc/gcc/xgcc \
    -B./build-gcc/gcc/ \
    builtin-arith-overflow-15.c \
    -O0  \
    -L./build-gcc/nvptx-none/./newlib \
    -mmainkernel \
    -o ./builtin-arith-overflow-15.exe
...

Run:
...
$ ./install/bin/nvptx-none-run ./builtin-arith-overflow-15.exe 
nvptx-run: error getting kernel result: an illegal instruction was encountered
(CUDA_ERROR_ILLEGAL_INSTRUCTION, 715)
...

Reply via email to