On Sun, 22 May 2022 05:00:21 GMT, Kim Barrett <kbarr...@openjdk.org> wrote:

>> I guess GCC cannot understand `assert(dest != NULL` immediately preceding it.
>> 
>> 
>> In file included from 
>> /home/ysuenaga/github-forked/jdk/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.inline.hpp:33,
>>                  from 
>> /home/ysuenaga/github-forked/jdk/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp:30,
>>                  from 
>> /home/ysuenaga/github-forked/jdk/src/hotspot/share/jfr/support/jfrJdkJfrEvent.cpp:30:
>> In function 'void set_form(jbyte, jbyte*) [with jbyte (* op)(jbyte, jbyte) = 
>> traceid_or]',
>>     inlined from 'void set(jbyte, jbyte*)' at 
>> /home/ysuenaga/github-forked/jdk/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp:129:23,
>>     inlined from 'static void JfrTraceIdBits::store(jbyte, const T*) [with T 
>> = Klass]' at 
>> /home/ysuenaga/github-forked/jdk/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp:135:6,
>>     inlined from 'static void JfrTraceId::tag_as_jdk_jfr_event(const 
>> Klass*)' at 
>> /home/ysuenaga/github-forked/jdk/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp:106:3,
>>     inlined from 'static void JdkJfrEvent::tag_as(const Klass*)' at 
>> /home/ysuenaga/github-forked/jdk/src/hotspot/share/jfr/support/jfrJdkJfrEvent.cpp:176:35:
>
> I don't think this warning has anything to do with that NULL check. But I'm
> still not understanding what it is warning about. The "region of size 0" part
> of the warning message seems important, but I'm not (yet?) seeing how it could
> be coming up with that.  The code involved here is pretty contorted...

It might be GCC bug...

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578

This issue is for integer literal, but [Comment 
29](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c29) mentions address 
calculation (e.g. `NULL + offset`) - it is similar the problem in 
jfrTraceIdBits.inline.hp because `dest` comes from `low_addr()` (`addr + 
low_offset`).

-------------

PR: https://git.openjdk.java.net/jdk/pull/8646

Reply via email to