This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch to i386.c



The most recent CVS sources don't bootstrap on i386.  In particular, I
get an abort here:

    int
    reg_mentioned_in_mem (reg, rtl)
	 rtx reg, rtl;
    {
      ...
      switch (code)
	{
	case HIGH:
	case CONST_INT:
	case CONST:
	case CONST_DOUBLE:
	case SYMBOL_REF:
	case LABEL_REF:
	case PC:
	case CC0:
	case SUBREG:
	  return 0;
	default:
	  abort ();
	}

I suspect this well-intentioned patch:

  Wed Feb 11 01:30:49 1998  Marc Lehmann <pcg@goof.com>

        * i386.c: Added include for recog.h.
        (override_options): Removed unused variable p. Initialized regno to
        avoid warning.
        (order_regs_for_local_alloc): Initialized regno to avoid warning.
        (legitimize_address): Likewise for 'other'.
        (i386_aligned_reg_p): Added default case with abort ().
        (print_operand): Likewise.
        (reg_mentioned_in_mem): Likewise.

Here's a fix:

1998-02-11  Mark Mitchell  <mmitchell@usa.net>

	* config/i386/i386.c (reg_mentioned_in_mem): Don't abort when
	falling through default case in switch.
	(i386_aligned_p): Likewise.

Index: i386.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.11
diff -c -p -r1.11 i386.c
*** i386.c	1998/02/11 00:29:57	1.11
--- i386.c	1998/02/11 19:43:09
*************** i386_aligned_p (op)
*** 495,501 ****
        return i386_aligned_reg_p (REGNO (op));
      
      default:
!       abort ();
      }
  
    return 0;
--- 495,501 ----
        return i386_aligned_reg_p (REGNO (op));
      
      default:
!       break;
      }
  
    return 0;
*************** reg_mentioned_in_mem (reg, rtl)
*** 4828,4834 ****
      case SUBREG:
        return 0;
      default:
!       abort ();
      }
  
    if (code == MEM && reg_mentioned_p (reg, rtl))
--- 4828,4834 ----
      case SUBREG:
        return 0;
      default:
!       break;
      }
  
    if (code == MEM && reg_mentioned_p (reg, rtl))

-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]