Jakub Jelinek <ja...@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:

diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -23,6 +23,8 @@ along with GCC; see the file COPYING3.  
 #ifndef __SPARC_PROTOS_H__
 #define __SPARC_PROTOS_H__
 
+#include "memmodel.h"
+
 #ifdef TREE_CODE
 #ifdef RTX_CODE
 extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to