latest CVS bootstrap failure on Solaris with Sun cc.

Kim Sebo kim@mso.anu.edu.au
Wed Oct 13 16:40:00 GMT 1999


For the last week, CVS sources fail to bootstrap under Solaris 2.6
(sparc), building with Sun cc 4.2.  Building with gcc 2.96 19991006
works OK.

The error early on in the bootstrap is due to an undefined symbol
"prologue_epilogue_contains", referenced in flow.c, during the
linking of cc1.

The code in flow.c is:
>          if ((flags & PROP_KILL_DEAD_CODE)
>              && insn_is_dead
>              && reload_completed
>              && (HAVE_epilogue || HAVE_prologue)
>              && prologue_epilogue_contains (insn))
>            {

The function prologue_epilogue_contains() is defined in function.c,
within a #if(HAVE_prologue || HAVE_epilogue). 

Apparently,HAVE_{epi,pro}logue are not set under Solaris/sparc, so
prologue_epilogue_contains() is not defined in function.c.  However,
in flow.c, the call to it still survives despite earlier parts of the
boolean expression being false. It seems that the Sun compilers
are not doing short-circuit boolean evaluation properly?

The failure boils down to the following short test case, which
compiles OK under gcc 2.96 19991006, but fails under Sun cc 4.2 and
5.0. (Note if the "if" test is changed to "if((a||b)&&foo())",
this code compiles OK with the Sun compilers.

#include <stdio.h>
#define a 0
#define b 0

#if(a||b)
int foo(){
 return 1;
}
#endif

int main() {
 int c=1; /* c=0 fails for Sun too */
 if( c && (a||b) && foo() ) {
  printf("bar baz\n");
 }
 return 0;
}


-- 
Kim Sebo		kim@mso.anu.edu.au
Mount Stromlo and Siding Spring Observatories
Australian National University, Canberra


More information about the Gcc-bugs mailing list