This checkin: http://gcc.gnu.org/ml/gcc-cvs/2007-07/msg00486.html causes /net/gnu-13/export/gnu/src/gcc/gcc/libgcc/../gcc/libgcc2.c: In function â__umodti3â: /net/gnu-13/export/gnu/src/gcc/gcc/libgcc/../gcc/libgcc2.c:1137: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. make[5]: *** [_umoddi3.o] Error 1 var-tracking.c has static rtx 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". */ 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) { 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)); } if (REG_P (src)) decl = var_debug_decl (REG_EXPR (src)); else if (MEM_P (src)) decl = var_debug_decl (MEM_EXPR (src)); That can't be right since src can be NULL and "if (REG_P (src))" will segfault. insn is (gdb) call debug_rtx (insn) (insn 535 895 533 50 /net/gnu-13/export/gnu/src/gcc/gcc/libgcc/../gcc/libgcc2.c:1056 (cond_exec (eq (reg:BI 262 p6 [704]) (const_int 0 [0x0])) (set (reg/v:DI 8 r8 [orig:386 m0.152 ] [386]) (reg/v:DI 15 r15 [orig:455 m0 ] [455]))) 783 {sync_lock_releasedi+5} (nil))
I am testing --- gcc/var-tracking.c.bad 2007-07-13 19:38:08.000000000 -0700 +++ gcc/var-tracking.c 2007-07-13 20:18:19.000000000 -0700 @@ -1862,6 +1862,9 @@ find_src_set_src (dataflow_set *set, rtx src = SET_SRC (XVECEXP (PATTERN (insn), 0, i)); } + if (!src) + return set_src; + if (REG_P (src)) decl = var_debug_decl (REG_EXPR (src)); else if (MEM_P (src))
This one --- gcc/var-tracking.c.bad 2007-07-13 19:38:08.000000000 -0700 +++ gcc/var-tracking.c 2007-07-13 20:24:27.000000000 -0700 @@ -1824,6 +1824,9 @@ find_src_status (dataflow_set *in, rtx l src = SET_SRC (XVECEXP (PATTERN (insn), 0, i)); } + if (!src) + return status; + if (REG_P (src)) decl = var_debug_decl (REG_EXPR (src)); else if (MEM_P (src)) @@ -1862,6 +1865,9 @@ find_src_set_src (dataflow_set *set, rtx src = SET_SRC (XVECEXP (PATTERN (insn), 0, i)); } + if (!src) + return set_src; + if (REG_P (src)) decl = var_debug_decl (REG_EXPR (src)); else if (MEM_P (src)) passes the stage 1.
(In reply to comment #2) > This one > > --- gcc/var-tracking.c.bad 2007-07-13 19:38:08.000000000 -0700 > +++ gcc/var-tracking.c 2007-07-13 20:24:27.000000000 -0700 > @@ -1824,6 +1824,9 @@ find_src_status (dataflow_set *in, rtx l > src = SET_SRC (XVECEXP (PATTERN (insn), 0, i)); > } > > + if (!src) > + return status; > + > if (REG_P (src)) > decl = var_debug_decl (REG_EXPR (src)); > else if (MEM_P (src)) > @@ -1862,6 +1865,9 @@ find_src_set_src (dataflow_set *set, rtx > src = SET_SRC (XVECEXP (PATTERN (insn), 0, i)); > } > > + if (!src) > + return set_src; > + > if (REG_P (src)) > decl = var_debug_decl (REG_EXPR (src)); > else if (MEM_P (src)) > > passes the stage 1. > It works for me on Linux/ia32, Linux/Intel64 and Linux/ia64.
PS Where is the preprocessed source?
Created attachment 13916 [details] _moddi3 source # ./xgcc -B./ -O -g _moddi3.i -S /net/gnu-13/export/gnu/src/gcc/gcc/libgcc/../gcc/libgcc2.c: In function ‘__modti3’: /net/gnu-13/export/gnu/src/gcc/gcc/libgcc/../gcc/libgcc2.c:1125: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Confirmed.
Carolyn has checked in a patch to var-tracking.c and I can bootstrap IA64 Linux so I am going to close this out as fixed. The patch that fixed this was: 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.