This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/33663] New: local register variable and memcmp


I found "unable to find a register to spill in class 'SIREG'" error by
following example.

% cat tst.c
void fun(void)
{
  register int val1 asm("esi");
  int val2;

  if (val2) {
    val2 = memcmp((void*)1, (void*)2, 3);
  }
  baz(val1, val2);
}

% gcc -v -O2 -c tst.c
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.2.1/configure --prefix=/home/src/gcc/gcc-4.2.1
--enable-languages=c
Thread model: posix
gcc version 4.2.1
 /home/src/gcc/gcc-4.2.1/libexec/gcc/i686-pc-linux-gnu/4.2.1/cc1 -quiet -v
tst.c -quiet -dumpbase tst.c -mtune=generic -auxbase tst -O2 -version -o
/tmp/cctXZKrk.s
ignoring nonexistent directory
"/home/src/gcc/gcc-4.2.1/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /home/src/gcc/gcc-4.2.1/include
 /home/src/gcc/gcc-4.2.1/lib/gcc/i686-pc-linux-gnu/4.2.1/include
 /usr/include
End of search list.
GNU C version 4.2.1 (i686-pc-linux-gnu)
        compiled by GNU C version 4.2.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 192e817f7ff889e169228e9a0338c840
tst.c: In function 'fun':
tst.c:10: error: unable to find a register to spill in class 'SIREG'
tst.c:10: error: this is the insn:
(insn:HI 21 20 22 3 (parallel [
            (set (reg:CC 17 flags)
                (compare:CC (mem:BLK (reg/f:SI 0 ax [62]) [0 S3 A8])
                    (mem:BLK (reg/f:SI 5 di [63]) [0 S3 A8])))
            (use (reg:SI 2 cx [64]))
            (use (const_int 1 [0x1]))
            (use (reg:SI 19 dirflag))
            (clobber (reg/f:SI 0 ax [62]))
            (clobber (reg/f:SI 5 di [63]))
            (clobber (reg:SI 2 cx [64]))
        ]) 528 {*cmpstrnqi_nz_1} (insn_list:REG_DEP_TRUE 17
(insn_list:REG_DEP_TRUE 18 (insn_list:REG_DEP_TRUE 19 (insn_list:REG_DEP_TRUE
20 (nil)))))
    (expr_list:REG_DEAD (reg:SI 19 dirflag)
        (expr_list:REG_DEAD (reg:SI 2 cx [64])
            (expr_list:REG_DEAD (reg/f:SI 0 ax [62])
                (expr_list:REG_DEAD (reg/f:SI 5 di [63])
                    (expr_list:REG_UNUSED (reg:SI 2 cx [64])
                        (expr_list:REG_UNUSED (reg/f:SI 5 di [63])
                            (expr_list:REG_UNUSED (reg/f:SI 0 ax [62])
                                (expr_list:REG_EQUAL (compare:CC (mem:BLK
(const_int 1 [0x1]) [0 S3 A8])
                                        (mem:BLK (const_int 2 [0x2]) [0 S3
A8]))
                                    (nil))))))))))
tst.c:10: confused by earlier errors, bailing out


-- 
           Summary: local register variable and memcmp
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: akr at m17n dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]