https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60664
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|diagnostic | Component|c++ |rtl-optimization Summary|bool / out of range int |comparison of constant |comparison warning failure |SPR_POINTER with | |unsigned_flag is always | |false --- Comment #8 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to David Binderman from comment #7) > > #define SUBREG_CHECK_PROMOTED_SIGN(RTX, SIGN) \ > ((SIGN) == SRP_POINTER ? SUBREG_PROMOTED_GET (RTX) == SRP_POINTER \ > : (SIGN) == SRP_SIGNED ? SUBREG_PROMOTED_SIGNED_P (RTX) \ > : SUBREG_PROMOTED_UNSIGNED_P (RTX)) > > Leaving aside the side issue of ? : being right associative, > so some () would help clarify, I notice that > > const int SRP_POINTER = -1; > const int SRP_SIGNED = 0; > const int SRP_UNSIGNED = 1; > const int SRP_SIGNED_AND_UNSIGNED = 2; > > so it looks as if this bitfield > > unsigned unsigned_flag : 1; > > is being compared to SRP_POINTER. One possible fix might be to change > the value of SRP_POINTER to 3 and see if the problem goes away. > > Clang certainly seems to be finding a problem, AFAIK. It seems to me that independently of the value of SRP_POINTER, the result will be always false. Thus, I don't see the bug. In any case, someone else would need to decide whether this is actually a bug or not. RTL is not my expertise.