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: [patches] Re: More validitizing for genoutput


> On Sun, Dec 10, 2000 at 12:08:07PM +0100, Jan Hubicka wrote:
> > > > + 	    if (d->operand[op].n_alternatives != i)
> 
> > I know, all I need is to find first operand, that says me number of
> > alternatives used.  Or is this information stored more readily somewhere?
> 
> d->n_alternatives.
I've noticed that already.  Thanks for pointing it out!
OK now?

Honza

Mon Dec 11 14:31:48 MET 2000  Jan Hubicka  <jh@suse.cz>

	* genoutput.c (process_template): Add sanity checking for '@' templates.

Index: gcc/gcc/genoutput.c
===================================================================
RCS file: /home/cvs/Repository/gcc/gcc/genoutput.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 genoutput.c
*** gcc/gcc/genoutput.c	2000/12/07 17:40:42	1.2
--- gcc/gcc/genoutput.c	2000/12/11 13:26:49
*************** process_template (d, template)
*** 681,686 ****
--- 681,687 ----
       list of assembler code templates, one for each alternative.  */
    else if (template[0] == '@')
      {
+       int verified = 0, op;
        d->template = 0;
        d->output_format = INSN_OUTPUT_FORMAT_MULTI;
  
*************** process_template (d, template)
*** 701,706 ****
--- 702,713 ----
  	  printf ("\",\n");
  	  i++;
  	}
+       if (i == 1)
+ 	message_with_line (d->lineno,
+ 			   "'@' is redundant for output template with single alternative");
+       if (i != d->n_alternatives)
+ 	message_with_line (d->lineno,
+ 			   "Wrong number of alternatives in the output template");
  
        printf ("};\n");
      }

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