public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/61158] New: negative shift at fold-const.c:12095
@ 2014-05-12 18:03 zeccav at gmail dot com
  2014-05-13 18:10 ` [Bug middle-end/61158] " mpolacek at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: zeccav at gmail dot com @ 2014-05-12 18:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61158

            Bug ID: 61158
           Summary: negative shift at fold-const.c:12095
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com

Compilation of the following forces a negative shift, result undefined in my
opinion 
/* gcc -S negative shift at fold-const.c:12095
 * x86_64
 * "zerobits <<= prec - shiftc;"
 * because prec - shiftc = -8
 * result is undefined 
 * compiling Linux Fedora 20 source code kernel/trace/blktrace.c
 * checked with "gcc_assert(prec >= shiftc && prec-shiftc <
HOST_BITS_PER_WIDE_INT);" immediately before
*/
typedef unsigned long long __u64;
void blk_add_trace_unplug(unsigned int depth)
{
((__u64)(depth) & (__u64)0x00ff000000000000ULL) >> 40;
}


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-02-21  7:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-12 18:03 [Bug c/61158] New: negative shift at fold-const.c:12095 zeccav at gmail dot com
2014-05-13 18:10 ` [Bug middle-end/61158] " mpolacek at gcc dot gnu.org
2014-05-14  5:19 ` zeccav at gmail dot com
2014-05-14 10:08 ` mpolacek at gcc dot gnu.org
2014-05-14 10:40 ` jakub at gcc dot gnu.org
2014-05-15 10:01 ` jakub at gcc dot gnu.org
2014-05-15 10:08 ` jakub at gcc dot gnu.org
2014-05-15 10:08 ` jakub at gcc dot gnu.org
2014-09-06 17:13 ` danglin at gcc dot gnu.org
2014-09-06 18:01 ` danglin at gcc dot gnu.org
2021-02-21  7:51 ` zeccav at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).