This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/2480] aliasing problem with global structures
- From: "dann at godzilla dot ics dot uci dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jan 2004 19:42:45 -0000
- Subject: [Bug c/2480] aliasing problem with global structures
- References: <20010403165559.2480.dann@godzilla.ics.uci.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dann at godzilla dot ics dot uci dot edu 2004-01-19 19:42 -------
No, tree-ssa does not help.
RTL optimizers can optimize the "foo" function in the testcase,
the tree-ssa optimizers don't, here is the .optimized dump:
foo (ex2)
{
<bb 0>:
ex2->a = 1;
ex2->b = 2;
ex2->c = 3;
if (ex2->a != 1) goto <L0>; else goto <L1>;
<L0>:;
link_error ();
<L1>:;
if (ex2->b != 2) goto <L2>; else goto <L3>;
<L2>:;
link_error ();
<L3>:;
if (ex2->c != 3) goto <L4>; else goto <L5>;
<L4>:;
link_error ();
<L5>:;
return;
}
The x86 aseembly:
foo:
movl 4(%esp), %eax
movb $1, (%eax)
movl $2, 4(%eax)
movb $3, 8(%eax)
ret
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2480