From patchwork Wed Nov 7 10:53:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFA,middle-end] Fix PR middle-end/49220 From: Kaz Kojima X-Patchwork-Id: 197646 Message-Id: <20121107.195334.420788682.kkojima@rr.iij4u.or.jp> To: ubizjak@gmail.com Cc: gcc-patches@gcc.gnu.org Date: Wed, 07 Nov 2012 19:53:34 +0900 (JST) Uros Bizjak wrote: > Please also add the testcase from the PR to the testsuite. For the record, I've committed the testcase below from the PR. Regards, kaz --- 2012-11-07 Kaz Kojima * gcc.c-torture/compile/pr49220.c: New test. --- ORIG/trunk/gcc/testsuite/gcc.c-torture/compile/pr49220.c 1970-01-01 09:00:00.000000000 +0900 +++ trunk/gcc/testsuite/gcc.c-torture/compile/pr49220.c 2012-11-07 19:29:26.000000000 +0900 @@ -0,0 +1,25 @@ +int array[2]; + +static int +func1 (int b) +{ + return b; +} + +static int +func2 (int a, int b) +{ + return b == 0 ? a : b; +} + +int +func3 (int a) +{ +} + +int * +func4 (int *arg) +{ + *arg = func1 ((func2 (func3 (array[0]), *arg)) | array[0]); + return &array[1]; +}