This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add support to trace comparison instructions and switch statements
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, wishwu007 <wishwu007 at gmail dot com>, 吴潍浠(此彼) <weixi dot wwx at antfin dot com>, Dmitry Vyukov <dvyukov at google dot com>, Jeffrey Law <law at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Eric Botcazou <ebotcazou at adacore dot com>
- Date: Fri, 08 Sep 2017 10:38:15 +0200
- Subject: Re: Add support to trace comparison instructions and switch statements
- Authentication-results: sourceware.org; auth=none
- References: <CAGWvnynYudQhXTJJk24G6gqWVfXKrpWwQ=Or6K3G6ECpQgu8GA@mail.gmail.com> <20170906212417.GR2323@tucnak> <yddwp5awinp.fsf@CeBiTec.Uni-Bielefeld.DE> <CAGWvnynDSdYyVxsnGnEzmg6E8zCo9EMD618uLG3=OkEZ0vYCsA@mail.gmail.com>
Hi David,
> On Thu, Sep 7, 2017 at 6:57 PM, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>> Jakub Jelinek <jakub@redhat.com> writes:
>>
>>> On Wed, Sep 06, 2017 at 10:08:01PM +0200, David Edelsohn wrote:
>>>> This change broke bootstrap on AIX because sancov.c now references a
>>>> macro that is defined as a function on AIX. sancov.c needs to include
>>>> tm_p.h to pull in the target-dependent prototypes. The following
>>>> patch works for me. Is this okay?
>>>>
>>>> * sancov.c: Include tm_p.h.
>>>
>>> Ok, thanks. And sorry for the breakage.
>>>
>>>> Index: sancov.c
>>>> ===================================================================
>>>> --- sancov.c (revision 251817)
>>>> +++ sancov.c (working copy)
>>>> @@ -28,6 +28,7 @@
>>>> #include "basic-block.h"
>>>> #include "options.h"
>>>> #include "flags.h"
>>>> +#include "tm_p.h"
>>>> #include "stmt.h"
>>>> #include "gimple-iterator.h"
>>>> #include "gimple-builder.h"
>>
>> This broke SPARC bootstrap, however:
>>
>> In file included from ./tm_p.h:4:0,
>> from /vol/gcc/src/hg/trunk/local/gcc/sancov.c:31:
>> /vol/gcc/src/hg/trunk/local/gcc/config/sparc/sparc-protos.h:46:47: error: use of enum 'memmodel' without previous declaration
>> extern void sparc_emit_membar_for_model (enum memmodel, int, int);
>> ^
>>
>> This fix allows the bootstrap to continue, but I'm not certain how
>> header inclusion is supposed to be done this way:
>
> It looks like sancov.c also needs to include memmodel.h before tm_p.h.
> One should not include memmodel.h in sparc-protos.h.
You're right, of course: I'd mostly forgotten about the include
flattening.
I've now installed the patch below as obvious after successful
sparc-sun-solaris2.11 and i386-pc-solaris2.11 bootstraps.
However, this seems extremely fragile to me: neither Jakub nor yourself
remembered about this requirement and it affects only a few platforms.
Feels like an incomplete transition...
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2017-09-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* sancov.c: Include memmodel.h.
changeset: 40433:6390d6278d19
tag: tip
user: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
date: Fri Sep 08 10:34:07 2017 +0200
summary: Fix SPARC bootstrap: sancov.c needs memmodel.h
diff --git a/gcc/sancov.c b/gcc/sancov.c
--- a/gcc/sancov.c
+++ b/gcc/sancov.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.
#include "basic-block.h"
#include "options.h"
#include "flags.h"
+#include "memmodel.h"
#include "tm_p.h"
#include "stmt.h"
#include "gimple-iterator.h"