tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Bad g++ constructors on aarch64



Martin Husemann <martin%duskware.de@localhost> wrote:
>On Sat, Jul 27, 2019 at 01:22:06PM +0100, Robert Swindells wrote:
>> Klass::Klass() : _foo(foo), _bar(bar)
>> {}
>> 
>> Where _foo & _bar are member variables, foo & bar are globals.
>
>This is an initializer list.
>
>> Member variables that are immediate types get initialized correctly,
>> ones that are pointers to other class instances don't.
>
>Not sure what an "immediate type" is, can you give example code that does
>not work?

I meant that initializing "int" member variables seems to work.

There are multiple places in the openjdk8 source tree that seem to
trigger this, I'm just working through finding the next place that
causes a JVM core dump then trying to fix it.

An aarch64 build of the lang/openjdk8 package from CVS won't display
this problem as it just uses the zero VM without a JIT. I'm trying to
merge in the aarch64 hotspot code.

One specific example is below. The 'swallowed' symbol is in a different
object file which could make a difference.

$NetBSD$

--- hotspot/src/share/vm/opto/matcher.cpp.orig  2019-02-19 13:34:24.000000000 +0000
+++ hotspot/src/share/vm/opto/matcher.cpp
@@ -44,6 +44,8 @@
 # include "adfiles/ad_x86_32.hpp"
 #elif defined TARGET_ARCH_MODEL_x86_64
 # include "adfiles/ad_x86_64.hpp"
+#elif defined TARGET_ARCH_MODEL_aarch64
+# include "adfiles/ad_aarch64.hpp"
 #elif defined TARGET_ARCH_MODEL_sparc
 # include "adfiles/ad_sparc.hpp"
 #elif defined TARGET_ARCH_MODEL_zero
@@ -70,7 +72,6 @@ Matcher::Matcher()
 #endif
   _shared_nodes(C->comp_arena()),
   _reduceOp(reduceOp), _leftOp(leftOp), _rightOp(rightOp),
-  _swallowed(swallowed),
   _begin_inst_chain_rule(_BEGIN_INST_CHAIN_RULE),
   _end_inst_chain_rule(_END_INST_CHAIN_RULE),
   _must_clone(must_clone),
@@ -85,6 +86,8 @@ Matcher::Matcher()
   _dontcare(&_states_arena) {
   C->set_matcher(this);
 
+  _swallowed = swallowed;
+
   idealreg2spillmask  [Op_RegI] = NULL;
   idealreg2spillmask  [Op_RegN] = NULL;
   idealreg2spillmask  [Op_RegL] = NULL;



Home | Main Index | Thread Index | Old Index