This is the mail archive of the gcc@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]

Re: PR 20505


James E Wilson wrote:

The testcase is not portable, as I pointed out in the PR.  Trying this
on an x86_64-linux system, I get 27 "excess errors" failures.  All of
them are
    error: cast from 'int*' to 'int' loses precision
Using long works better than int, but is still not fool proof, as there
are targets where longs are smaller than pointers.  Maybe we can rely on
something like ptrdiff_t?

Here's the testcase I installed. I also put it on mainline, as I couldn't see one that you'd installed.

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2005-04-04  Nathan Sidwell  <nathan@codesourcery.com>

	PR debug/20505
	* g++.dg/debug/const2.C: New.

Index: testsuite/g++.dg/debug/const2.C
===================================================================
RCS file: testsuite/g++.dg/debug/const2.C
diff -N testsuite/g++.dg/debug/const2.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/debug/const2.C	4 Apr 2005 09:29:12 -0000
***************
*** 0 ****
--- 1,15 ----
+ // Copyright (C) 2005 Free Software Foundation, Inc.
+ // Contributed by Nathan Sidwell 1 Apr 2005 <nathan@codesourcery.com>
+ 
+ // { dg-options "-ggdb2" }
+ // Origin: ivan <ivanr@syncad.com>
+ //	   pinskia@gcc.gnu.org
+ // Bug 20505: ICE with -ggdb2
+ 
+ struct b
+ {
+   static const int d;
+   virtual bool IsEmpty() const=0;
+   int e,c;
+ };
+ const int b::d = ((__SIZE_TYPE__)(&((b*)1)->c) - 1);

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