This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Clarification on gcc tail call optimization
- From: Andrew Haley <aph at redhat dot com>
- To: raghesh <raghesh dot a at gmail dot com>, gcc-help at gcc dot gnu dot org
- Date: Mon, 31 Oct 2016 11:28:44 +0000
- Subject: Re: Clarification on gcc tail call optimization
- Authentication-results: sourceware.org; auth=none
- References: <CAG17Fsv4HEZRzsZAjhoNSgzJswQiYRScPCsZaqviAkMmFgru8g@mail.gmail.com>
On 31/10/16 10:28, raghesh wrote:
> I am trying to perform tail call optimization on the code given at the
> end of this mail (it is also attached).
$ gcc -Wall -O2 struct.c
struct.c: In function 'h':
struct.c:25:36: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
struct arglist_g al_g = *((struct arglist_g *) &al);
^
struct.c: In function 'g':
struct.c:30:36: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
struct arglist_f al_f = *((struct arglist_f *) &al);
^
struct.c:37:40: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
struct arglist_max al_max = *((struct arglist_max *) &al_g);
^
struct.c:30:19: warning: unused variable 'al_f' [-Wunused-variable]
struct arglist_f al_f = *((struct arglist_f *) &al);
^
struct.c: In function 'f':
struct.c:47:40: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
struct arglist_max al_max = *((struct arglist_max *) &al_f);
^
Please fix these bugs and then get back to us.
Andrew.