From: Dale Johannesen Date: Thu, 19 Sep 2002 18:54:56 +0000 (+0000) Subject: Remove creation of invalid subreg. PR 7705, 7339, 7720. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=307f767b38f6eda4a780e4e215d85db213d93e29;p=gcc.git Remove creation of invalid subreg. PR 7705, 7339, 7720. From-SVN: r57315 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 083c12f32ac..9da276c6810 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2002-09-19 Dale Johannesen + * combine.c (make_extraction): Don't create + invalid subreg. + 2002-09-19 Ulrich Weigand * config/s390/s390.c (addr_generation_dependency_p): Handle SUBREG diff --git a/gcc/combine.c b/gcc/combine.c index e1518817ca6..c72d81e891c 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -6124,6 +6124,11 @@ make_extraction (mode, inner, pos, pos_rtx, len, final_word += (GET_MODE_SIZE (inner_mode) - GET_MODE_SIZE (tmode)) % UNITS_PER_WORD; + /* 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); } else