-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8329826: GCC 12 reports some compiler error when building jdk8 #479
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2552,13 +2552,18 @@ TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int o | |
} else if (klass() == ciEnv::current()->Class_klass() && | ||
_offset >= InstanceMirrorKlass::offset_of_static_fields()) { | ||
// Static fields | ||
assert(o != NULL, "must be constant"); | ||
ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass(); | ||
ciField* field = k->get_field_by_offset(_offset, true); | ||
assert(field != NULL, "missing field"); | ||
BasicType basic_elem_type = field->layout_type(); | ||
_is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT || | ||
basic_elem_type == T_ARRAY); | ||
ciField* field = NULL; | ||
if (o != NULL) { | ||
ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass(); | ||
field = k->get_field_by_offset(_offset, true); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is useless papering over, not a fix, and not even good because it makes the code less legible at no gain. Better to convert the two There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (disclaimer: I am not a reviewer)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, don’t I’ve not looked at the callers, but returning an error or throwing an exception if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good suggestion, I will try to fix it, refer to https://github.com/openjdk/jdk/blob/ad78b7fa67ba30cab2e8f496e4c765be15deeca6/src/hotspot/share/opto/type.cpp#L3560C3-L3572 thanks. |
||
if (field != NULL) { | ||
BasicType basic_elem_type = field->layout_type(); | ||
_is_ptr_to_narrowoop = UseCompressedOops && is_reference_type(basic_elem_type); | ||
} else { | ||
// unsafe access | ||
_is_ptr_to_narrowoop = UseCompressedOops; | ||
} | ||
} else { | ||
// Instance fields which contains a compressed oop references. | ||
field = ik->get_field_by_offset(_offset, false); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that’s probably okay to ignore