From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1958 invoked by alias); 14 Oct 2007 10:08:19 -0000 Received: (qmail 1948 invoked by uid 22791); 14 Oct 2007 10:08:18 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 14 Oct 2007 10:08:07 +0000 Received: (qmail 18853 invoked from network); 14 Oct 2007 10:08:04 -0000 Received: from unknown (HELO maxim-kuvyrkovs-computer.local) (maxim@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Oct 2007 10:08:04 -0000 Message-ID: <4711EA7D.4020004@codesourcery.com> Date: Sun, 14 Oct 2007 10:16:00 -0000 From: Maxim Kuvyrkov User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: gcc-patches CC: Vladimir Makarov , James E Wilson , Roman Zippel Subject: [PATCH][3/3] Unbreak m68k bootstrap References: <4711E7FF.7010002@codesourcery.com> In-Reply-To: <4711E7FF.7010002@codesourcery.com> Content-Type: multipart/mixed; boundary="------------080204030801080803030505" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-10/txt/msg00819.txt.bz2 This is a multi-part message in MIME format. --------------080204030801080803030505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 482 Hi, This patch makes scheduler files to be predicated on INSN_SCHEDULING, which fixes bootstrap-time warnings on targets without scheduling support. I suspect fine-grain use of INSN_SCHEDULING was provoked by some historical reasons, but at current point I don't see any justification for that. The patch was bootstrapped both on targets that don't have scheduling (m68k) and on those which do (x86_64, ia64 and ppc64). OK for trunk? :ADDPATCH scheduler: Thanks, Maxim --------------080204030801080803030505 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="m68k-v3.ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="m68k-v3.ChangeLog" Content-length: 338 2007-10-12 Maxim Kuvyrkov * sched-ebb.c: Surround code with '#ifdef INSN_SCHEDULING'. * ddg.c: Ditto. * sched-deps.c: Ditto. Remove nested #ifdef's INSN_SCHEDULING. * sched-int.h: Surround declarations with '#ifdef INSN_SCHEDULING'. (print_insn): Move declaration to ... * rtl.h (print_insn): ... here. --------------080204030801080803030505 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="m68k-v3.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="m68k-v3.patch" Content-length: 6439 Index: sched-ebb.c =================================================================== --- sched-ebb.c (revision 184625) +++ sched-ebb.c (working copy) @@ -44,6 +44,8 @@ along with GCC; see the file COPYING3. #include "output.h" +#ifdef INSN_SCHEDULING + /* The number of insns scheduled so far. */ static int sched_n_insns; @@ -696,3 +698,5 @@ fix_recovery_cfg (int bbi ATTRIBUTE_UNUS if (jump_bb_nexti == last_bb->index) last_bb = BASIC_BLOCK (jump_bbi); } + +#endif /* INSN_SCHEDULING */ Index: ddg.c =================================================================== --- ddg.c (revision 184625) +++ ddg.c (working copy) @@ -44,6 +44,8 @@ along with GCC; see the file COPYING3. #include "bitmap.h" #include "ddg.h" +#ifdef INSN_SCHEDULING + /* A flag indicating that a ddg edge belongs to an SCC or not. */ enum edge_flag {NOT_IN_SCC = 0, IN_SCC}; @@ -1104,3 +1106,5 @@ longest_simple_path (struct ddg * g, int sbitmap_free (tmp); return result; } + +#endif /* INSN_SCHEDULING */ Index: sched-deps.c =================================================================== --- sched-deps.c (revision 184625) +++ sched-deps.c (working copy) @@ -42,6 +42,8 @@ along with GCC; see the file COPYING3. #include "params.h" #include "cselib.h" +#ifdef INSN_SCHEDULING + #ifdef ENABLE_CHECKING #define CHECK (true) #else @@ -437,11 +439,9 @@ static enum DEPS_ADJUST_RESULT maybe_add static enum DEPS_ADJUST_RESULT add_or_update_dep_1 (dep_t, bool, rtx, rtx); static dw_t estimate_dep_weak (rtx, rtx); -#ifdef INSN_SCHEDULING #ifdef ENABLE_CHECKING static void check_dep (dep_t, bool); #endif -#endif /* Return nonzero if a load of the memory reference MEM can cause a trap. */ @@ -752,11 +752,9 @@ maybe_add_or_update_dep_1 (dep_t dep, bo /* Don't depend an insn on itself. */ if (insn == elem) { -#ifdef INSN_SCHEDULING if (current_sched_info->flags & DO_SPECULATION) /* INSN has an internal dependence, which we can't overcome. */ HAS_INTERNAL_DEP (insn) = 1; -#endif return DEP_NODEP; } @@ -764,7 +762,6 @@ maybe_add_or_update_dep_1 (dep_t dep, bo return add_or_update_dep_1 (dep, resolved_p, mem1, mem2); } -#ifdef INSN_SCHEDULING /* Ask dependency caches what needs to be done for dependence DEP. Return DEP_CREATED if new dependence should be created and there is no need to try to find one searching the dependencies lists. @@ -935,7 +932,6 @@ change_spec_dep_to_hard (sd_iterator_def bitmap_clear_bit (&spec_dependency_cache[INSN_LUID (insn)], INSN_LUID (elem)); } -#endif /* Update DEP to incorporate information from NEW_DEP. SD_IT points to DEP in case it should be moved to another list. @@ -959,7 +955,6 @@ update_dep (dep_t dep, dep_t new_dep, res = DEP_CHANGED; } -#ifdef INSN_SCHEDULING if (current_sched_info->flags & USE_DEPS_LIST) /* Update DEP_STATUS. */ { @@ -1009,7 +1004,6 @@ update_dep (dep_t dep, dep_t new_dep, if (true_dependency_cache != NULL && res == DEP_CHANGED) update_dependency_caches (dep, old_type); -#endif return res; } @@ -1031,8 +1025,6 @@ add_or_update_dep_1 (dep_t new_dep, bool gcc_assert (INSN_P (DEP_PRO (new_dep)) && INSN_P (DEP_CON (new_dep)) && DEP_PRO (new_dep) != DEP_CON (new_dep)); -#ifdef INSN_SCHEDULING - #ifdef ENABLE_CHECKING check_dep (new_dep, mem1 != NULL); #endif @@ -1059,7 +1051,6 @@ add_or_update_dep_1 (dep_t new_dep, bool break; } } -#endif /* Check that we don't already have this dependence. */ if (maybe_present_p) @@ -1148,7 +1139,6 @@ sd_add_dep (dep_t dep, bool resolved_p) add_to_deps_list (DEP_NODE_BACK (n), con_back_deps); -#ifdef INSN_SCHEDULING #ifdef ENABLE_CHECKING check_dep (dep, false); #endif @@ -1159,7 +1149,6 @@ sd_add_dep (dep_t dep, bool resolved_p) in the bitmap caches of dependency information. */ if (true_dependency_cache != NULL) set_dependency_caches (dep); -#endif } /* Add or update backward dependence between INSN and ELEM @@ -2202,7 +2191,6 @@ sched_analyze_insn (struct deps *deps, r if (SCHED_GROUP_P (insn)) fixup_sched_groups (insn); -#ifdef INSN_SCHEDULING if ((current_sched_info->flags & DO_SPECULATION) && !sched_insn_is_legitimate_for_speculation_p (insn, 0)) /* INSN has an internal dependency (e.g. r14 = [r14]) and thus cannot @@ -2215,7 +2203,6 @@ sched_analyze_insn (struct deps *deps, r sd_iterator_cond (&sd_it, &dep);) change_spec_dep_to_hard (sd_it); } -#endif } /* Analyze every insn between HEAD and TAIL inclusive, creating backward @@ -2788,7 +2775,6 @@ debug_ds (ds_t s) fprintf (stderr, "\n"); } -#ifdef INSN_SCHEDULING #ifdef ENABLE_CHECKING /* Verify that dependence type and status are consistent. If RELAXED_P is true, then skip dep_weakness checks. */ @@ -2871,5 +2857,6 @@ check_dep (dep_t dep, bool relaxed_p) gcc_assert (ds & BEGIN_CONTROL); } } -#endif -#endif +#endif /* ENABLE_CHECKING */ + +#endif /* INSN_SCHEDULING */ Index: sched-int.h =================================================================== --- sched-int.h (revision 184625) +++ sched-int.h (working copy) @@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. #ifndef GCC_SCHED_INT_H #define GCC_SCHED_INT_H +#ifdef INSN_SCHEDULING + /* For state_t. */ #include "insn-attr.h" /* For regset_head. */ @@ -807,9 +809,6 @@ enum INSN_TRAP_CLASS #define HAIFA_INLINE __inline #endif -/* Functions in sched-vis.c. */ -extern void print_insn (char *, rtx, int); - /* Functions in sched-deps.c. */ extern bool sched_insns_conditions_mutex_p (const_rtx, const_rtx); extern void add_dependence (rtx, rtx, enum reg_note); @@ -992,4 +991,6 @@ extern void sd_copy_back_deps (rtx, rtx, extern void sd_delete_dep (sd_iterator_def); extern void sd_debug_lists (rtx, sd_list_types_def); +#endif /* INSN_SCHEDULING */ + #endif /* GCC_SCHED_INT_H */ Index: rtl.h =================================================================== --- rtl.h (revision 184625) +++ rtl.h (working copy) @@ -2109,6 +2111,7 @@ extern void dump_combine_total_stats (FI extern void delete_dead_jumptables (void); /* In sched-vis.c. */ +extern void print_insn (char *, rtx, int); extern void print_rtl_slim_with_bb (FILE *, rtx, int); extern void dump_insn_slim (FILE *f, rtx x); extern void debug_insn_slim (rtx x); --------------080204030801080803030505--