[Bug target/56211] gnulib yesno compiled incorrectly with -02 on x86_64
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 5 07:28:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56211
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |x86_64-*-*
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2013-02-05
Component|tree-optimization |target
Ever Confirmed|0 |1
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-02-05 07:27:56 UTC ---
This really sounds like a bug in a mismatched function declarations and
definitions. Meaning this is not a GCC bug but rather a bug in the source you
are using. Make sure bool is defined the same in both sides of the call.
The reason why I say this is because I just tried a simple testcase look at the
output of the code and found it does the correct thing.
Like:
_Bool g(void);
void h(void);
void f(void)
{
if (!g())
return h();
}
---- CUT ----
This assumes the yesno function is declared with a _Bool return type on the
calee side.
That produces:
call g
testb %al, %al
Which is not what is located in the generated assembly code that you provided:
405402: e8 99 7e 00 00 callq 40d2a0 <yesno>
405407: 85 c0 test %eax,%eax
More information about the Gcc-bugs
mailing list