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: [PING] [PATCH] Fix asm X constraint (PR inline-asm/59155)


On Mon, 6 Jun 2016, Jakub Jelinek wrote:

On Mon, Jun 06, 2016 at 12:04:04PM -0600, Jeff Law wrote:
On 06/06/2016 12:01 PM, Jakub Jelinek wrote:
On Mon, Jun 06, 2016 at 11:54:04AM -0600, Jeff Law wrote:
As for recog.c, I can not approve this as I am not a maintainer of it.
I only can say that the code looks questionable to me.
I think the question on the recog part is a matter of how we choose to
interpret what the "X" constraint means.

Does it literally mean accept anything, or accept some subset expressions?

I tend to think the former, which means that things like
reg_overlap_mentioned_p or its callers have to be bullet-proofed.

I think it is a bad idea to accept really anything, even for debug insns,
which initially accepted arbitrarily large RTL expressions (and still accept
stuff like subregs otherwise considered invalid etc.) we found it is highly
undesirable, as it is not very good idea for the compile time complexity
etc., so now we are trying to limit the complexity of the expressions there
by splitting up more complex expressions into smaller ones using temporaries.
So, even accept anything should always be accept anything reasonable,
because most of the RTL passes don't really expect arbitrarily deep
expressions, or expressions where the same reg can appear thousands of times
etc.
The problem is how do you define this subset of expressions you're going to
accept and those which you are going to reject.

I first pondered accepting RTL leaf nodes (reg, subreg, constants) and
rejecting everything else.  But I couldn't convince myself that some port
might reasonably expect (plus (x) (y)) to match the "X" constraint.

It is always going to be arbitrary.
Perhaps RTL leaf nodes (if including MEM, then perhaps with valid address
only), and unary/binary/ternary RTL expressions with RTL leaf node operands?
Or union of what is accepted by any other constraint?
Or "g" plus any constants?

The last one would miss floating point registers (no 2 platforms use the same letter for those, hence my quest for something more generic).

The goal of the experiment is described in PR59159 (for which "+X" is unlikely to be the right answer, in particular because it is meaningless for constants). I don't know in what context people use the "X" constraint, or even better "=X"...

--
Marc Glisse


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