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: Genrecog bugfix version 2


> On Sun, Jul 25, 1999 at 03:12:25AM +0200, Jan Hubicka wrote:
> > +   int cmp = strcmp (d1->position, d2->position);
> ...
> > +        /* Try to find corresponding position in the second.  */
> > +        if (cmp < 0)
> 
> I don't understand the use of strcmp to determine which
> of d1 or d2 to back out and test.  Perhaps you were looking
> for the longer of two strings?  Or perhaps we always know
> that one is a prefix of the longer?
After looking at the strings I've got impression that they contaions
letters and numbers to represent position in the insn and when I sort
them alphabetically I get exactly the order recog uses to match constraints.
In the situation I am shooting for, one string is longer, because it's tree
is deeper and second is "almost prefix" except it is one branch later.
I think we can use strlen comparison as well, but strcmp seems to be more
clear to me to represent that I need to syncronize.

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]