diff options
author | ctice <ctice@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-18 21:08:05 +0000 |
---|---|---|
committer | ctice <ctice@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-18 21:08:05 +0000 |
commit | 22e3029e598446652b3c8b66c9dfcad6297f2387 (patch) | |
tree | 51d879b746fd960e201cbfce4abd84fca7bfc7a6 /gcc/var-tracking.c | |
parent | 837a67dad40ca937b15a0d4151e501763bf41ed8 (diff) | |
download | gcc-22e3029e598446652b3c8b66c9dfcad6297f2387.tar.gz |
Fix bootstrap on ia64, PR32764
2007-07-18 Caroline Tice <ctice@apple.com>
* var-tracking.c (find_src_status): Check for COND_EXEC insns
and handle them correctly; check that src is not NULL before
trying to use it.
(find_src_set_src): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126731 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/var-tracking.c')
-rw-r--r-- | gcc/var-tracking.c | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 56dcc198d7d..bdc173ef5a3 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -1806,27 +1806,33 @@ static enum var_init_status find_src_status (dataflow_set *in, rtx loc, rtx insn) { rtx src = NULL_RTX; + rtx pattern; tree decl = NULL_TREE; enum var_init_status status = VAR_INIT_STATUS_UNINITIALIZED; if (! flag_var_tracking_uninit) status = VAR_INIT_STATUS_INITIALIZED; - if (GET_CODE (PATTERN (insn)) == SET) - src = SET_SRC (PATTERN (insn)); - else if (GET_CODE (PATTERN (insn)) == PARALLEL - || GET_CODE (PATTERN (insn)) == SEQUENCE) + pattern = PATTERN (insn); + + if (GET_CODE (pattern) == COND_EXEC) + pattern = COND_EXEC_CODE (pattern); + + if (GET_CODE (pattern) == SET) + src = SET_SRC (pattern); + else if (GET_CODE (pattern) == PARALLEL + || GET_CODE (pattern) == SEQUENCE) { int i; - for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--) - if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == SET - && SET_DEST (XVECEXP (PATTERN (insn), 0, i)) == loc) - src = SET_SRC (XVECEXP (PATTERN (insn), 0, i)); + for (i = XVECLEN (pattern, 0) - 1; i >= 0; i--) + if (GET_CODE (XVECEXP (pattern, 0, i)) == SET + && SET_DEST (XVECEXP (pattern, 0, i)) == loc) + src = SET_SRC (XVECEXP (pattern, 0, i)); } - if (REG_P (src)) + if (src && REG_P (src)) decl = var_debug_decl (REG_EXPR (src)); - else if (MEM_P (src)) + else if (src && MEM_P (src)) decl = var_debug_decl (MEM_EXPR (src)); if (src && decl) @@ -1845,26 +1851,32 @@ find_src_set_src (dataflow_set *set, rtx loc, rtx insn) tree decl = NULL_TREE; /* The variable being copied around. */ rtx src = NULL_RTX; /* The location "decl" is being copied from. */ rtx set_src = NULL_RTX; /* The value for "decl" stored in "src". */ + rtx pattern; void **slot; variable var; location_chain nextp; int i; bool found; - if (GET_CODE (PATTERN (insn)) == SET) - src = SET_SRC (PATTERN (insn)); - else if (GET_CODE (PATTERN (insn)) == PARALLEL - || GET_CODE (PATTERN (insn)) == SEQUENCE) + + pattern = PATTERN (insn); + if (GET_CODE (pattern) == COND_EXEC) + pattern = COND_EXEC_CODE (pattern); + + if (GET_CODE (pattern) == SET) + src = SET_SRC (pattern); + else if (GET_CODE (pattern) == PARALLEL + || GET_CODE (pattern) == SEQUENCE) { - for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--) - if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == SET - && SET_DEST (XVECEXP (PATTERN (insn), 0, i)) == loc) - src = SET_SRC (XVECEXP (PATTERN (insn), 0, i)); + for (i = XVECLEN (pattern, 0) - 1; i >= 0; i--) + if (GET_CODE (XVECEXP (pattern, 0, i)) == SET + && SET_DEST (XVECEXP (pattern, 0, i)) == loc) + src = SET_SRC (XVECEXP (pattern, 0, i)); } - if (REG_P (src)) + if (src && REG_P (src)) decl = var_debug_decl (REG_EXPR (src)); - else if (MEM_P (src)) + else if (src && MEM_P (src)) decl = var_debug_decl (MEM_EXPR (src)); if (src && decl) |