diff mbox

[PR70920] transform (intptr_t) x eq/ne CST to x eq/ne (typeof x) cst

Message ID CAAgBjMnVjojDJbfbq+qgc7N9ifzohhgrq5NkCKLg=Qkqms6TDw@mail.gmail.com
State Superseded
Headers show

Commit Message

Prathamesh Kulkarni Aug. 3, 2016, 10:17 p.m. UTC
On 3 August 2016 at 17:27, Matthew Wahab <matthew.wahab@foss.arm.com> wrote:
> On 29/07/16 15:32, Prathamesh Kulkarni wrote:

>>

>> On 29 July 2016 at 12:42, Richard Biener <rguenther@suse.de> wrote:

>>>

>>> On Fri, 29 Jul 2016, Prathamesh Kulkarni wrote:

>>>

>>>> On 28 July 2016 at 19:18, Richard Biener <rguenther@suse.de> wrote:

>>>>>

>>>>> On Thu, 28 Jul 2016, Prathamesh Kulkarni wrote:

>>>>>

>>>>>> On 28 July 2016 at 15:58, Andreas Schwab <schwab@suse.de> wrote:

>>>>>>>

>>>>>>> On Mo, Jul 25 2016, Prathamesh Kulkarni

>>>>>>> <prathamesh.kulkarni@linaro.org> wrote:

>>>>>>>

>>>>>>>> diff --git a/gcc/testsuite/gcc.dg/pr70920-4.c

>>>>>>>> b/gcc/testsuite/gcc.dg/pr70920-4.c

>>>>>>>> new file mode 100644

>>>>>>>> index 0000000..dedb895

>>>>>>>> --- /dev/null

>>>>>>>> +++ b/gcc/testsuite/gcc.dg/pr70920-4.c

>>>>>>>> @@ -0,0 +1,21 @@

>>>>>>>> +/* { dg-do compile } */

>>>>>>>> +/* { dg-options "-O2 -fdump-tree-ccp-details

>>>>>>>> -Wno-int-to-pointer-cast" } */

>>>>>>>> +

>>>>>>>> +#include <stdint.h>

>>>>>>>> +

>>>>>>>> +void f1();

>>>>>>>> +void f2();

>>>>>>>> +

>>>>>>>> +void

>>>>>>>> +foo (int a)

>>>>>>>> +{

>>>>>>>> +  void *cst = 0;

>>>>>>>> +  if ((int *) a == cst)

>>>>>>>> +    {

>>>>>>>> +      f1 ();

>>>>>>>> +      if (a)

>>>>>>>> +     f2 ();

>>>>>>>> +    }

>>>>>>>> +}

>>>>>>>> +

>>>>>>>> +/* { dg-final { scan-tree-dump "gimple_simplified to if

>>>>>>>> \\(_\[0-9\]* == 0\\)" "ccp1" } } */

>>>>>>>

>>>>>>>

>>>>>>> This fails on all ilp32 platforms.

>

> [..]

>>>

>>>

>>> I don't think just matching == 0 is a good idea.  I suggest to

>>> restrict the testcase to lp64 targets and maybe add a ilp32 variant.

>>

>> Hi,

>> I restricted the test-case to lp64 targets.

>> Is this OK to commit ?

>

>

> Hello,

>

> The test case is failing for arm-none-linux-gnueabihf.

Oops, sorry about that.
>

> It is correctly skipped if the 'dg-require-effective-target lp64' you added

> is moved to the end of the directives (after the dg-options).

Indeed, it is skipped after moving to end.
Is it OK to commit the attached patch ?

Thanks,
Prathamesh
>

> Matthew

>
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/pr70920-4.c b/gcc/testsuite/gcc.dg/pr70920-4.c
index ab2748b..c83ebf9 100644
--- a/gcc/testsuite/gcc.dg/pr70920-4.c
+++ b/gcc/testsuite/gcc.dg/pr70920-4.c
@@ -1,6 +1,6 @@ 
-/* { dg-require-effective-target lp64 } */
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-forwprop-details -Wno-int-to-pointer-cast" } */
+/* { dg-require-effective-target lp64 } */
 
 #include <stdint.h>