From 7314c7dd6297c6e7ebb823c1e3589c246f9349b5 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 5 Sep 2008 16:39:40 +0100 Subject: [PATCH] mips.h (enum reg_class): Add FRAME_REGS. * config/mips/mips.h (enum reg_class): Add FRAME_REGS. (REG_CLASS_NAMES): Update. (REG_CLASS_CONTENTS): Update. * config/mips/mips.c (mips_regno_to_class): Use FRAME_REGS instead of ALL_REGS for regs 77 and 78. * function.c (instantiate_virtual_regs_in_insn): Assert that return value of simplify_gen_subreg is not NULL. testsuite: * gcc.c-torture/compile/20080903-1.c: New test. From-SVN: r140035 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/mips/mips.c | 2 +- gcc/config/mips/mips.h | 5 ++++- gcc/function.c | 1 + gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.c-torture/compile/20080903-1.c | 12 ++++++++++++ 6 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/20080903-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 04cd7f8..1c9daf2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2008-09-05 Joseph Myers + + * config/mips/mips.h (enum reg_class): Add FRAME_REGS. + (REG_CLASS_NAMES): Update. + (REG_CLASS_CONTENTS): Update. + * config/mips/mips.c (mips_regno_to_class): Use FRAME_REGS instead + of ALL_REGS for regs 77 and 78. + * function.c (instantiate_virtual_regs_in_insn): Assert that + return value of simplify_gen_subreg is not NULL. + 2008-09-05 Paolo Bonzini * emit-rtl.c (gen_rtvec): Rewrite not using gen_rtvec_v. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index fd0101b..33f7e87 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -502,7 +502,7 @@ const enum reg_class mips_regno_to_class[FIRST_PSEUDO_REGISTER] = { MD0_REG, MD1_REG, NO_REGS, ST_REGS, ST_REGS, ST_REGS, ST_REGS, ST_REGS, ST_REGS, ST_REGS, ST_REGS, NO_REGS, - NO_REGS, ALL_REGS, ALL_REGS, NO_REGS, + NO_REGS, FRAME_REGS, FRAME_REGS, NO_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 1a9b542..4145699 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -1791,6 +1791,7 @@ enum reg_class ST_REGS, /* status registers (fp status) */ DSP_ACC_REGS, /* DSP accumulator registers */ ACC_REGS, /* Hi/Lo and DSP accumulator registers */ + FRAME_REGS, /* $arg and $frame */ ALL_REGS, /* all registers */ LIM_REG_CLASSES /* max value + 1 */ }; @@ -1832,6 +1833,7 @@ enum reg_class "ST_REGS", \ "DSP_ACC_REGS", \ "ACC_REGS", \ + "FRAME_REGS", \ "ALL_REGS" \ } @@ -1874,7 +1876,8 @@ enum reg_class { 0x00000000, 0x00000000, 0x000007f8, 0x00000000, 0x00000000, 0x00000000 }, /* status registers */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003f0000 }, /* dsp accumulator registers */ \ { 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x003f0000 }, /* hi/lo and dsp accumulator registers */ \ - { 0xffffffff, 0xffffffff, 0xffff07ff, 0xffffffff, 0xffffffff, 0x0fffffff } /* all registers */ \ + { 0x00000000, 0x00000000, 0x00006000, 0x00000000, 0x00000000, 0x00000000 }, /* frame registers */ \ + { 0xffffffff, 0xffffffff, 0xffff67ff, 0xffffffff, 0xffffffff, 0x0fffffff } /* all registers */ \ } diff --git a/gcc/function.c b/gcc/function.c index da26dc7..8f614b6 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1515,6 +1515,7 @@ instantiate_virtual_regs_in_insn (rtx insn) } x = simplify_gen_subreg (recog_data.operand_mode[i], new_rtx, GET_MODE (new_rtx), SUBREG_BYTE (x)); + gcc_assert (x); break; default: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4c683eb..3278ced 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-09-05 Joseph Myers + + * gcc.c-torture/compile/20080903-1.c: New test. + 2008-09-05 Daniel Kraft PR fortran/36746 diff --git a/gcc/testsuite/gcc.c-torture/compile/20080903-1.c b/gcc/testsuite/gcc.c-torture/compile/20080903-1.c new file mode 100644 index 0000000..180b926 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20080903-1.c @@ -0,0 +1,12 @@ +struct bar { unsigned short length; }; + +int +dummy(void) +{ + char c[4096]; + struct bar *a; + struct bar *b; + + a->length = ((char *) b - c); + return 0; +} -- 2.7.4