This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug middle-end/29272] [4.2 Regression] memcpy optimization causes wrong-code
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc-bugzilla at gcc dot gnu dot org
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Sep 2006 18:13:23 -0400 (EDT)
- Subject: Re: [Bug middle-end/29272] [4.2 Regression] memcpy optimization causes wrong-code
>
>
>
> ------- Comment #6 from jakub at gcc dot gnu dot org 2006-09-29 22:04 -------
> Is:
> extern void abort (void);
>
> struct S { struct S *s; } s;
> struct T { struct T *t; } t;
>
> static inline void
> foo (void *s)
> {
> struct T *p = s;
> __builtin_memcpy (&p->t, &t.t, sizeof (t.t));
I think the problem is really is &p->t include an access or not?
I know if p is NULL, this is undefined as &p->t is now have a NULL pointer
access but does that include using memcpy?
-- Pinski