[Bug c++/47749] Wrong function return value

elpa.rizzo at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Feb 15 12:12:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47749

--- Comment #5 from Davide Rizzo <elpa.rizzo at gmail dot com> 2011-02-15 12:05:58 UTC ---
No, with this testcase it doesn't abort.
I think the return value is random not only with flag=false (that could be
acceptable), but also with flag=true.
I don't use any compiler flag, I tried with -O0, -O1, -O2 and -O3 but I
didn't notice any difference.
Unfortunately I cannot try other compiler's versions.
Comparing the arm assembler listings, in the failing version the statement
that restores the correct return value in the return register is missing.

2011/2/15 rguenth at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47749
>
> --- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org>
> 2011-02-15 11:18:45 UTC ---
> does adding
>
> extern "C" void abort (void);
> int main() { if (!fn_bad (true)) abort(); return 0; }
>
> cause the testcase to abort at runtime?  Which flags are you using for
> compiling?
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
>



More information about the Gcc-bugs mailing list