This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Loop bug generates invalid code on s390
- From: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: jakub at redhat dot com
- Cc: weigand at i1 dot informatik dot uni-erlangen dot de (Ulrich Weigand), gcc-patches at gcc dot gnu dot org
- Date: Wed, 17 Dec 2003 01:11:45 +0100 (CET)
- Subject: Re: [PATCH] Loop bug generates invalid code on s390
Jakub Jelinek wrote:
>Then you can write:
>{ dg-do run }
>{ dg-options "-O2" }
>{ dg-options "-O2 -fPIC" { target s390*-*-* } }
OK, I'll do that.
> > > Also, there is missing exit (0) or return 0 in main ().
> >
> > This is not required by the C standard. (C99: 5.1.2.2.3)
>
> Only C99+ though, and you are not passing -std=c99 nor -std=gnu99.
> GCC only adds implicit return 0 if -std={c,gnu}99.
While I don't have the C89 standard, I had been under the
impression that the implicit return 0 was OK there as well.
And I've just verified that gcc accepts
int main (void) { }
without warning and generates code to return 0 even with
-Wall -Wextra -std=c89 -pedantic
But I'll add an explicit return 0 anyway ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
weigand@informatik.uni-erlangen.de