EGCS bad on loop invariant optimization ?
John Carr
jfc@mit.edu
Sun Apr 19 15:57:00 GMT 1998
Try this patch.
Sun Apr 19 18:07:14 1998 John Carr <jfc@mit.edu>
* alias.c (true_dependence): If neither mode is QI or BLK and the
modes are different, X and MEM do not alias.
*** alias.c~ Fri Apr 17 15:54:33 1998
--- alias.c Sun Apr 19 18:06:30 1998
***************
*** 863,878 ****
SIZE_FOR_MODE (x), x_addr, 0))
return 0;
/* If both references are struct references, or both are not, nothing
is known about aliasing.
- If either reference is QImode or BLKmode, ANSI C permits aliasing.
-
If both addresses are constant, or both are not, nothing is known
about aliasing. */
if (MEM_IN_STRUCT_P (x) == MEM_IN_STRUCT_P (mem)
- || mem_mode == QImode || mem_mode == BLKmode
- || GET_MODE (x) == QImode || GET_MODE (x) == BLKmode
|| GET_CODE (x_addr) == AND || GET_CODE (mem_addr) == AND
|| varies (x_addr) == varies (mem_addr))
return 1;
--- 863,884 ----
SIZE_FOR_MODE (x), x_addr, 0))
return 0;
+ /* If either reference is QImode or BLKmode, ANSI C permits aliasing.
+ Otherwise, if the types are different there is no aliasing. */
+ if (mem_mode == QImode || mem_mode == BLKmode
+ || GET_MODE (x) == QImode || GET_MODE (x) == BLKmode)
+ return 1;
+
+ if (mem_mode != GET_MODE (x))
+ return 0;
+
/* If both references are struct references, or both are not, nothing
is known about aliasing.
If both addresses are constant, or both are not, nothing is known
about aliasing. */
+
if (MEM_IN_STRUCT_P (x) == MEM_IN_STRUCT_P (mem)
|| GET_CODE (x_addr) == AND || GET_CODE (mem_addr) == AND
|| varies (x_addr) == varies (mem_addr))
return 1;
More information about the Gcc
mailing list