public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/34363]  New: Aliasing failure during tree fre
@ 2007-12-06 18:35 davidu at mips dot com
  2007-12-07  0:14 ` [Bug c/34363] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: davidu at mips dot com @ 2007-12-06 18:35 UTC (permalink / raw)
  To: gcc-bugs

Simple test case:

unsigned n;

void foo (unsigned *p)
{
  n = 4;
  *p = 0;
  if (n != 0)
    abort ();
}

main ()
{
  foo (&n);
  return 0;
}

Tested cross-compiling for MIPS, also verified that x86 also has the same
problem.
attached dump from the fre pass.
**** basically n.0_4 should not be assigned the value of 4, since *p can alias
it.

;; Function foo (foo)

Created value VH.0 for p_3
exp_gen[0] := {  }
tmp_gen[0] := { p_3 (VH.0)  }
avail_out[0] := { p_3 (VH.0)  }
exp_gen[2] := {  }
tmp_gen[2] := {  }
avail_out[2] := { p_3 (VH.0)  }
exp_gen[3] := {  }
tmp_gen[3] := {  }
avail_out[3] := { p_3 (VH.0)  }
exp_gen[4] := {  }
tmp_gen[4] := {  }
avail_out[4] := { p_3 (VH.0)  }
exp_gen[1] := {  }
tmp_gen[1] := {  }
avail_out[1] := {  }
Replaced n with 4 in n.0_4 = n;
foo (p)
{
  unsigned int n.0;

<bb 2>:
  n = 4;
  *p_3 = 0;
  n.0_4 = 4;                                    *****
  if (n.0_4 != 0) goto <L0>; else goto <L1>;

<L0>:;
  abort ();

<L1>:;
  return;

}


-- 
           Summary: Aliasing failure during tree fre
           Product: gcc
           Version: 4.2.3
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davidu at mips dot com


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-03-31  1:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-06 18:35 [Bug c/34363] New: Aliasing failure during tree fre davidu at mips dot com
2007-12-07  0:14 ` [Bug c/34363] " pinskia at gcc dot gnu dot org
2007-12-07 10:25 ` [Bug tree-optimization/34363] [4.2 Regression] " rguenth at gcc dot gnu dot org
2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
2008-02-08  0:31 ` pinskia at gcc dot gnu dot org
2008-04-30 20:18 ` sandra at codesourcery dot com
2008-04-30 21:24 ` rguenth at gcc dot gnu dot org
2008-05-19 20:31 ` jsm28 at gcc dot gnu dot org
2009-03-31  1:39 ` jsm28 at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).