http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49781

--- Comment #10 from Uros Bizjak <ubizjak at gmail dot com> 2011-08-03 15:01:10 
UTC ---
(In reply to comment #9)
> (In reply to comment #8)
> 
> > > Created attachment 24899 [details]
> > > Proposed patch that exploits addr32.
> > > 
> > > H.J., can you please test this patch on mx32.
> > > 
> > > The patch bootstraps and regression tests OK on x86_64-pc-linux-gnu 
> > > {,-m32}.
> > 
> > It failed the testcase for PR 47744, which I just checked in:
> > 
> > [hjl@gnu-33 ilp32-24]$
> > /export/build/gnu/gcc-x32-test/build-x86_64-linux/gcc/xgcc
> > -B/export/build/gnu/gcc-x32-test/build-x86_64-linux/gcc/ -S -o x.s -mx32 -O3
> > -std=gnu99
> > /export/gnu/import/git/gcc-x32/gcc/testsuite/gcc.dg/torture/pr47744-2.c
> > /export/gnu/import/git/gcc-x32/gcc/testsuite/gcc.dg/torture/pr47744-2.c: In
> > function \u2018matmul_i16\u2019:
> > /export/gnu/import/git/gcc-x32/gcc/testsuite/gcc.dg/torture/pr47744-2.c:40:1:
> > error: insn does not satisfy its constraints:
> > (insn 146 66 67 4 (set (reg:TI 0 ax)
> >         (mem:TI (zero_extend:DI (plus:SI (reg:SI 4 si [orig:119 ivtmp.30 ]
> > [119])
> >                     (reg:SI 5 di [orig:102 dest_y ] [102]))) [6 MEM[base:
> > dest_y_18, index: ivtmp.30_63, offset: 0B]+0 S16 A128]))
> > /export/gnu/import/git/gcc-x32/gcc/testsuite/gcc.dg/torture/pr47744-2.c:34 
> > 60
> > {*movti_internal_rex64}
> >      (nil))
> > /export/gnu/import/git/gcc-x32/gcc/testsuite/gcc.dg/torture/pr47744-2.c:40:1:
> > internal compiler error: in reload_cse_simplify_operands, at 
> > postreload.c:403
> > Please submit a full bug report,
> > with preprocessed source if appropriate.
> > See <http://gcc.gnu.org/bugs.html> for instructions.
> > [hjl@gnu-33 ilp32-24]$
> 
> Hm, offsetable operand ...

This additional patch prevents zero_extend when we deal with
wider-than-word-size moves.  These moves need offsetable_operand, which
zero_extend (...) isn't.

Index: i386.c
===================================================================
--- i386.c    (revision 177281)
+++ i386.c    (working copy)
@@ -11681,6 +11689,10 @@ ix86_legitimate_address_p (enum machine_
   rtx base, index, disp;
   HOST_WIDE_INT scale;

+  if (GET_CODE (addr) == ZERO_EXTEND
+      && GET_MODE_SIZE (mode) > UNITS_PER_WORD)
+      return false;
+
   if (ix86_decompose_address (addr, &parts) <= 0)
     /* Decomposition failed.  */
     return false;

Reply via email to