[Bug c/2480] aliasing problem with global structures

dann at godzilla dot ics dot uci dot edu gcc-bugzilla@gcc.gnu.org
Mon Jan 19 19:42:00 GMT 2004


------- 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



More information about the Gcc-bugs mailing list