[PATCH] Fix incorrect discriminator assignment.

2013-05-15 Thread Dehao Chen
This patch fixes a common case where one line is distributed to 3 BBs, but only 1 discriminator is assigned. Bootstrapped and passed gcc regression test. OK for trunk? Thanks, Dehao gcc/ChangeLog: * tree-cfg.c (locus_descrim_hasher::hash): Only hash lineno. (locus_descrim_hasher::equal): Likew

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-29 Thread Dehao Chen
Patch updated and committed as r199412. Thanks, Dehao

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-30 Thread Andreas Schwab
Rainer Orth writes: > And why do you add -gdwarf-2 in dg-options? AFAICS all tests in > gcc.dg/debug/dwarf2 are built with -gdwarf-2 anyway. Do they? Not here. Executing on host: /daten/aranym/gcc/gcc-20130530/Build/gcc/xgcc -B/daten/aranym/gcc/gcc-20130530/Build/gcc/ /daten/aranym/gcc/gcc-

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-30 Thread Dehao Chen
On Thu, May 30, 2013 at 1:40 AM, Andreas Schwab wrote: > Rainer Orth writes: > >> And why do you add -gdwarf-2 in dg-options? AFAICS all tests in >> gcc.dg/debug/dwarf2 are built with -gdwarf-2 anyway. > > Do they? Not here. > > Executing on host: /daten/aranym/gcc/gcc-20130530/Build/gcc/xgcc

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-30 Thread Cary Coutant
> That's weird cause in dwarf2.exp: > > # If a testcase doesn't have special options, use these. > global DEFAULT_CFLAGS > if ![info exists DEFAULT_CFLAGS] then { > set DEFAULT_CFLAGS " -ansi -pedantic-errors -gdwarf-2" > } > > But anyway, shall I add the -gdwarf-2 option back to discriminator.

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-30 Thread Dehao Chen
On Thu, May 30, 2013 at 10:41 AM, Cary Coutant wrote: >> That's weird cause in dwarf2.exp: >> >> # If a testcase doesn't have special options, use these. >> global DEFAULT_CFLAGS >> if ![info exists DEFAULT_CFLAGS] then { >> set DEFAULT_CFLAGS " -ansi -pedantic-errors -gdwarf-2" >> } >> >> But

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-31 Thread Rainer Orth
Dehao Chen writes: > On Thu, May 30, 2013 at 10:41 AM, Cary Coutant wrote: >>> That's weird cause in dwarf2.exp: >>> >>> # If a testcase doesn't have special options, use these. >>> global DEFAULT_CFLAGS >>> if ![info exists DEFAULT_CFLAGS] then { >>> set DEFAULT_CFLAGS " -ansi -pedantic-err

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-31 Thread Rainer Orth
Andreas Schwab writes: > Rainer Orth writes: > >> And why do you add -gdwarf-2 in dg-options? AFAICS all tests in >> gcc.dg/debug/dwarf2 are built with -gdwarf-2 anyway. > > Do they? Not here. > > Executing on host: /daten/aranym/gcc/gcc-20130530/Build/gcc/xgcc > -B/daten/aranym/gcc/gcc-201305

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-31 Thread Andreas Schwab
Rainer Orth writes: > Indeed, and I see -ansi -pedantic-errors -gdwarf-2 -O0 used for the test > on both x86_64-unknown-linux-gnu and i386-pc-solaris2.10 (if I augment > the target clause). DEFAULT_CFLAGS is set by many *.exp files. dwarf2.exp will not overwrite an existing definition, so using

Re: [PATCH] Fix incorrect discriminator assignment.

2013-06-07 Thread Rainer Orth
Andreas Schwab writes: > Rainer Orth writes: > >> Indeed, and I see -ansi -pedantic-errors -gdwarf-2 -O0 used for the test >> on both x86_64-unknown-linux-gnu and i386-pc-solaris2.10 (if I augment >> the target clause). > > DEFAULT_CFLAGS is set by many *.exp files. dwarf2.exp will not > overwr

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-15 Thread Cary Coutant
> gcc/ChangeLog: > > * tree-cfg.c (locus_descrim_hasher::hash): Only hash lineno. > (locus_descrim_hasher::equal): Likewise. > (next_discriminator_for_locus): Likewise. > (assign_discriminator): Add return value. > (make_edges): Assign more discriminator if necessary. > (make_cond_expr_edges): Like

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-15 Thread Dehao Chen
On Wed, May 15, 2013 at 9:50 AM, Cary Coutant wrote: >> gcc/ChangeLog: >> >> * tree-cfg.c (locus_descrim_hasher::hash): Only hash lineno. >> (locus_descrim_hasher::equal): Likewise. >> (next_discriminator_for_locus): Likewise. >> (assign_discriminator): Add return value. >> (make_edges): Assign mo

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-17 Thread Richard Biener
On Wed, May 15, 2013 at 6:50 PM, Cary Coutant wrote: >> gcc/ChangeLog: >> >> * tree-cfg.c (locus_descrim_hasher::hash): Only hash lineno. >> (locus_descrim_hasher::equal): Likewise. >> (next_discriminator_for_locus): Likewise. >> (assign_discriminator): Add return value. >> (make_edges): Assign mo

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-17 Thread Dehao Chen
On Fri, May 17, 2013 at 1:22 AM, Richard Biener wrote: > On Wed, May 15, 2013 at 6:50 PM, Cary Coutant wrote: >>> gcc/ChangeLog: >>> >>> * tree-cfg.c (locus_descrim_hasher::hash): Only hash lineno. >>> (locus_descrim_hasher::equal): Likewise. >>> (next_discriminator_for_locus): Likewise. >>> (ass

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-21 Thread Richard Biener
On Fri, May 17, 2013 at 5:48 PM, Dehao Chen wrote: > On Fri, May 17, 2013 at 1:22 AM, Richard Biener > wrote: >> On Wed, May 15, 2013 at 6:50 PM, Cary Coutant wrote: gcc/ChangeLog: * tree-cfg.c (locus_descrim_hasher::hash): Only hash lineno. (locus_descrim_hasher::equal): Lik

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-22 Thread Dehao Chen
Sounds reasonable. The patch is updated, bootstrapped and passed all regression test. Dehao On Tue, May 21, 2013 at 5:34 AM, Richard Biener wrote: > On Fri, May 17, 2013 at 5:48 PM, Dehao Chen wrote: >> On Fri, May 17, 2013 at 1:22 AM, Richard Biener >> wrote: >>> On Wed, May 15, 2013 at 6:50

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-22 Thread Cary Coutant
@@ -105,7 +105,7 @@ struct locus_descrim_hasher : typed_free_remove locus; + return LOCATION_LINE (item->locus); } /* Equality function for the locus-to-discriminator map. A and B @@ -114,7 +114,7 @@ locus_descrim_hasher::hash (const value_type *item inline bool locus_descrim_hasher::equal (

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-22 Thread Dehao Chen
Sure, will update the patch for that. Dehao On Wed, May 22, 2013 at 9:40 AM, Cary Coutant wrote: > @@ -105,7 +105,7 @@ struct locus_descrim_hasher : typed_free_remove inline hashval_t > locus_descrim_hasher::hash (const value_type *item) > { > - return item->locus; > + return LOCATION_LINE

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-25 Thread Dominique Dhumieres
> Sure, will update the patch for that. ... This cause pr57413. Dominique PS the escaping in the regexp seems strange: \[0-9]

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-25 Thread Eric Botcazou
> gcc/ChangeLog: > > * tree-cfg.c (locus_descrim_hasher::hash): Only hash lineno. > (locus_descrim_hasher::equal): Likewise. > (next_discriminator_for_locus): Likewise. > (assign_discriminator): Add return value. > (make_edges): Assign more discriminator if necessary. > (make_cond_expr_edges): Lik

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-28 Thread Dehao Chen
ChangeLog fix patch committed in r199394. The attached patch restricts the test only run on linux-gnu targets. Is it ok? Thanks Dehao gcc/ChangeLog: 2013-05-28 Dehao Chen testsuite/debug/dwarf2/discriminator.c: Restrict the test to linux only. Index: gcc/testsuite/gcc.dg/debug/dwarf2/discr

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-28 Thread Cary Coutant
> The attached patch restricts the test only run on linux-gnu targets. Is it ok? Ideally we would restrict the test to those targets where HAVE_AS_DWARF2_DEBUG_LINE is set, but I don't think that can be done in dg. OK if no one suggests a way to do exactly that. -cary > gcc/ChangeLog: > > 2013-

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-28 Thread Mike Stump
On May 28, 2013, at 3:56 PM, Dehao Chen wrote: > The attached patch restricts the test only run on linux-gnu targets. Is it ok? Ok. You can put HAVE_AS_DWARF2_DEBUG_LINE in a comment above it to help explain why the target restriction applies. The idea is, if enough people care, or some x86 t

Re: [PATCH] Fix incorrect discriminator assignment.

2013-05-29 Thread Rainer Orth
Mike Stump writes: > On May 28, 2013, at 3:56 PM, Dehao Chen wrote: >> The attached patch restricts the test only run on linux-gnu targets. Is it >> ok? > > Ok. You can put HAVE_AS_DWARF2_DEBUG_LINE in a comment above it to help > explain why the target restriction applies. The idea is, if en