This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Fwd: Bootstrap failure w/3.2 trunk on sparc-solaris2.7 in insn-attrtab.c]


Sorry, I forgot to send it into gcc-patches.

Vlad
--- Begin Message ---
"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 ---

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]