https://sourceware.org/bugzilla/show_bug.cgi?id=21934

--- Comment #15 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Brett Neumeier from comment #14)
> (In reply to H.J. Lu from comment #13)
> > There is cast to (unsigned char).  Why does GCC see that?  Why does
> > it only happen on arm? Also does 'hh" work with all compilers on all
> > supported hosts?
> 
> Per Martin Sebor's comment, the possible-truncation warning "tends to be
> sensitive to char (and short) conversions because of limitations in its
> integration with the Value Range Propagation pass." I am not sure precisely
> what that means, but I presume that's why the cast is not sufficient to
> suppress the false positive warning.

This is just a speculation.  There could be a real bug in GCC. Please open
a new GCC bug since your old one is lost during bugzilla server crash.

> I don't know what circumstances trigger this false positive. I stumbled upon
> it in an arm-to-x86_64 cross-binutils build, but I expect that there are
> other scenarios where it can occur -- possibly some native builds do, and
> possibly other cross-builds do. I don't have the time or energy to do
> exhaustive tests to see which combinations trigger the issue.

Please follow:

https://gcc.gnu.org/wiki/A_guide_to_testcase_reduction

to reduce your testcase.

> I don't know everything that is included in the "all compilers and all
> supported hosts" set. I do see that the "hh" flag is mandated by C99, but
> not by C89.
> 
> Are there C89 compilers that binutils needs to support? If so, would a
> preprocessor test that adds the "hh" flag only in C99 and later make this
> patch acceptable?

Yes, we support C89.  I still like to understand what the problem is
before deciding what to do since it is possible that "hh" may not
workaround the issue tomorrow.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to