[PATCH, i386]: Fix PR target/43766, x86 prefetch doesn't use complex memory addressing
H.J. Lu
hjl.tools@gmail.com
Sun Apr 25 17:58:00 GMT 2010
On Mon, Apr 19, 2010 at 5:32 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> As described in the PR, we fail to parse addresses in the form of:
>
> (prefetch (plus:DI (ashift:DI (reg:DI 60 [ i ])
> (const_int 2 [0x2]))
> (reg/v/f:DI 58 [ a ]))
> (const_int 0 [0x0])
> (const_int 3 [0x3]))
>
> Attached patch introduces handling of ASHIFT addends into x86_decompose_address.
>
> 2010-04-19 Uros Bizjak <ubizjak@gmail.com>
>
> PR target/43766
> * config/i386/i386.c (ix86_decompose_address): Handle ASHIFT addends.
>
> testsuite/ChangeLog:
>
> 2010-04-19 Uros Bizjak <ubizjak@gmail.com>
>
> PR target/43766
> * gcc.target/i386/pr43766.c: New test.
>
> Patch was tested on x86_64-pc-linux-gnu {,-m32}. Patch was committed
> to mainline.
>
> Uros.
>
The new test failed with
pushl %ebp
prefetcht0 (%eax,%edx,4)
movl %esp, %ebp
leave
ret
since it scans "lea". I checked this patch as an obvious fix,
--
H.J.
---
Index: gcc.target/i386/pr43766.c
===================================================================
--- gcc.target/i386/pr43766.c (revision 158705)
+++ gcc.target/i386/pr43766.c (working copy)
@@ -7,4 +7,4 @@ void p (int *a, int i)
__builtin_prefetch (&a[i]);
}
-/* { dg-final { scan-assembler-not "lea" } } */
+/* { dg-final { scan-assembler-not "lea\[ \t\]" } } */
Index: ChangeLog
===================================================================
--- ChangeLog (revision 158705)
+++ ChangeLog (working copy)
@@ -1,3 +1,7 @@
+2010-04-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/pr43766.c: Scan "lea\[ \t\]" instead of "lea".
+
2010-04-25 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/pack15.ad[sb]: New test.
More information about the Gcc-patches
mailing list