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]

Re: C++ PATCH: 14035


Andreas Schwab wrote:

Mark Mitchell <mark@codesourcery.com> writes:



This patch fixes PR c++/14035. This PR was opened because of a cast
where we generated wrong-code for a C-style cast. In particular, we
generated a copy constructor call instead of a derived-to-base
conversion.



This cause libjava to no longer build on ia64-linux:


../../../libjava/java/lang/natClass.cc: In function `void _Jv_LayoutVTableMethods(java::lang::Class*)':
../../../libjava/java/lang/natClass.cc:1823: error: cast from 'java::lang::Class*' to 'int' loses precision
../../../libjava/java/lang/natClass.cc:1831: error: cast from 'java::lang::Class*' to 'int' loses precision
../../../libjava/java/lang/natClassLoader.cc: In function `void _Jv_PrepareCompiledClass(java::lang::Class*)':
../../../libjava/java/lang/natClassLoader.cc:134: error: cast from 'java::lang::Class*' to 'int' loses precision
../../../libjava/java/lang/natClassLoader.cc:139: error: cast from 'java::lang::Class*' to 'int' loses precision

The casts to int should probably be changed to casts to uaddr. I'm
testing this patch now:


That looks correct to me -- but I'd prefer a Java maintainer review it.

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


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