------- Comment #3 from rguenth at gcc dot gnu dot org  2008-01-21 10:36 -------
Err...

# VUSE <D.2180_13> { D.2180 }
from_8 = (struct sockaddr *) D.2180

this is not valid gimple.

Reduced testcase:

typedef union {
  __const struct sockaddr *__restrict __sockaddr__;
} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));
extern int _pure_socketcall (const struct sockaddr *);
extern int sendto (__CONST_SOCKADDR_ARG __addr);
int send(void)
{
  return sendto((void *)0);
}
int sendto(const struct sockaddr *to)
{
   return _pure_socketcall(to);
}

The bug occurs during early inlining, when the transparent union is
converted to the formal argument type of _pure_socketcall.

But I'd argue even the initial IL is bogus as it does:

  return sendto ({.__sockaddr__=0B});

not passing a middle-end correct value to the call.  We gimplify that to

  union
  {
    const struct sockaddr * restrict __sockaddr__;
  } D.1555;

  D.1555.__sockaddr__ = 0B;
  D.1556 = sendto (D.1555);


Obviously the testcase might be invalid (but we don't diagnose this), as
the prototype of sendto doesn't agree with its definition.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
           Keywords|                            |ice-on-valid-code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34885

Reply via email to