From: rsandifo Date: Sat, 6 Aug 2005 11:05:48 +0000 (+0000) Subject: PR rtl-optimization/23233 X-Git-Tag: upstream/4.9.2~59335 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca8cce9fc2a2367248ffe52d526ce0bfbb1ed71b;p=platform%2Fupstream%2Flinaro-gcc.git PR rtl-optimization/23233 * loop.c (combine_movables): Require the modes to be the same. (move_movables): Remove handling of cases where the replacement had a different mode to the original. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102804 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index db61463..7f74051 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-08-06 Richard Sandiford + + PR rtl-optimization/23233 + * loop.c (combine_movables): Require the modes to be the same. + (move_movables): Remove handling of cases where the replacement + had a different mode to the original. + 2005-08-05 James A. Morrison PR tree-optimization/23128 diff --git a/gcc/loop.c b/gcc/loop.c index a904881..bc6ddec 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -1881,19 +1881,7 @@ combine_movables (struct loop_movables *movables, struct loop_regs *regs) && !m1->partial && (matched_regs[m1->regno] || - ( - /* Can combine regs with different modes loaded from the - same constant only if the modes are the same or - if both are integer modes with M wider or the same - width as M1. The check for integer is redundant, but - safe, since the only case of differing destination - modes with equal sources is when both sources are - VOIDmode, i.e., CONST_INT. */ - (GET_MODE (m->set_dest) == GET_MODE (m1->set_dest) - || (GET_MODE_CLASS (GET_MODE (m->set_dest)) == MODE_INT - && GET_MODE_CLASS (GET_MODE (m1->set_dest)) == MODE_INT - && (GET_MODE_BITSIZE (GET_MODE (m->set_dest)) - >= GET_MODE_BITSIZE (GET_MODE (m1->set_dest))))) + (GET_MODE (m->set_dest) == GET_MODE (m1->set_dest) /* See if the source of M1 says it matches M. */ && ((REG_P (m1->set_src) && matched_regs[REGNO (m1->set_src)]) @@ -2657,23 +2645,7 @@ move_movables (struct loop *loop, struct loop_movables *movables, { rtx temp; - /* Schedule the reg loaded by M1 - for replacement so that shares the reg of M. - If the modes differ (only possible in restricted - circumstances, make a SUBREG. - - Note this assumes that the target dependent files - treat REG and SUBREG equally, including within - GO_IF_LEGITIMATE_ADDRESS and in all the - predicates since we never verify that replacing the - original register with a SUBREG results in a - recognizable insn. */ - if (GET_MODE (m->set_dest) == GET_MODE (m1->set_dest)) - reg_map[m1->regno] = m->set_dest; - else - reg_map[m1->regno] - = gen_lowpart_common (GET_MODE (m1->set_dest), - m->set_dest); + reg_map[m1->regno] = m->set_dest; /* Get rid of the matching insn and prevent further processing of it. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5f0466a..0097a9d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-08-06 Richard Sandiford + + PR rtl-optimization/23233 + * gcc.c-torture/compile/pr23233-1.c: New test. + 2005-08-06 Jakub Jelinek PR fortran/18833 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr23233-1.c b/gcc/testsuite/gcc.c-torture/compile/pr23233-1.c new file mode 100644 index 0000000..356c063 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr23233-1.c @@ -0,0 +1,8 @@ +void foo (volatile long long *x) +{ + while (*x) + { + *x = 0; + *((volatile char *) 0) = 0; + } +}