This is the mail archive of the gcc-patches@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]

Re: find_movable_pseudos vs. split moves (was Re: rx-elf fails after r187015)


On 05/15/2012 09:08 AM, Richard Sandiford wrote:
DJ Delorie<dj@redhat.com> writes:
After r187015 (Mar 31), gcc builds for rx-elf are failing with:

make[3]: Entering directory `/greed/dj/m32c/gcc/rx-elf-head/rx-elf/64-bit-double/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
/greed/dj/m32c/gcc/rx-elf-head/./gcc/xgcc -B/greed/dj/m32c/gcc/rx-elf-head/./gcc/ -B/greed/dj/m32c/install/rx-elf/bin/ -B/greed/dj/m32c/install/rx-elf/lib/ -isystem /greed/dj/m32c/install/rx-elf/include -isystem /greed/dj/m32c/install/rx-elf/sys-include    -g -O2 -m64bit-doubles -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -I. -I. -I../../.././gcc -I../../../../gcc/libgcc -I../../../../gcc/libgcc/. -I../../../../gcc/libgcc/../gcc -I../../../../gcc/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o _mulvdi3.o -MT _mulvdi3.o -MD -MP -MF _mulvdi3.dep -DL_mulvdi3 -c ../../../../gcc/libgcc/libgcc2.c
../../../../gcc/libgcc/libgcc2.c: In function '__mulvdi3':
../../../../gcc/libgcc/libgcc2.c:397:1: internal compiler error: in subreg_get_info, at rtlanal.c:3308
  }
  ^

Can anyone else confirm this?
I can well believe that that patch exposed the problem, but the bug
seems to be in IRA.  find_moveable_pseudos tries to redirect a DImode
multiplication to a new register, then copies the new register to the
original one before the first use.  The problem here is that rx has no
DImode move pattern, so we end up splitting the DImode move into two
SImode moves and a clobber.  When allocation fails for the new register,
move_unallocated_pseudos deletes one of these three instructions,
but the other two are left around.  reload then gets confused because
we have a subreg of a pseudo that isn't allocated and has no stack slot.

One fix would be to check whether the backend has a move pattern.
I don't particularly like that though, since I don't think targets
like rx should be punished for not defining a DImode move.  The fact
that the first lower-subreg pass is so early in the rtl pipeline
suggests that having unitary multiword moves shouldn't be important
these days.

This patch instead deletes all instructions that set the new register.
One advantage is that IRA no longer needs to track the move specially.

Tested by making sure that rx-elf build again and that the new code
deletes all three instructions generated by gen_move_insn.  Also
bootstrapped&  regression-tested on x86_64-linux-gnu.  OK to install?

Richard


gcc/ * ira.c (pseudo_move_insn): Delete. (find_moveable_pseudos): Don't set it. (move_unallocated_pseudos): Use DF_REG_DEF_CHAIN to find the definitions of the original pseudo. Delete all of them.

Ok. Thanks for working on this problem, Richard.


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