This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix cast1.C and p784.C on LP64 targets


Hello,

Both testcases fail on LP64 targets because of:

/home/eric/cvs/gcc/gcc/testsuite/g++.dg/parse/cast1.C:7: error: cast from 
'char*' to 'int' loses precision

/home/eric/cvs/gcc/gcc/testsuite/g++.old-deja/g++.mike/p784.C:3640: error: 
cast from 'GctSymbolGctSymbolCHNode*' to 'unsigned int' loses precision


p784.C is a big testcase so I don't think it would be reasonable to do some 
surgery to let it pass everywhere.  cast1.C is much smaller, but appears to 
be precisely testing the casting between 'int' and 'char *' so I'm reluctant 
to tweak it.

I suppose we could use the new dg-require-effective-target framework and add a 
new class of targets, "ipxx", where integers and pointers are of the same 
size.  This could be deemed overkill though so I propose to restrict the 
tests to ILP32 targets.  OK for mainline?


2004-11-13 ?Eric Botcazou ?<ebotcazou@libertysurf.fr>

	* g++.dg/parse/cast1.C: Run only on ILP32.
	* g++.old-deja/g++.mike/p784.C: Likewise.


-- 
Eric Botcazou
Index: g++.dg/parse/cast1.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/parse/cast1.C,v
retrieving revision 1.1
diff -u -r1.1 cast1.C
--- g++.dg/parse/cast1.C	4 Jan 2004 22:42:17 -0000	1.1
+++ g++.dg/parse/cast1.C	12 Nov 2004 11:58:37 -0000
@@ -1,4 +1,5 @@
 // PR c++/13536
+// { dg-require-effective-target ilp32 } */
 // { dg-options "-w" }
 
 #include <typeinfo>
Index: g++.old-deja/g++.mike/p784.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.mike/p784.C,v
retrieving revision 1.10
diff -u -r1.10 p784.C
--- g++.old-deja/g++.mike/p784.C	1 May 2003 02:02:46 -0000	1.10
+++ g++.old-deja/g++.mike/p784.C	12 Nov 2004 11:58:37 -0000
@@ -1,4 +1,5 @@
 // { dg-do assemble  }
+// { dg-require-effective-target ilp32 } */
 // { dg-options "-w" }
 // prms-id: 784
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]