[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#122547: [gcc-3.0] cc1plus segfault in strength reduction



Package: gcc-3.0
Version: 3.0.2ds4-4
Severity: important
Tags: patch

The attached patch fixes a strength reduction ICE seen when compiling
groff on hppa-linux. It was contributed by Alan Modra. I'm still in the
process of verifying this with the gcc hppa maintainer (Dave Anglin) but
wanted to send this to the bts first as a heads up.

randolph
-- 
Debian Developer <tausq@debian.org>
http://www.TauSq.org/


#! /bin/sh -e

# DP: Patch to fix strength-reduction optimization from Alan Modra 

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p1 < $0
        #cd ${dir}gcc && autoconf
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
        #rm ${dir}gcc/configure
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

--- gcc/unroll.c.orig	Wed Dec  5 08:54:17 2001
+++ gcc/unroll.c	Wed Dec  5 08:55:54 2001
@@ -3508,13 +3508,16 @@
 
       do
 	{
-	  if (GET_CODE (temp) == JUMP_INSN
-	      /* Previous unrolling may have generated new insns not covered
-		 by the uid_luid array.  */
-	      && INSN_UID (JUMP_LABEL (temp)) < max_uid_for_loop
+	  if (GET_CODE (temp) != JUMP_INSN)
+              continue;
+	  if (/* It's an addr_diff_vec */
+	      JUMP_LABEL(temp) == 0
+	      || (/* Previous unrolling may have generated new insns not covered
+		     by the uid_luid array.  */
+	      INSN_UID (JUMP_LABEL (temp)) < max_uid_for_loop
 	      /* Check if we jump back into the loop body.  */
 	      && INSN_LUID (JUMP_LABEL (temp)) > INSN_LUID (loop->top)
-	      && INSN_LUID (JUMP_LABEL (temp)) < INSN_LUID (loop->cont))
+	      && INSN_LUID (JUMP_LABEL (temp)) < INSN_LUID (loop->cont)))
 	    {
 	      if (loop_dump_stream)
 		fprintf (loop_dump_stream,



Reply to: