From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: law@cygnus.com Cc: hjl@lucon.org, gafton@redhat.com, rth@cygnus.com, egcs@cygnus.com Subject: Re: egcs 1.0.2 is broken on x86 and a patch for it. Date: Mon, 20 Apr 1998 13:06:00 -0000 Message-id: References: <17624.893055503@hurl.cygnus.com> X-SW-Source: 1998-04/msg00812.html > > > Basically convert_regs () calls change_stack () with INSN to emit > > some insn after INSN. But some insn has been added after INSN so > > that change_stack () will emit some insn at the wrong place. As the > > result, the floating point is broken on x86. > This is an extremely confusing explanation, primarily because you > use "insn"/INSN to refer to three different things. > > Basically is sounds like you have > > insn 1 > insn 2 > > > It sounds like we thought we wanted to insert after insn 1, but > because of other reg-stack actions we really wanted to insert > after insn 2. It is close. Originally, we have insn 1 and we should insert something after insn 1. But in reg-stack.c, something is added to fit the register stack and we get insn 1 insn 2 before we are just about to insert something after insn 1. Now we want to insert something after the original insn 1. Where should we insert? After insn 1 or insn 2? insn 2 is added to adjust the register stack and it is really the extention of insn 1. If we add anything after insn 1 now, we just screw up the purpose of adding insn 2 which is fit the register stack. So things should be inserted after the original insn 1 should be inserted after insn 2 now. > > > This patch seems to fix it. Could someone please take a look? Given > > the bugs we have seen in egcs 1.0.2, I suggest egcs 1.0.3 be made. > I must confess I don't undersatnd reg-stack all that well. Assuming > your analysis and explanation are correct, then I think your change > is OK, though possibly incomplete. > > In particular I worry that we need to pass "new" instead of "insn" > to the call to emit_pop_insn near the end of convert_regs. I think > the call to goto_block_pat in convert_regs is OK. > > I also worry that there may be cases were we need to insert after > insn 1 instead of after insn 2. But I don't know reg-stack well > enough to know if that can actually happen. > > You might ask Bernd Schmidt or Stan Cox to look at the change and > comment. > Are they reading this list? -- H.J. Lu (hjl@gnu.org)