Message ID | 561D2085.90802@adacore.com |
---|---|
State | New |
Headers | show |
On 10/13/2015 05:17 PM, Pierre-Marie de Rodat wrote: > The first attached patch is the second attempt to fix PR > rtl-optimization/66790 (see > <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66790>). > > The second one is a fix for some inconsistency noticed while working on > the original bug. This specific patch fixes no known bug, but anyway… > > Both were bootstrapped and regtested on x86_64-linux. Ok to commit? > Thank you in advance! > > [PATCH 1/2] REE: fix uninitialized registers handling This one is OK with minor changes. I ran some tests with it, and the mir sets look good this time. Code generation still seems unaffected by it on all my example code (which is as expected). > + > + /* Ignoring artificial defs is intentionnal: these often pretend that some "intentional". > + if ((!bitmap_equal_p (&problem_data->in[bb->index], DF_MIR_IN (bb))) > + || (!bitmap_equal_p (&problem_data->out[bb->index], DF_MIR_OUT (bb)))) > + { > + /*df_dump (stderr);*/ > + gcc_unreachable (); > + } Please remove the commented out code and then also the unnecessary braces. In general we avoid commented out code in gcc, but when doing it, #if 0 is generally a better method. > + const rtx reg = XEXP (src, 0); Drop the const maybe? It doesn't seem to add much and the idiom is to just use rtx. >>From ff694bf70e0b1ebd336c684713ce6153cc26b3d6 Mon Sep 17 00:00:00 2001 > From: Pierre-Marie de Rodat<derodat@adacore.com> > Date: Tue, 22 Sep 2015 16:02:41 +0200 > Subject: [PATCH 2/2] DF_LIVE: make clobbers cancel effect of previous GENs in > the same BBs > > gcc/ChangeLog: > > * df-problems.c (df_live_bb_local_compute): Clear GEN bits for > DF_REF_MUST_CLOBBER references. This one is probably ok too; I still want to experiment with it a little. Bernd
On 10/13/2015 05:17 PM, Pierre-Marie de Rodat wrote: > diff --git a/gcc/df-problems.c b/gcc/df-problems.c > index c08ae36..56e1cf5 100644 > --- a/gcc/df-problems.c > +++ b/gcc/df-problems.c > @@ -1464,9 +1464,12 @@ df_live_bb_local_compute (unsigned int bb_index) > seen are included in the gen set. */ > bitmap_set_bit (&bb_info->gen, regno); > else if (DF_REF_FLAGS_IS_SET (def, DF_REF_MUST_CLOBBER)) > - /* Only must clobbers for the entire reg destroy the > - value. */ > - bitmap_set_bit (&bb_info->kill, regno); > + { > + /* Only must clobbers for the entire reg destroy the > + value. */ > + bitmap_set_bit (&bb_info->kill, regno); > + bitmap_clear_bit (&bb_info->gen, regno); > + } > else if (! DF_REF_FLAGS_IS_SET (def, DF_REF_MAY_CLOBBER)) > bitmap_set_bit (&bb_info->gen, regno); > } I think I haven't approved that yet. It is ok, but I do wonder whether there really is a point distinguishing between MUST_CLOBBER and MAY_CLOBBER. Bernd
From ff694bf70e0b1ebd336c684713ce6153cc26b3d6 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat <derodat@adacore.com> Date: Tue, 22 Sep 2015 16:02:41 +0200 Subject: [PATCH 2/2] DF_LIVE: make clobbers cancel effect of previous GENs in the same BBs gcc/ChangeLog: * df-problems.c (df_live_bb_local_compute): Clear GEN bits for DF_REF_MUST_CLOBBER references. --- gcc/df-problems.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gcc/df-problems.c b/gcc/df-problems.c index c08ae36..56e1cf5 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -1464,9 +1464,12 @@ df_live_bb_local_compute (unsigned int bb_index) seen are included in the gen set. */ bitmap_set_bit (&bb_info->gen, regno); else if (DF_REF_FLAGS_IS_SET (def, DF_REF_MUST_CLOBBER)) - /* Only must clobbers for the entire reg destroy the - value. */ - bitmap_set_bit (&bb_info->kill, regno); + { + /* Only must clobbers for the entire reg destroy the + value. */ + bitmap_set_bit (&bb_info->kill, regno); + bitmap_clear_bit (&bb_info->gen, regno); + } else if (! DF_REF_FLAGS_IS_SET (def, DF_REF_MAY_CLOBBER)) bitmap_set_bit (&bb_info->gen, regno); } -- 2.6.0