This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [asan] Emit GIMPLE directly, small cleanups
On Thu, Oct 11, 2012 at 10:31:58AM -0700, Xinliang David Li wrote:
> > +#define PROB_VERY_UNLIKELY (REG_BR_PROB_BASE / 2000 - 1)
> > +#define PROB_ALWAYS (REG_BR_PROB_BASE)
> > +
>
>
> Does it belong here ? -- looks like they can be generally useful for others.
Perhaps, but then it would need to go on mainline first, and wait for a
merge from the trunk to asan. So, IMHO better to put it in now this way
and if mainline gets the macros moved from profile.c to a header, asan
branch can be then adjusted.
> > @@ -166,14 +167,15 @@ build_check_stmt (tree base,
> >
> > /* Create the bb that contains the crash block. */
> > then_bb = create_empty_bb (cond_bb);
>
> Missing frequency update for then_bb ?
I don't see other places which create very unlikely edges doing
that (e.g. trans-mem.c, omp-low.c, ...). Shall it be that
then_bb->frequency = cond_bb->frequency * PROB_VERY_UNLIKELY
/ REG_BR_PROB_BASE;
and join_bb->frequency -= then_bb->frequency; ?
join_bb is clearly misnamed, as then_bb is noreturn, so there is no
joining...
> > gimple_set_location (g, location);
> > - gimple_seq_add_stmt (&seq, g);
> > + gsi_insert_after (&gsi, g, GSI_NEW_STMT);
> > + base_addr = gimple_assign_lhs (g);
> >
>
>
> Set base_addr name here?
Why? I think nameless SSA_NAMEs are just fine for this.
Jakub