johannes    02/09/17 15:14:05

  Modified:    gcc/config/rs6000 rs6000.c
  Log:
  fix bug where easy_vector_const was trying to take get_attr_type of
  a jump table, which doesn't have a type.  3030948.
  
  Revision  Changes    Path
  1.173     +12 -1     gcc3/gcc/config/rs6000/rs6000.c
  
  Index: rs6000.c
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/gcc/config/rs6000/rs6000.c,v
  retrieving revision 1.172
  retrieving revision 1.173
  diff -u -r1.172 -r1.173
  --- rs6000.c  2002/09/10 20:53:44     1.172
  +++ rs6000.c  2002/09/17 22:13:58     1.173
  @@ -1772,9 +1772,15 @@
   {
     /* Remember our last choice.  */
     static enum attr_type last_easy = TYPE_INTEGER;
  +  enum attr_type type;
     /* First look at the previous instruction.  */
     rtx prev = prev_active_insn (insn);
  -  enum attr_type type = prev ? get_attr_type (prev) : TYPE_INTEGER;
  +  /* Jump tables don't have a type; prevent get_attr_type from crashing.  */
  +  if (prev && GET_CODE (prev) == JUMP_INSN &&
  +     (GET_CODE (PATTERN (prev)) == ADDR_VEC 
  +       || GET_CODE (PATTERN (prev)) == ADDR_DIFF_VEC))
  +    prev = 0;
  +  type = prev ? get_attr_type (prev) : TYPE_INTEGER;
   
     /* If the previous instruction was VEC_EASY,
        its chosen type is in last_easy.  */
  @@ -1790,6 +1796,11 @@
       {
         /* Look at the next instruction to decide.  */
         rtx next = next_active_insn (insn);
  +      /* Jump tables don't have a type; prevent get_attr_type from crashing.  */
  +      if (next && GET_CODE (next) == JUMP_INSN
  +        && (GET_CODE (PATTERN (next)) == ADDR_VEC 
  +            || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
  +     next = 0;
         type = next ? get_attr_type (next) : TYPE_INTEGER;
         /* Prefer VEC_PERM unless the next instruction conflicts.  */
         last_easy = (type == TYPE_VEC_PERM ? TYPE_VEC_SIMPLE : TYPE_VEC_PERM);
  
  
  


Reply via email to