This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fwd: [PATCH, libgcc]: Avoid "left shift count >= width of type" warnings in soft-fp code
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 26 Nov 2013 16:05:47 +0000
- Subject: Re: Fwd: [PATCH, libgcc]: Avoid "left shift count >= width of type" warnings in soft-fp code
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4YiQazDguEkrpV4JvX9KKJ_MZpvX-TLv0wxEQg-hTNqSg at mail dot gmail dot com> <CAFULd4Y3dw8J76sd=duyDOwW3_VyS2BBUDRthF0=oFtXUmn5zg at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1311252330010 dot 19872 at digraph dot polyomino dot org dot uk> <CAFULd4ZgTJhnX4xhDzeKuSDzErFsJUEEtwfhAKgp_Lmurve5FQ at mail dot gmail dot com>
On Tue, 26 Nov 2013, Uros Bizjak wrote:
> On Tue, Nov 26, 2013 at 12:31 AM, Joseph S. Myers
> <joseph@codesourcery.com> wrote:
> > I don't see why the op-2.h change should be needed - the code with the
> > problem shift is already inside the "else" part of a ((rsize <=
> > _FP_W_TYPE_SIZE) ? : ...) conditional, and the reason ?: is used here
> > instead of if/else is exactly to avoid such warnings; putting in a second
> > nested such conditional with the same condition shouldn't make any
> > difference.
>
> You are right. I have added op-2.h mechanically, following op-4.h change.
>
> Attached patch also compiles gcc soft-fp without problems for x86_64
> 64bit and 32bit multilibs, so the build exercises op-4.h as well as
> op-2.h headers.
>
> Re-tested on x86_64 multilib gcc bootstrap and regression test.
>
> 2013-11-25 Uros Bizjak <ubizjak@gmail.com>
>
> * soft-fp/op-4.h (_FP_FRAC_ASSEMBLE_4): Check rsize against
> _FP_W_TYPE_SIZE to avoid "left shift count >= width of type" warning.
Thanks, committed.
--
Joseph S. Myers
joseph@codesourcery.com