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]

[PATCH] Fixes some of PR 18463 and 17647, i386 address mode not being generated


Pre tree-ssa we would generated the addressing mode right during the
expansion of the RTL.  Now with the merge of the tree-ssa we do some CSE
before the expansion of the RTL but we don't recombine the instruction
back together to get this addressing mode.  The reason why we don't get
the combining back together is because at the point were we try to
combine it back together we have a ASHIFT which the i386 back-end
says is expensive since it does not understand ASHIFT at all, which we
can canonize to MULT.  In fact if we canonize to MULT in CSE we get
back the addressing mode.

This patch adds a new function in cse.c to do the canonizing of the
addresses and we call it before calling address_cost.

This patch should also improve SPEC but I don't have access to SPEC
at all.

This patch does not fully fix the problem as CSE does not notice some
of the instructions and IV-OPTS does some weird stuff that someone
should look into.

OK? Bootstrapped and tested on powerpc-darwin and i686-pc-linux with no
regressions.

Thanks,
Andrew Pinski

ChangeLog:
	* cse.c (canon_for_address): New function.
	(find_best_addr): Call canon_for_address before getting the
	address's cost when checking if we should take that address.

Attachment: fixAddressMode.diff.txt
Description: Text document


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