This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[bfin] Fix build issue
- From: Jie Zhang <jie dot zhang at analog dot com>
- To: Bernd Schmidt <bernds_cb1 at t-online dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 11 Sep 2009 22:57:50 +0800
- Subject: [bfin] Fix build issue
The latest SVN trunk GCC does not build for bfin-elf target because of
get_attr_xxx cannot deal with debug_insn. This patch fixes this issue.
Is it OK?
Jie
* config/bfin/bfin.c (length_for_loop): Use NONDEBUG_INSN_P
instead of INSN_P.
(bfin_optimize_loop): Likewise.
(bfin_gen_bundles): Likewise.
(workaround_speculation): Likewise.
(find_load): Return NULL_RTX for debug_insn.
Index: config/bfin/bfin.c
===================================================================
--- config/bfin/bfin.c (revision 151632)
+++ config/bfin/bfin.c (working copy)
@@ -3824,7 +3824,7 @@ length_for_loop (rtx insn)
length = 4;
}
- if (INSN_P (insn))
+ if (NONDEBUG_INSN_P (insn))
length += get_attr_length (insn);
return length;
@@ -4061,7 +4061,7 @@ bfin_optimize_loop (loop_info loop)
{
for (; last_insn != BB_HEAD (bb);
last_insn = find_prev_insn_start (last_insn))
- if (INSN_P (last_insn))
+ if (NONDEBUG_INSN_P (last_insn))
break;
if (last_insn != BB_HEAD (bb))
@@ -4825,7 +4825,7 @@ bfin_gen_bundles (void)
int at_end;
rtx delete_this = NULL_RTX;
- if (INSN_P (insn))
+ if (NONDEBUG_INSN_P (insn))
{
enum attr_type type = get_attr_type (insn);
@@ -5079,6 +5079,8 @@ trapping_loads_p (rtx insn, int np_reg,
static rtx
find_load (rtx insn)
{
+ if (!NONDEBUG_INSN_P (insn))
+ return NULL_RTX;
if (get_attr_type (insn) == TYPE_MCLD)
return insn;
if (GET_MODE (insn) != SImode)
@@ -5199,7 +5201,7 @@ workaround_speculation (void)
delay_needed = 3;
}
}
- else if (INSN_P (insn))
+ else if (NONDEBUG_INSN_P (insn))
{
rtx load_insn = find_load (insn);
enum attr_type type = type_for_anomaly (insn);
@@ -5312,7 +5314,7 @@ workaround_speculation (void)
|| GET_CODE (pat) == ADDR_DIFF_VEC || asm_noperands (pat) >= 0)
continue;
- if (INSN_P (target))
+ if (NONDEBUG_INSN_P (target))
{
rtx load_insn = find_load (target);
enum attr_type type = type_for_anomaly (target);