bug with asm statment in egcs-1.0.2

Jeffrey A Law law@cygnus.com
Wed Apr 22 04:19:00 GMT 1998


  In message < 199804212116.RAA20017@miacomet.wavemark.com >you write:
  > 
  > I found a bug in reg-stack.c:constrain_asm_operands when compiling the
  > following asm statment for i386:
  > 
  >   asm volatile  (".data;\t.align 4;.LP" "DLbuildtrap"
  >     ";\t.long 0;.text;\tmovel $.LP" "DLbuildtrap" ",%%edx;\tcall mcount"
  >     : /* No outputs */
  >     : /* No inputs */
  >     : "eax", "edx", "ecx", "st",
  >       "st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)" );
  > 
  > with the flags '-O -fstrength-reduce -fsigned-char'
  > 
  > reg-stack.c:constrain_asm_operands() contains the following:
  > 
  >   for (j = 0; j < n_operands; j++)
  >     constraints[j] = operand_constraints[j];
  > 
  >   /* Compute the number of alternatives in the operands.  reload has
  >      already guaranteed that all operands have the same number of
  >      alternatives.  */
  > 
  >   n_alternatives = 1;
  >   for (q = constraints[0]; *q; q++)
  >     n_alternatives += (*q == ',');
  > 
  > 
  > But when n_operands is zero, then constraints[0] is bogus and it
  > SIGSEGVs.
I believe this is fixed in the development sources.

jeff



More information about the Gcc mailing list