public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* How do I stop gcc from loading data into registers when that's not needed?
@ 2018-05-18 18:03 Paul Koning
  2018-05-18 18:07 ` Richard Biener
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Koning @ 2018-05-18 18:03 UTC (permalink / raw)
  To: GCC

Gents,

In some targets, like pdp11 and vax, most instructions can reference data in memory directly.

So when I have "if (x < y) ..." I would expect something like this:

	cmpw  x, y
	bgeq  1f
	...

What I actually see, with -O2 and/or -Os, is:

	movw  x, r0
	movw  y, r1
	cmpw  r0, r1
	bgeq  1f
	...

which is both longer and slower.  I can't tell why this happens, or how to stop it.  The machine description has "general_operand" so it doesn't seem to be the place that forces things into registers.

	paul

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-05-24 18:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-18 18:03 How do I stop gcc from loading data into registers when that's not needed? Paul Koning
2018-05-18 18:07 ` Richard Biener
     [not found]   ` <018C29D6-6245-4D31-B43B-623E080A6F87@comcast.net>
2018-05-22  8:49     ` Richard Biener
2018-05-22 19:26       ` Segher Boessenkool
2018-05-23  0:50         ` Paul Koning
2018-05-23  9:47           ` Richard Biener
2018-05-24  0:33             ` Paul Koning
2018-05-24 18:25               ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).