--- Begin Message ---
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-bugs at gcc dot gnu dot org, davem at redhat dot com
- Date: Thu, 02 May 2002 17:28:32 -0400
- Subject: Re: Bootstrap failure w/3.2 trunk on sparc-solaris2.7 in insn-attrtab.c
- References: <200205021715.NAA12513@caip.rutgers.edu>
"Kaveh R. Ghazi" wrote:
>
> There's a new bootstrap failure on the 3.2 trunk for
> sparc-sun-solaris2.7 when using cc for stage1. I get this:
>
> > cc -DIN_GCC -g -DHAVE_CONFIG_H -I. -I. -I../../egcc-CVS20020501/gcc
> > -I../../egcc-CVS20020501/gcc/. -I../../egcc-CVS20020501/gcc/config
> > -I../../egcc-CVS20020501/gcc/../include -c insn-attrtab.c -o
> > insn-attrtab.o
> > "insn-attrtab.c", line 11546: syntax error before or at: }
> > "insn-attrtab.c", line 11546: warning: syntax error: empty declaration
> > cc: acomp failed for insn-attrtab.c
> > make[2]: *** [insn-attrtab.o] Error 2
>
> The relevant declaration in insn-attrtab.c:11546 is:
>
> > const struct function_unit_desc function_units[] = {
> > };
>
> GCC also warns about this not being valid:
>
> > insn-attrtab.c:11546: warning: ISO C forbids empty initializer braces
>
> So any chip/platform for which this struct is empty will choke when
> using an ISO C compliant compiler.
>
> I'm pretty sure it started happening around the time of the dfa-branch
> merge. My guess is that you either need to avoid emitting the struct
> if its empty or insert a dummy value if that's too problematic.
The 2nd solution is the simplest one.
Here the patch is to solve the problem. I've just commited it into the
repository.
Thanks,
Vlad
2002-05-02 Vladimir Makarov <vmakarov@redhat.com>
* genattrtab.c (write_function_unit_info): Add a dummy element
when num_units == 0.
Index: genattrtab.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genattrtab.c,v
retrieving revision 1.112
diff -u -p -r1.112 genattrtab.c
--- genattrtab.c 29 Apr 2002 22:34:33 -0000 1.112
+++ genattrtab.c 2 May 2002 21:20:26 -0000
@@ -5692,6 +5692,8 @@ write_function_unit_info ()
printf ("}, \n");
}
+ if (num_units == 0)
+ printf ("{\"dummy\", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} /* a dummy
element */");
printf ("};\n\n");
}
--- End Message ---