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

enable checking for stage1 compiler


This patch builds the stage1 compiler with checking enabled, regardless
of the final compiler's checking status.

The change to ssa_verify is necessary to avoid a comparison failure.
Without it checking compiler and unchecking compilers end up with dominance
graphs with differently ordered child nodes.

booted & tested on i686-pc-linux-gnu, ok?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2004-09-13  Nathan Sidwell  <nathan@codesourcery.com>

	* Makefile.in (STAGE1_CHECKING): New variable.
	(stage1_build): Use it.
	* tree-ssa.c (verify_ssa): Preserve state of dominance
	information.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1384
diff -c -3 -p -r1.1384 Makefile.in
*** Makefile.in	11 Sep 2004 04:22:14 -0000	1.1384
--- Makefile.in	13 Sep 2004 12:47:10 -0000
*************** BOOT_LANGUAGES = c @all_boot_languages@
*** 134,139 ****
--- 134,140 ----
  # or BOOT_CFLAGS
  # STAGE1_CFLAGS is set by configure on some targets or passed from toplevel
  # and sets the CFLAGS passed to stage1 of a bootstrap compilation.
+ # STAGE1_CHECKING enables checking for the stage1 compiler
  # BOOT_CFLAGS is the value of CFLAGS to pass to the stage2, stage3 and stage4
  # bootstrap compilations.
  # XCFLAGS is used for most compilations but not when using the GCC just built.
*************** XCFLAGS =
*** 142,147 ****
--- 143,149 ----
  TCFLAGS =
  CFLAGS = -g
  STAGE1_CFLAGS = -g @stage1_cflags@
+ STAGE1_CHECKING = -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING
  BOOT_CFLAGS = -g -O2
  
  # Flags to determine code coverage. When coverage is disabled, this will
*************** STAGEFEEDBACK_FLAGS_TO_PASS = \
*** 3631,3641 ****
  # only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
  # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
  # overrideable (for a bootstrap build stage1 also builds gcc.info).
  stage1_build:
  	$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
! 		CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \
! 		MAKEINFOFLAGS="$(MAKEINFOFLAGS)" COVERAGE_FLAGS= \
! 		OBJS-onestep="$(OBJS)"
  	$(STAMP) stage1_build
  	echo stage1_build > stage_last
  
--- 3633,3644 ----
  # only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
  # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
  # overrideable (for a bootstrap build stage1 also builds gcc.info).
+ # The stage1 compiler is always built with checking enabled.
  stage1_build:
  	$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
! 		CFLAGS="$(STAGE1_CFLAGS) $(STAGE1_CHECKING)" \
! 		MAKEINFO="$(MAKEINFO)" MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
! 		COVERAGE_FLAGS= OBJS-onestep="$(OBJS)"
  	$(STAMP) stage1_build
  	echo stage1_build > stage_last
  
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.35
diff -c -3 -p -r2.35 tree-ssa.c
*** tree-ssa.c	11 Sep 2004 20:42:06 -0000	2.35
--- tree-ssa.c	13 Sep 2004 12:47:26 -0000
*************** verify_ssa (void)
*** 505,510 ****
--- 505,511 ----
    basic_block *definition_block = xcalloc (num_ssa_names, sizeof (basic_block));
    ssa_op_iter iter;
    tree op;
+   enum dom_state orig_dom_state = dom_computed[CDI_DOMINATORS];
  
    timevar_push (TV_TREE_SSA_VERIFY);
  
*************** verify_ssa (void)
*** 605,610 ****
--- 606,618 ----
    verify_alias_info ();
  
    free (definition_block);
+   /* Restore the dominance infomation to its prior known state, so
+      that we do not perturb the compiler's subsequent behaviour.  */
+   if (orig_dom_state == DOM_NONE)
+     free_dominance_info (CDI_DOMINATORS);
+   else
+     dom_computed[CDI_DOMINATORS] = orig_dom_state;
+   
    timevar_pop (TV_TREE_SSA_VERIFY);
    return;
  

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