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]

Re: More strict checks for asm constraints


> On Fri, Oct 29, 1999 at 01:19:44AM +0200, Jan Hubicka wrote:
> > ! warning ("Maximally one '*' constraint ought to be used per alternative.");
> 
> Why do you believe this?  The * applies only to the next
> letter -- "*p*qr" is a perfectly legitimate constraint.
Huh.. I tought it disables parsing up to next alternative..
I see that it is not same as '#'. silly me.
> 
> > ! if (nalternatives)
> > ! warning ("'!' constraint ought not to be used in single alternative operands.");
> 
> Don't you mean nalternatives == 1?
the nalternatives is set to number of alternatives minus 1 for some purpose
(number of ',' in string)
> 
> > ! if (bang)
> > ! warning ("Maximally one '!' constraint ought to be used per alternative.");
> 
> No reason for this.
> 
> > !if (query)
> > !warning ("'!' constraint ought not to be combined with '?'.");
> 
> Or this.
Reload.c does:
              case '?':
                reject += 6;
                break;

              case '!':
                reject = 600;
                break;
So I believe any '!' kills all preceeding ones (the resulting reject value is the same)
so there is no purpose to write any '!' or '?' before given '!'.
> 
> > ! 	    error ("'X' constraint not valid in asm operand.");
> 
> Why do you believe this?
OK.
I saw the explanation why it is usefull in another followup.
I tought it is useless, but in case the asm statement is folded out in some case,
it is OK.
The inspiration came from my friend's asm statement, that contained 'X' in the constraints
and I spent about three hours by figuring out why given piece of code gives incorrect
results :((

I currently don't have access to gcc sources. I will send updated patch tomorrow.
(Do I need to remove those multiple '!' checks?)

Honza
> 
> 
> 
> r~

-- 
                       OK. Lets make a signature file.
+-------------------------------------------------------------------------+
|        Jan Hubicka (Jan Hubi\v{c}ka in TeX) hubicka@freesoft.cz         |
|         Czech free software foundation: http://www.freesoft.cz          |
|AA project - the new way for computer graphics - http://www.ta.jcu.cz/aa |
|  homepage: http://www.paru.cas.cz/~hubicka/, games koules, Xonix, fast  |
|  fractal zoomer XaoS, index of Czech GNU/Linux/UN*X documentation etc.  | 
+-------------------------------------------------------------------------+


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