Proposal and patch: Allow whitespace in md constraints

Hans-Peter Nilsson hp@bitrange.com
Mon Feb 14 14:00:00 GMT 2000


On Mon, 14 Feb 2000, Michael Meissner wrote:
> On Mon, Feb 14, 2000 at 03:48:48PM -0500, Hans-Peter Nilsson wrote:
> > Ok, then.  Is it ok to commit, replacing strip_whitespace with your
> > implementation?  I'll add you to the ChangeLog entry, if you don't mind.
> 
> Sure go ahead and commit it.

Sorry to pest you again.  I didn't commit, since I got const-discarded
compilation warnings, and I noticed there was a NULL-check right *after*
the "stripping" in the original patch.

I believe I have to ask for renewed permission to check in this.  Here's
the updated part, the rest is as approved:

Index: genoutput.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genoutput.c,v
retrieving revision 1.46
diff -p -c -r1.46 genoutput.c
*** genoutput.c	2000/02/05 04:56:11	1.46
--- genoutput.c	2000/02/14 21:47:08
*************** scan_operands (d, part, this_address_p, 
*** 440,447 ****
        d->operand[opno].predicate = XSTR (part, 1);
        d->operand[opno].constraint = XSTR (part, 2);
        if (XSTR (part, 2) != 0 && *XSTR (part, 2) != 0)
! 	d->operand[opno].n_alternatives
! 	  = n_occurrences (',', XSTR (part, 2)) + 1;
        d->operand[opno].address_p = this_address_p;
        d->operand[opno].eliminable = 1;
        return;
--- 441,451 ----
        d->operand[opno].predicate = XSTR (part, 1);
        d->operand[opno].constraint = XSTR (part, 2);
        if (XSTR (part, 2) != 0 && *XSTR (part, 2) != 0)
! 	{
! 	  strip_whitespace (XSTR (part, 2));
! 	  d->operand[opno].n_alternatives
! 	    = n_occurrences (',', XSTR (part, 2)) + 1;
! 	}
        d->operand[opno].address_p = this_address_p;
        d->operand[opno].eliminable = 1;
        return;
*************** scan_operands (d, part, this_address_p, 
*** 465,472 ****
        d->operand[opno].predicate = "scratch_operand";
        d->operand[opno].constraint = XSTR (part, 1);
        if (XSTR (part, 1) != 0 && *XSTR (part, 1) != 0)
! 	d->operand[opno].n_alternatives
! 	  = n_occurrences (',', XSTR (part, 1)) + 1;
        d->operand[opno].address_p = 0;
        d->operand[opno].eliminable = 0;
        return;
--- 469,479 ----
        d->operand[opno].predicate = "scratch_operand";
        d->operand[opno].constraint = XSTR (part, 1);
        if (XSTR (part, 1) != 0 && *XSTR (part, 1) != 0)
! 	{
! 	  strip_whitespace (XSTR (part, 1));
! 	  d->operand[opno].n_alternatives
! 	    = n_occurrences (',', XSTR (part, 1)) + 1;
! 	}
        d->operand[opno].address_p = 0;
        d->operand[opno].eliminable = 0;
        return;

brgds, H-P



More information about the Gcc-patches mailing list