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: New testcase & bug fix for function.c



  In message <200007150035.BAA08829@phal.cygnus.co.uk>you write:
  > This testcase, for SH target compiled with -O1:
  > 
  > __complex__ long long f ()
  > {
  >   int i[99];
  >   __complex__ long long v;
  > 
  >   v += f ();
  >   asm("": "+r" (v) : "r" (0), "r" (1));
  >   v = 2;
  >   return v;
  >   g (&v);
  > }
  > 
  > causes a segfault of cc1.  put_var_into_stack gets handed a CONCAT, and
  > calls put_reg_into_stack for each of the components.  put_reg_into_stack
  > in turn calls fixup_var_refs, which processes the reference to the concat
  > and replaces its components with new pseudo registers.
  > When put_var_into_stack later tries to copy the address from the first
  > component:
  >       XEXP (reg, 0) = XEXP (XEXP (reg, 0), 0);
  > there is no MEM in XEXP (reg, 0), but a REG.  Hence the segfault.
  > 
  > It is simple to get over this segfault by just remebering the old value
  > of XEXP (reg, 0), but that doesn't fix the testcase; the invalid CONCAT
  > is left behind, and gcc aborts in instantiate_virtual_regs_1 .
  > So to fix this problem, I postpone the fixup for the components after
  > I have done a fixup or the whole concat.
  > 
  > Sat Jul 15 01:24:27 2000  J"orn Rennecke <amylaar@cygnus.co.uk>
  > 
  > 	* function.c (schedule_fixup_var_refs): New function, broken out
  > 	of put_reg_into_stack.
  > 	(put_reg_into_stack): Use it.
  > 	(put_var_into_stack): In CONCAT case, fixup up references for
  > 	components only after fixing up references to the whole concat.
This is fine.  Please install the testcase into the testsuite and the
patch.

Thanks,
jeff


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