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/17252] [3.5 Regression] LIM can create wrong code because of aliasing


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-31 23:01 -------
This does not work for me the same way but this is still an aliasing bug.

tin:~/src/gnu/gcctest>gcc -v
Reading specs from /home/gates/pinskia/linux/lib/gcc/i686-pc-linux-gnu/3.5.0/specs
Configured with: /home/gates/pinskia/src/gnu/gcc/src/configure --target=i686-pc-linux-gnu --
host=i686-pc-linux-gnu --enable-__cxa_atexit --enable-languages=c++,objc,java --prefix=/home/
gates/pinskia/linux --enable-threads=posix --enable-sharedThread model: posixgcc version 3.5.0 
20040831 (experimental)

--- pr17252.c.t47.loopinit      2004-08-31 18:46:21.190000000 -0400
+++ pr17252.c.t48.lim   2004-08-31 18:46:21.240000000 -0400
@@ -1,21 +1,6 @@
 
 ;; Function g (g)
 
-;; 2 loops found, 2 levels
-;;
-;; Loop 0:
-;;  header -1, latch -2, pre-header -1
-;;  depth 0, level 2, outer -1
-;;  nodes: -1 0 1 3 2 -2
-;;
-;; Loop 1:
-;;  header 1, latch 3, pre-header -1
-;;  depth 1, level 1, outer 0
-;;  nodes: 1 3
-;; 0 succs { 1 }
-;; 1 succs { 2 3 }
-;; 3 succs { 1 }
-;; 2 succs { -2 }
 g ()
 {
   int i;
@@ -25,10 +10,10 @@ g ()
   char * a.0;
 
 <bb 0>:
+  a.0_4 = a;
 
   # i_15 = PHI <0(0), i_8(3)>;
 <L0>:;
-  a.0_4 = a;
   i.1_5 = (unsigned int)i_15;
   i.2_6 = (char *)i.1_5;
   T.3_7 = a.0_4 + i.2_6;

Basically since *a can change a by the definition of the C aliasing rules we cannot move the load of the 
global out of the loop.

One should note that:
  #   TMT.5<D1139>_11 = V_MAY_DEF <TMT.5<D1139>_14>;
  *T.3<D1126>_7 = 0;
there is no V_MAY_DEF for the global a at all when there should be.

Anyways Danny told me to assign it to you:
[14:56] < DannyB> You should probably retitle the bug and assign it to diego then

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at gcc dot gnu dot
                   |                            |org


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


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