This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/71120] [6/7 Regression] Aliasing "struct sockaddr_storage" produces invalid code
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 May 2016 08:47:54 +0000
- Subject: [Bug tree-optimization/71120] [6/7 Regression] Aliasing "struct sockaddr_storage" produces invalid code
- Auto-submitted: auto-generated
- References: <bug-71120-4 at http dot gcc dot gnu dot org/bugzilla/>
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.