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: unsharing rtl too early



Jeffrey A Law <law@cygnus.com> writes:

>   In message <or8zx7gybh.fsf@saci.lsd.ic.unicamp.br>you write:
>   > On May 18, 2000, Jeffrey A Law <law@cygnus.com> wrote:
>   > =
> 
>   > >> int foo(int a) {
>   > >> int w;
>   > >> return w/a;
>   > >> }
>   > =
> 
>   > > Presumably this is in the testsuite? :-)
>   > =
> 
>   > Not exactly this one; it's a slight simplification of
>   > gcc.dg/980816-1.c
>   > =
> 
>   > > If not, make sure you add it.
>   > =
> 
>   > I don't think it's significant enough of a simplification.  Does
>   > anybody?
> OK.  No problem.
> 
> I believe that was the testcase for the same bug on another platform.  Wh=
> ich
> might help narrow down your search for how this was fixed on the m68/ia32=
> 
> port where I think it first showed up.

IIRC, I fixed that for m68k.  The problem was that RTL was being
shared between the procedure arguments (stored off the tree) and the
actual RTL of the procedure.  I fixed it by causing unshare_all_* to
unshare those too.

The problem was an insn like

(parallel [(set (...) (div (match_operand 0) (match_operand 1)))
	   (set (...) (mod (match_dup 0) (match_dup 1)))])

where operand 0 and operand 1 were procedure arguments; if they were
unshared inside the insn (so the first and second occurrences of each
were different), but the first occurrence of each were shared with the
trees representing the procedure arguments, instantiate_virtual_regs
would first substitute the procedure arguments, then would come to
this insn and substitute all occurrences of operand 0, then try to
recognise the result and fail because the two occurrences of operand 1
were different.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

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