On Sep 23, 2005, at 12:41 PM, Richard Henderson wrote:

On Thu, Sep 22, 2005 at 01:21:06PM -0700, Fariborz Jahanian wrote:

                  /* Avoid creating invalid subregs, for example when
                     simplifying (x>>32)&255.  */
!                 if (final_word >= GET_MODE_SIZE (inner_mode)
!                     || (final_word % GET_MODE_SIZE (tmode)) != 0)
                    return NULL_RTX;


I think you should just call validate_subreg.  Ok with that change.

This is the patch I am checking in.

- fariborz ([EMAIL PROTECTED])

ChangeLog:

2005-09-26    Fariborz Jahanian <[EMAIL PROTECTED]>

        * combine.c (make_extraction): Check for valid use of subreg.

Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.503
diff -c -p -r1.503 combine.c
*** combine.c   26 Aug 2005 21:52:23 -0000      1.503
--- combine.c   26 Sep 2005 16:01:23 -0000
*************** make_extraction (enum machine_mode mode,
*** 6314,6320 ****
  
                  /* Avoid creating invalid subregs, for example when
                     simplifying (x>>32)&255.  */
!                 if (final_word >= GET_MODE_SIZE (inner_mode))
                    return NULL_RTX;
  
                  new = gen_rtx_SUBREG (tmode, inner, final_word);
--- 6314,6320 ----
  
                  /* Avoid creating invalid subregs, for example when
                     simplifying (x>>32)&255.  */
!                 if (!validate_subreg (tmode, inner_mode, inner, final_word))
                    return NULL_RTX;
  
                  new = gen_rtx_SUBREG (tmode, inner, final_word);




r~


Reply via email to