Hi David, > On Thu, Sep 7, 2017 at 6:57 PM, Rainer Orth <r...@cebitec.uni-bielefeld.de> > wrote: >> 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: > > 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 <r...@cebitec.uni-bielefeld.de> * sancov.c: Include memmodel.h.
changeset: 40433:6390d6278d19 tag: tip user: Rainer Orth <r...@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"