This is the mail archive of the gcc-bugs@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]

Re: latest CVS bootstrap failure on Solaris with Sun cc.



>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). 

This is bbviously incorrect C.

>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?

They do, but if you don't do any optimizations, all code will be
generated (pessimizing compiler) and the code to call
prologue_epilogue_contains will also be present and linkng will fail.

The code calls a function that doesnt' exist, so the code is faulty.

>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.


Try "-O" with the Sun compilers and the code will compile.
But that doesn't make the code correct.


Casper


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