* [google]: add a wrong dce regression test case
@ 2011-04-30 2:42 Xinliang David Li
2011-04-30 17:07 ` Diego Novillo
0 siblings, 1 reply; 2+ messages in thread
From: Xinliang David Li @ 2011-04-30 2:42 UTC (permalink / raw)
To: GCC Patches; +Cc: Diego Novillo
[-- Attachment #1: Type: text/plain, Size: 204 bytes --]
The following test makes sure compiler does not wrongly eliminate
store to ireg.ax.
Ok for trunk?
David
2011-04-29 Xinliang David Li <davidxl@google.com>
* gcc.dg/tree-ssa/alias_bug.c: New test.
[-- Attachment #2: aliasb.p --]
[-- Type: text/x-pascal, Size: 1513 bytes --]
Index: testsuite/gcc.dg/tree-ssa/alias_bug.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/alias_bug.c (revision 0)
+++ testsuite/gcc.dg/tree-ssa/alias_bug.c (revision 0)
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -fdump-tree-optimized" } */
+
+typedef unsigned u32;
+typedef unsigned short u16;
+typedef unsigned char u8;
+struct biosregs {
+ union {
+ struct {
+ u32 edi;
+ u32 esi;
+ u32 ebp;
+ u32 _esp;
+ u32 ebx;
+ u32 edx;
+ u32 ecx;
+ u32 eax;
+ u32 _fsgs;
+ u32 _dses;
+ u32 eflags;
+ };
+ struct {
+ u16 di, hdi;
+ u16 si, hsi;
+ u16 bp, hbp;
+ u16 _sp, _hsp;
+ u16 bx, hbx;
+ u16 dx, hdx;
+ u16 cx, hcx;
+ u16 ax, hax;
+ u16 gs, fs;
+ u16 es, ds;
+ u16 flags, hflags;
+ };
+ struct {
+ u8 dil, dih, edi2, edi3;
+ u8 sil, sih, esi2, esi3;
+ u8 bpl, bph, ebp2, ebp3;
+ u8 _spl, _sph, _esp2, _esp3;
+ u8 bl, bh, ebx2, ebx3;
+ u8 dl, dh, edx2, edx3;
+ u8 cl, ch, ecx2, ecx3;
+ u8 al, ah, eax2, eax3;
+ };
+ };
+};
+void initregs(struct biosregs *regs);
+void intcall(u8 int_no, const struct biosregs *ireg, struct biosregs *oreg);
+static u32 *const gp = (u32*) 0x32;
+void keyboard_set_repeat(void)
+{
+ struct biosregs ireg;
+ *gp = 10;
+ initregs(&ireg);
+ ireg.ax = 0x0305;
+ intcall(0x16, &ireg, ((void *)0));
+}
+
+/* { dg-final { scan-tree-dump-times "ireg.*ax" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [google]: add a wrong dce regression test case
2011-04-30 2:42 [google]: add a wrong dce regression test case Xinliang David Li
@ 2011-04-30 17:07 ` Diego Novillo
0 siblings, 0 replies; 2+ messages in thread
From: Diego Novillo @ 2011-04-30 17:07 UTC (permalink / raw)
To: Xinliang David Li; +Cc: GCC Patches
On Fri, Apr 29, 2011 at 19:59, Xinliang David Li <davidxl@google.com> wrote:
> 2011-04-29 Xinliang David Li <davidxl@google.com>
>
> * gcc.dg/tree-ssa/alias_bug.c: New test.
OK if the test works.
Diego.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-30 16:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-30 2:42 [google]: add a wrong dce regression test case Xinliang David Li
2011-04-30 17:07 ` Diego Novillo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).