* Fix PR35264, ntfs-3g miscompilation on i386
@ 2008-02-20 16:43 Michael Matz
0 siblings, 0 replies; only message in thread
From: Michael Matz @ 2008-02-20 16:43 UTC (permalink / raw)
To: gcc-patches
Hi,
Due to missing breaks in a switch statement in ix86_expand_branch, the
testcase below (reduced from ntfs-3g) aborts. Fixed in the obvious way.
I'm currently regstrapping this. Richi already pre-approved this for the
4.3 branch, so I'm going to check this in there when regstrapping
succeeded.
Ciao,
Michael.
--
PR target/35264
* config/i386/i386.c (ix86_expand_branch): Add missing breaks.
* gcc.dg/pr35264.c: New testcase.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 132470)
+++ config/i386/i386.c (working copy)
@@ -12148,6 +12152,7 @@ ix86_expand_branch (enum rtx_code code,
ix86_expand_branch (code, label);
return;
}
+ break;
case LE: case LEU: case GT: case GTU:
if (lo[1] == constm1_rtx)
{
@@ -12156,6 +12161,7 @@ ix86_expand_branch (enum rtx_code code,
ix86_expand_branch (code, label);
return;
}
+ break;
default:
break;
}
Index: testsuite/gcc.dg/pr35264.c
===================================================================
--- testsuite/gcc.dg/pr35264.c (revision 0)
+++ testsuite/gcc.dg/pr35264.c (revision 0)
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+extern void abort(void);
+long long __attribute__((noinline)) get(void)
+{
+ return -2;
+}
+long long __attribute__((noinline)) get(void);
+int __attribute__((noinline)) check(void)
+{
+ long long lcn;
+
+ lcn = get();
+ if (lcn >= 0 || lcn == -1)
+ return 0;
+
+ return -1;
+}
+int main()
+{
+ if (check() == 0)
+ abort();
+ return 0;
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-20 16:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-20 16:43 Fix PR35264, ntfs-3g miscompilation on i386 Michael Matz
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).