This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/71120] [6/7 Regression] Aliasing "struct sockaddr_storage" produces invalid code


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71120

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2016-05-17
          Component|c                           |tree-optimization
      Known to work|                            |5.3.0
   Target Milestone|---                         |6.2
            Summary|Aliasing "struct            |[6/7 Regression] Aliasing
                   |sockaddr_storage" produces  |"struct sockaddr_storage"
                   |invalid code                |produces invalid code
     Ever confirmed|0                           |1
      Known to fail|                            |6.1.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  ESRA replaces the aggregate copy

  ss = ss3;

which enables FRE1 to do "interesting" things:

  memset (&ss3, 0, 128);
  ss3.ss_family = 2;
  _6 = inet_addr ("127.0.0.1");
  MEM[(struct sockaddr_in *)&ss3].sin_addr.s_addr = _6;
  ss = ss3;
  l_11 = calloc (1, 128);
  MEM[(struct dbg_listener *)l_11] = 2;
  MEM[(struct dbg_listener *)l_11 + 8B] = 0;
  MEM[(struct dbg_listener *)l_11 + 16B] = 0;
  MEM[(struct dbg_listener *)l_11 + 17B] = 0;
...

so it seems to reach the memset, ignoring the sin_addr.s_addr store.

Mine.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]