This is the mail archive of the 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]

[4.2] PR ada/26797

The VRP pass has been made more aggressive for 4.2, triggering the failures of 
ACATS c35507m cd2a23e cxh1001 at -O2 on all platforms, and unfortunately we 
haven't settled on the best approach to countering that yet.  Therefore this 
patch disables VRP by defaut for Ada (but -ftree-vrp of course still works).

Bootstrapped/regtested on i586-suse-linux, ACATS is now clean again at -O2.

OK for 4.2 branch?

2007-03-01  Eric Botcazou  <>

	PR ada/26797
	* doc/invoked.texi (-O2): Document that Tree-VRP is not turned on
	for the Ada compiler.
	* lang.opt: Accept ftree-vrp for Ada.
	* misc.c (OPT_ftree_vrp): New case.
	(gnat_post_options): Disable Tree-VRP unless explicitly turned on.

Eric Botcazou
Index: doc/invoke.texi
--- doc/invoke.texi	(revision 122253)
+++ doc/invoke.texi	(working copy)
@@ -4539,6 +4539,10 @@ also turns on the following optimization
 Please note the warning under @option{-fgcse} about
 invoking @option{-O2} on programs that use computed gotos.
+@option{-O2} doesn't turn on @option{-ftree-vrp} for the Ada compiler.
+This option must be explicitly specified on the command line to be
+enabled for the Ada compiler.
 @item -O3
 @opindex O3
 Optimize yet more.  @option{-O3} turns on all optimizations specified by
Index: ada/lang.opt
--- ada/lang.opt	(revision 122253)
+++ ada/lang.opt	(working copy)
@@ -69,6 +69,11 @@ nostdlib
 ; Don't look for object files
+; Effect documented in common.opt - intercepted for Ada
+; to force the associated flag not to be set by default.
 Ada Joined RejectNegative
 ; Selects the runtime
Index: ada/misc.c
--- ada/misc.c	(revision 122425)
+++ ada/misc.c	(working copy)
@@ -303,6 +303,12 @@ gnat_handle_option (size_t scode, const 
+    case OPT_ftree_vrp:
+      /* We arrange for post_option to be able to set the corresponding
+	 flag to 1 only when explicitly requested by the user.  */
+      flag_tree_vrp = -value;
+      break;
     case OPT_fRTS_:
       gnat_argv[gnat_argc] = xstrdup ("-fRTS");
@@ -368,6 +374,13 @@ gnat_post_options (const char **pfilenam
   flag_tree_salias = 0;
+  /* Disable Tree-VRP unless an explicit positive -f has been passed.
+     This forces the default to 0 for Ada.  */
+  if (flag_tree_vrp < 0)
+    flag_tree_vrp = 1;
+  else
+    flag_tree_vrp = 0; 
   return false;

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