http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54157
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2012-08-01 22:12:00 UTC --- This patch: diff --git a/gcc/expmed.c b/gcc/expmed.c index 1fe0034..2780164 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -380,7 +380,7 @@ mode_for_extraction (enum extraction_pattern pattern, int opno) /* Everyone who uses this function used to follow it with if (result == VOIDmode) result = word_mode; */ if (data->operand[opno].mode == VOIDmode) - return word_mode; + return ptr_mode; return data->operand[opno].mode; } also works on the testcase.