Patchwork [testsuite] : Fix testcase that bangs long and int against void*

login
register
mail settings
Submitter Georg-Johann Lay
Date Jan. 27, 2012, 6:12 p.m.
Message ID <4F22E8FF.106@gjlay.de>
Download mbox | patch
Permalink /patch/138263/
State New
Headers show

Comments

Georg-Johann Lay - Jan. 27, 2012, 6:12 p.m.
Jakub Jelinek wrote:
> On Fri, Jan 13, 2012 at 07:40:59PM +0100, Georg-Johann Lay wrote:
>> The ilp32 is the closes match:
>>
>> The source casts pointer to int, int to pointer, long to int, uses 32-bit
>> initializers for int, assumes size_t is unsigned long any maybe others.
> 
> No.  The source is just fine for any target where sizeof (long) == sizeof (void *).
> So both ilp32 and lp64.

Now just factored out avr. There is no dg-requite to filter out long!=void*, or
did I miss something?

Ok to apply?

Johann

	* gcc.dg/lto/20091013-1_1.c: xfail for avr.
	* gcc.dg/lto/20091013-1_2.c: xfail for avr.
Georg-Johann Lay - Feb. 1, 2012, 1 p.m.
http://gcc.gnu.org/ml/gcc-patches/2012-01/msg01502.html

Georg-Johann Lay wrote:

> Jakub Jelinek wrote:
>> On Fri, Jan 13, 2012 at 07:40:59PM +0100, Georg-Johann Lay wrote:
>>> The ilp32 is the closes match:
>>>
>>> The source casts pointer to int, int to pointer, long to int, uses 32-bit
>>> initializers for int, assumes size_t is unsigned long any maybe others.
>> No.  The source is just fine for any target where sizeof (long) == sizeof (void *).
>> So both ilp32 and lp64.
> 
> Now just factored out avr. There is no dg-requite to filter out long!=void*, or
> did I miss something?
> 
> Ok to apply?
> 
> Johann
> 
> 	* gcc.dg/lto/20091013-1_1.c: xfail for avr.
> 	* gcc.dg/lto/20091013-1_2.c: xfail for avr.
> 
> 
> 
> Index: gcc.dg/lto/20091013-1_1.c
> ===================================================================
> --- gcc.dg/lto/20091013-1_1.c   (revision 183472)
> +++ gcc.dg/lto/20091013-1_1.c   (working copy)
> @@ -1,3 +1,4 @@
> +/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" } { "*" } {
> "" } } */
>  typedef struct HDC__ { int unused; } *HDC;
>  typedef struct HFONT__ { int unused; } *HFONT;
> 
> Index: gcc.dg/lto/20091013-1_2.c
> ===================================================================
> --- gcc.dg/lto/20091013-1_2.c   (revision 183472)
> +++ gcc.dg/lto/20091013-1_2.c   (working copy)
> @@ -1,3 +1,4 @@
> +/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" } { "*" } {
> "" } } */
>  typedef struct HDC__ { int unused; } *HDC;
>  typedef struct HFONT__ { int unused; } *HFONT;
> 
>
Jakub Jelinek - Feb. 1, 2012, 1:15 p.m.
On Wed, Feb 01, 2012 at 02:00:53PM +0100, Georg-Johann Lay wrote:
> > 	* gcc.dg/lto/20091013-1_1.c: xfail for avr.
> > 	* gcc.dg/lto/20091013-1_2.c: xfail for avr.

If it is just because of the warnings, can't you
add
-Wno-int-to-pointer-cast -Wno-pointer-to-int-cast
to dg-options?  Also, not sure how effective is dg-xfail-if in the secondary
source files, the *_0.c is where all the dg directives are for it.

	Jakub
Georg-Johann Lay - Feb. 1, 2012, 2:21 p.m.
Jakub Jelinek wrote:
> On Wed, Feb 01, 2012 at 02:00:53PM +0100, Georg-Johann Lay wrote:
>>> 	* gcc.dg/lto/20091013-1_1.c: xfail for avr.
>>> 	* gcc.dg/lto/20091013-1_2.c: xfail for avr.
> 
> If it is just because of the warnings, can't you
> add
> -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast
> to dg-options?

dg-additional-options triggers
WARNING: lto.exp does not support dg-additional-options

> Also, not sure how effective is dg-xfail-if in the secondary
> source files, the *_0.c is where all the dg directives are for it.

The FAILs return if dg-xfail-if is removed from 1.c/2.c and added to 0.c

dg-xfail-if only works if added in each and every individual source that
triggers a warning.

Johann
Georg-Johann Lay - Feb. 15, 2012, 2:51 p.m.
Georg-Johann Lay wrote:
> Jakub Jelinek wrote:
>> On Wed, Feb 01, 2012 at 02:00:53PM +0100, Georg-Johann Lay wrote:
>>>> 	* gcc.dg/lto/20091013-1_1.c: xfail for avr.
>>>> 	* gcc.dg/lto/20091013-1_2.c: xfail for avr.
>> If it is just because of the warnings, can't you
>> add
>> -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast
>> to dg-options?
> 
> dg-additional-options triggers
> WARNING: lto.exp does not support dg-additional-options
> 
>> Also, not sure how effective is dg-xfail-if in the secondary
>> source files, the *_0.c is where all the dg directives are for it.
> 
> The FAILs return if dg-xfail-if is removed from 1.c/2.c and added to 0.c
> 
> dg-xfail-if only works if added in each and every individual source that
> triggers a warning.

I went ahead and installed the patch. It only disables for avr to avoid
disturbing other targets:

http://gcc.gnu.org/viewcvs?view=revision&revision=184276

Johann

Patch

Index: gcc.dg/lto/20091013-1_1.c
===================================================================
--- gcc.dg/lto/20091013-1_1.c   (revision 183472)
+++ gcc.dg/lto/20091013-1_1.c   (working copy)
@@ -1,3 +1,4 @@ 
+/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" } { "*" } {
"" } } */
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;

Index: gcc.dg/lto/20091013-1_2.c
===================================================================
--- gcc.dg/lto/20091013-1_2.c   (revision 183472)
+++ gcc.dg/lto/20091013-1_2.c   (working copy)
@@ -1,3 +1,4 @@ 
+/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" } { "*" } {
"" } } */
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;