rs6000 store_multiple and -mstring

Will Cohen wcohen@redhat.com
Mon Aug 27 08:44:00 GMT 2001


This patch fixes a problem encounted with the "store_multiple" when the
"-mstring" option is used to compile code, e.g. for the linux kernel.
The rs6000 uses the store_multiple define_expand in the rs6000.md when
the "-mstring" flag is used. Unfortunately, the code generates invalid
rtl which causes the compiler to crash. I have included a small example
program, 20010827.i, which demonstrates that problem when the code is
compiled with "-mstring".

For the example I get the following output from gcc:

cc1 20010827.i  -mstring
 panic
20010827.c: In function `panic':
20010827.c:13: Unrecognizable insn:
(insn 7 6 8 (parallel[ 
            (set (mem:BLK (reg/f:SI 82) 0)
                (reg:SI 4 r4))
            (clobber (scratch:SI))
            (set (mem:SI (plus:SI (reg/f:SI 82)
                        (const_int 4 [0x4])) 0)
                (reg:SI 5 r5))
            (set (mem:SI (plus:SI (reg/f:SI 82)
                        (const_int 8 [0x8])) 0)
                (reg:SI 6 r6))
            (set (mem:SI (plus:SI (reg/f:SI 82)
                        (const_int 12 [0xc])) 0)
                (reg:SI 7 r7))
            (set (mem:SI (plus:SI (reg/f:SI 82)
                        (const_int 16 [0x10])) 0)
                (reg:SI 8 r8))
            (set (mem:SI (plus:SI (reg/f:SI 82)
                        (const_int 20 [0x14])) 0)
                (reg:SI 9 r9))
            (set (mem:SI (plus:SI (reg/f:SI 82)
                        (const_int 24 [0x18])) 0)
                (reg:SI 10 r10))
        ] ) -1 (nil)
    (expr_list:REG_DEAD (reg:SI 10 r10)
        (expr_list:REG_DEAD (reg:SI 9 r9)
            (expr_list:REG_DEAD (reg:SI 8 r8)
                (expr_list:REG_DEAD (reg:SI 7 r7)
                    (expr_list:REG_DEAD (reg:SI 6 r6)
                        (expr_list:REG_DEAD (reg:SI 5 r5)
                            (expr_list:REG_DEAD (reg:SI 4 r4)
                                (expr_list:REG_DEAD (reg/f:SI 82)
                                    (expr_list:REG_UNUSED (scratch:SI)
                                        (nil)))))))))))

20010827.c:13: Internal compiler error in extract_insn, at recog.c:2128
Please submit a full bug report,


I have a small patch that make the "store_multiple" define_expand
generate appropriate code. Below is the ChangeLog entry and the patch is
attached to this mail.

2001-08-27  Will Cohen  <wcohen@redhat.com>

	* config/rs6000/rs6000.md (store_multiple): Correct RTL
	generation for first set.

Okay to check in?

-Will
-- 
Will Cohen, GCC Engineer                         ------    ,__o
Red Hat, 2600 Meridian pkwy, Durham, NC 27713   ------   _-\_<,
Office (919)-547-0012 x390  Fax (919)-547-0024 ------   (*)/'(*)
# 1 "20010827.c"
# 1 "/dunes/wcohen/stdzd-tools/powerpc/powerpc-kernel-build/tools-install-stage2/powerpc-linux-010821/H-i686-pc-linux-gnulibc2.2/lib/gcc-lib/powerpc-linux-gnu/RedHat-3.1/include/stdarg.h" 1 3
# 43 "/dunes/wcohen/stdzd-tools/powerpc/powerpc-kernel-build/tools-install-stage2/powerpc-linux-010821/H-i686-pc-linux-gnulibc2.2/lib/gcc-lib/powerpc-linux-gnu/RedHat-3.1/include/stdarg.h" 3
typedef __builtin_va_list __gnuc_va_list;
# 110 "/dunes/wcohen/stdzd-tools/powerpc/powerpc-kernel-build/tools-install-stage2/powerpc-linux-010821/H-i686-pc-linux-gnulibc2.2/lib/gcc-lib/powerpc-linux-gnu/RedHat-3.1/include/stdarg.h" 3
typedef __gnuc_va_list va_list;
# 2 "20010827.c" 2

extern int vsprintf(char *buf, const char *, va_list);

void panic(const char * fmt, ...)
{
        static char buf[1024];
        va_list args;

        __builtin_stdarg_start((args),fmt);
        vsprintf(buf, fmt, args);
        __builtin_va_end(args);
}


More information about the Gcc-patches mailing list