http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59471

            Bug ID: 59471
           Summary: ICE using vector extensions (non-top-level
                    BIT_FIELD_REF, IMAGPART_EXPR or REALPART_EXPR)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jgreenhalgh at gcc dot gnu.org

The following code:

typedef unsigned char uint8x8_t
  __attribute__ ((__vector_size__ (8)));

typedef unsigned short uint16x8_t
  __attribute__ ((__vector_size__ (16)));

typedef unsigned long uint64x2_t
  __attribute__ ((__vector_size__ (16)));

uint8x8_t
foo (uint16x8_t x)
{
  return (uint8x8_t) ((uint64x2_t) x)[0];
}

Will give this ICE for current trunk on AArch64, ARM and X86_64:

/work/build-x86/install/bin/gcc ../testcases/view-convert-expr.c -O3
../testcases/view-convert-expr.c: In function ‘foo’:
../testcases/view-convert-expr.c:11:1: error: non-top-level BIT_FIELD_REF,
IMAGPART_EXPR or REALPART_EXPR
 foo (uint16x8_t x)
 ^
BIT_FIELD_REF <VIEW_CONVERT_EXPR<vector(2) long unsigned int>(x), 64, 0>
../testcases/view-convert-expr.c:13:3: note: in statement
   return (uint8x8_t) ((uint64x2_t) x)[0];
   ^
D.1792 = VIEW_CONVERT_EXPR<uint8x8_t>(BIT_FIELD_REF
<VIEW_CONVERT_EXPR<vector(2) long unsigned int>(x), 64, 0>);
../testcases/view-convert-expr.c:11:1: internal compiler error: verify_gimple
failed
 foo (uint16x8_t x)
 ^
0x9b5a5a verify_gimple_in_cfg(function*)
    ../../src/gcc/gcc/tree-cfg.c:4837
0x8df347 execute_function_todo
    ../../src/gcc/gcc/passes.c:1847
0x8dfb73 execute_todo
    ../../src/gcc/gcc/passes.c:1877
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Looking at -fdump-tree-all-raw, I see this expression in
view-convert-expr.c.004t.gimple:

foo (uint16x8_t x)
gimple_bind <
  uint8x8_t D.1792;

  gimple_assign <view_convert_expr, D.1792,
VIEW_CONVERT_EXPR<uint8x8_t>(BIT_FIELD_REF <VIEW_CONVERT_EXPR<vector(2) long
unsigned int>(x), 64, 0>), NULL, NULL>
  gimple_return <D.1792 NULL>
>

For reference, my x86 compiler was configured as:

Configured with: ../src/gcc/configure --prefix=/work/build-x86/install

Reply via email to