From ed7dbf5d2b48adf8b83aebbb478e63586afff833 Mon Sep 17 00:00:00 2001 From: pinskia Date: Mon, 2 Jul 2007 19:40:30 +0000 Subject: [PATCH] 2007-07-02 Andrew Pinski * rtlhooks.c (gen_lowpart_if_possible): Check for invalid subreg before calling gen_lowpart_SUBREG. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126230 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/rtlhooks.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d0fc5beb151..2ef7b32dc69 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-07-02 Andrew Pinski + + * rtlhooks.c (gen_lowpart_if_possible): Check for + invalid subreg before calling gen_lowpart_SUBREG. + 2007-07-02 Geoffrey Keating * config/darwin9.h: Add copyright notice. diff --git a/gcc/rtlhooks.c b/gcc/rtlhooks.c index ece7198f9a2..79fcb445309 100644 --- a/gcc/rtlhooks.c +++ b/gcc/rtlhooks.c @@ -161,7 +161,9 @@ gen_lowpart_if_possible (enum machine_mode mode, rtx x) return new; } - else if (mode != GET_MODE (x) && GET_MODE (x) != VOIDmode) + else if (mode != GET_MODE (x) && GET_MODE (x) != VOIDmode + && validate_subreg (mode, GET_MODE (x), x, + subreg_lowpart_offset (mode, GET_MODE (x)))) return gen_lowpart_SUBREG (mode, x); else return 0; -- 2.11.0