From cc7f489c20f56793bf363bcaef7fe5f8d1dcbce4 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 9 May 2008 20:04:57 +0000 Subject: [PATCH] re PR tree-optimization/36187 (Partitioning problem with SFTs (again)) 2008-05-09 Richard Guenther PR tree-optimization/36187 * g++.dg/opt/pr36187.C: New testcase. From-SVN: r135126 --- gcc/testsuite/ChangeLog | 7 ++++- gcc/testsuite/g++.dg/opt/pr36187.C | 45 ++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/opt/pr36187.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f6c39eae068..531df9fe646 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,9 @@ -2008-01-08 Jan Sjodin +2008-05-09 Richard Guenther + + PR tree-optimization/36187 + * g++.dg/opt/pr36187.C: New testcase. + +2008-05-08 Jan Sjodin Sebastian Pop * gcc.dg/tree-ssa/data-dep-1.c: New. diff --git a/gcc/testsuite/g++.dg/opt/pr36187.C b/gcc/testsuite/g++.dg/opt/pr36187.C new file mode 100644 index 00000000000..fdb468d5a0a --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr36187.C @@ -0,0 +1,45 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --param max-aliased-vops=20" } */ + +extern "C" void abort (void); +enum SbxDataType { SbxINTEGER, SbxDECIMAL, SbxBYREF = 0x4000 }; +struct SbxValues { + union { + float nSingle; + float* pSingle; + }; + SbxDataType eType; +}; +static bool ImpPutDoubleFoo( SbxValues* p) +{ + bool bRet = false; + SbxValues aTmp; + int count = 0; +start: + switch( p->eType ) { + case SbxINTEGER: + if (count++ > 0) + abort (); + aTmp.pSingle = &p->nSingle; goto direct; + case SbxBYREF | SbxDECIMAL: + bRet = false; + break; + direct: + aTmp.eType = SbxDataType( p->eType | SbxBYREF ); + p = &aTmp; goto start; + case SbxBYREF | SbxINTEGER: + break; + default: + bRet =true; + } + return bRet; +} + +int main( int argc, char** argv ) +{ + SbxValues aTmp; + aTmp.eType = SbxINTEGER; + if ( ImpPutDoubleFoo( &aTmp ) ) + abort (); + return 0; +} -- 2.30.2