[PATCH] Fix PR 25578 (Fortran front-end miscompilation)
Jakub Jelinek
jakub@redhat.com
Mon Jan 2 09:29:00 GMT 2006
On Mon, Jan 02, 2006 at 10:16:18AM +0100, Paolo Bonzini wrote:
> 2006-01-02 Paolo Bonzini <bonzini@gnu.org>
>
> * gcc.c-torture/execute/20060102-1.c: New testcase.
> extern void abort ();
>
> int f(int x)
> {
> return (x >> 31) ? -1 : 1;
> }
>
> void main (int argc)
> {
> /* Test that the function above returns different values for
> different signs. */
> if (f(argc) == f(-argc))
> abort ();
> }
dejagnu isn't checking just if the test aborted, but also if
it exited with non-zero exit value.
So while void main (...) {} without return statement might
happen to work on some arch, it will almost surely not work
on many others. Please change it into int main (...) { ... return 0; }
Jakub
More information about the Gcc-patches
mailing list