This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Wrong optimization in current CVS
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: Wrong optimization in current CVS
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Thu, 16 Nov 2000 01:07:58 +0100
- References: <00111600521800.07599@enzo.bigblue.local>
On Thursday 16 November 2000 00:52, Franz Sirl wrote:
> Hi,
>
> the attached testcase nicely shows a recently introduced optimization that
> affects linux kernel compilation. I actually noticed it while fixing
> warnings in the kernel.
>
> OK to commit as execute/20001115-1.c?
Argh, forgot to attach!
Franz.
extern void abort (void);
extern void exit (int);
struct iso_directory_record {
unsigned char name_len [1];
char name [0];
} entry;
void set(struct iso_directory_record *);
int main (void)
{
struct iso_directory_record *de;
de = &entry;
set(de);
if (de->name_len[0] == 1 && de->name[0] == 0)
exit (0);
else
abort ();
}
void set (struct iso_directory_record *p)
{
p->name_len[0] = 1;
return;
}