This is the mail archive of the 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: RFA: Make mn10300 use an UNSPEC instead of nested (const (minus ...))s

Richard Sandiford wrote:
This patch makes the mn10300 port use UNSPECs instead of (const (minus ...)).
It's part of my ongoing quest to enforce a grammar for CONSTs.  See:

for details.

The only use of (const (minus ...)) is in:

	  (unspec [(minus:SI
		    (match_dup 1)
		    (const (minus:SI
			    (const (match_operand:SI 0 "" ""))
		  ] UNSPEC_PIC))))]

As with SH, these nested consts appear to be there to enforce a
particular bracketing, but I don't think that behaviour is documented
or guaranteed.  The patch avoids this by adding a new unspec.

Tested by comparing the before and after assembly output for
gcc.c-torture, gcc.dg and g++.dg on mn10300-elf, using the

{-O0,-O2} x {-fpic}

There were no differences. OK to install?


* config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Handle
* config/mn10300/mn10300.c (legitimate_pic_operand_p): Return true
* config/mn10300/ (UNSPEC_GOTSYM_OFF): New unspec.
(add_GOT_to_pic_reg): Use it.
* config/mn10300/ (S): Allow UNSPEC_GOTSYM_OFF.
This is fine.

I can only guess the idea was that we could CSE the inner subtraction, but I can't see how that would work either.


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