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: David Edelsohn <dje dot gcc at gmail dot com>
- To: Rainer Orth <ro at cebitec dot uni-bielefeld dot de>
- 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: Thu, 7 Sep 2017 22:17:19 +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>
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.
- David