+Sat Feb 27 19:29:46 1999 Toon Moene <toon@moene.indiv.nluug.nl>
+ Mark Mitchell <mark@markmitchell.com>
+ Jeffrey A Law (law@cygnus.com)
+
+ * alias.c (true_dependence): Only apply MEM_IN_STRUCT_P tests
+ when flag_structure_noalias is set.
+ * toplev.c (flag_structure_noalias): New variable.
+ (f_options): Add -fstructure-noalias.
+ * flags.h (flag_structure_noalias): Declare.
+ * invoke.texi: Update documentation.
+
Sat Feb 27 19:19:36 1999 Jeffrey A Law (law@cygnus.com)
* SERVICE: Update from the FSF.
If either memory reference is a variable structure the other is a
fixed scalar and there is no aliasing. */
- if ((MEM_IN_STRUCT_P (mem) && varies (mem_addr))
- || (MEM_IN_STRUCT_P (x) && varies (x_addr)))
- return 0;
+
+ /* Disabled by default for egcs 1.1.x as alias analysis isn't good
+ enough yet to discover all cases where this doesn't apply. */
+ if (flag_structure_noalias)
+ {
+ if ((MEM_IN_STRUCT_P (mem) && varies (mem_addr))
+ || (MEM_IN_STRUCT_P (x) && varies (x_addr)))
+ return 0;
+ }
return 1;
}
extern int flag_rerun_loop_opt;
+/* Nonzero means to assume that a structure or an array reference at
+ a varying address cannot alias a scalar at a fixed address. */
+
+extern int flag_structure_noalias;
+
/* Nonzero means make functions that look like good inline candidates
go inline. */
-fschedule-insns2 -fstrength-reduce -fthread-jumps
-funroll-all-loops -funroll-loops
-fmove-all-movables -freduce-all-givs -fstrict-aliasing
+-fstructure-noalias
-O -O0 -O1 -O2 -O3 -Os
@end smallexample
@code{c_get_alias_set}.
@end ifset
+@item -fstructure-noalias
+Allows the compiler to assume that structure / varying array references
+do not alias fixed scalars.
+
+Although this optimization is safe, GCC can occasionally lose track
+of which references refer to scalars and which to structures,
+leading it to perform unsafe transformations. Release 1.2 of EGCS
+will incorporate changes which allow GCC to track the
+scalar/structure distinction safely. Thus, the optimization will
+always be same, and this option will likely be removed or will have
+no effect.
@end table
@node Preprocessor Options
static int flag_rerun_cse_after_loop;
+/* Nonzero means to assume that a structure or an array reference at
+ a varying address cannot alias a scalar at a fixed address. */
+
+int flag_structure_noalias = 0;
+
/* Nonzero means to run loop optimizations twice. */
int flag_rerun_loop_opt;
"Perform the global common subexpression elimination" },
{"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1,
"Run CSE pass after loop optimisations"},
+ {"structure-noalias", &flag_structure_noalias, 1,
+ "Assume structure / array reference and fixed scalar cannot alias"},
{"rerun-loop-opt", &flag_rerun_loop_opt, 1,
"Run the loop optimiser twice"},
{"pretend-float", &flag_pretend_float, 1,