Bug ID: 81724
           Summary: ICE in expand_stack_vars
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot
          Reporter: vries at gcc dot
  Target Milestone: ---

For nvptx, we see this ICE:
FAIL: gcc.dg/memcmp-1.c (internal compiler error)

In more detail:
during RTL pass: expand
gcc/testsuite/gcc.dg/strcmp-1.c: In function 'test_strcmp_3_1':
gcc/testsuite/gcc.dg/strcmp-1.c:13:13: internal compiler error: RTL check:
expected code 'const_int', have 'reg' in expand_stack_vars, at cfgexpand.c:1186
note: in expansion of macro 'DEF_TEST'
0x54f895 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)^M
0x6ea5e9 expand_stack_vars
0x6fa3d3 expand_used_vars
0x6fbee2 execute

The relevant part in expand_stack_vars is this:
          /* If there were any variables requiring "large" alignment, allocate  
             space.  */
          if (large_size > 0 && ! large_allocation_done)
              HOST_WIDE_INT loffset;
              rtx large_allocsize;

              large_allocsize = GEN_INT (large_size);
              get_dynamic_stack_size (&large_allocsize, 0, large_align, NULL);
              loffset = alloc_stack_frame_space
                (INTVAL (large_allocsize),
              large_base = get_dynamic_stack_base (loffset, large_align);
              large_allocation_done = true;
          gcc_assert (large_base != NULL);

The ICE happens because get_dynamic_stack_size returns a reg in
#6  0x00000000006ea5ea in expand_stack_vars (pred=pred@entry=0x0,
data=data@entry=0x7fffffffd440) at
1186                    (INTVAL (large_allocsize),
(gdb) call debug_rtx (large_allocsize)
(reg:DI 61)
while INTVAL (large_allocsize) expects an constant int.

Reply via email to