This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: rtlopt merge part 4 - variable tracking pass
- From: Jan Hubicka <jh at suse dot cz>
- To: Josef Zlomek <zlomj9am at artax dot karlin dot mff dot cuni dot cz>
- Cc: Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 1 Feb 2003 19:12:36 +0100
- Subject: Re: rtlopt merge part 4 - variable tracking pass
- References: <20030127140112.GA5600@artax.karlin.mff.cuni.cz> <20030128215354.GA31644@atrey.karlin.mff.cuni.cz> <20030201155753.GA11564@artax.karlin.mff.cuni.cz>
> > > + case CLOBBER:
> > > + old_type = d->type;
> > > + d->type = LT_CLOBBERED;
> > > + for_each_rtx (&SET_DEST (*x), scan_for_locations, data);
> > > + d->type = old_type;
> > > + /* Do not traverse sub-expressions. */
> > > + return -1;
> >
> > This is somewhat unsafe, because SETs and CLOBBERs may contain uses in
> > bit non-obvious ways (such as zero_extract expression). It would be
> > better to use note_stores to notice the outputs from instruction - you
> > will get called always to the toplevel construction (subreg, reg or mem
> > if I remmeber correctly). Similarry we do have note_uses to get
> > expressions that are only reffered into. You will get called always for
> > the outermost expression that is just used.
>
> I do not understand, please could you write an example that it might not
> handle well?
>
> Here is how it works now, I'll add some well describing comment (if it
> is correct):
> I scan all subexpressions of a given rtx and when I find register or
> memory with MEM_ATTRS I remember the rtx and the attributes from
> MEM_ATTRS (or REG_ATTRS).
I was mostly refering to the types (use versus store).
For instance expression
(set (strict_low_part (reg A) (reg B) (reg C)) (reg D))
Uses regs A,B,C,D and writes into reg A.
> > > + }
> > > + else if (GET_CODE (loc) == MEM
> > > + && MEM_EXPR (loc)
> > > + && track_expr_p (MEM_EXPR (loc)))
> > > + {
> > > + int j;
> > > + tree decl = MEM_EXPR (loc);
> > > + HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0;
> > > +
> > > + attrs_htab_delete (VTI (bb)->mem_out, loc);
> > > + if (VTI (bb)->locs[i].type == LT_PARAM
> > > + || VTI (bb)->locs[i].type == LT_SET_DEST)
> > > + {
> > > + /* The variable is no longer in any register. */
> > Why exactly?
>
> Maybe the comment is confusing. I do not know whether dwarf2 or debug
> info at general can handle that some variable has several equivalent
> locations, for example "int i" is in %eax, %ecx and 8(%ebp),
> so when there is a store of variable to memory I keep only the
> memory location.
I see, that makes sense.
Please add it into the comment :)
Honza
>
> Josef