This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/60664] comparison of constant SPR_POINTER with unsigned_flag is always false
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Oct 2014 13:48:45 +0000
- Subject: [Bug rtl-optimization/60664] comparison of constant SPR_POINTER with unsigned_flag is always false
- Auto-submitted: auto-generated
- References: <bug-60664-4 at http dot gcc dot gnu dot org/bugzilla/>
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.