public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/107846] New: error: result of '8000 << 8' requires 22 bits to represent, but 'short int' only has 16 bits
@ 2022-11-23 17:45 james.hilliard1 at gmail dot com
  2022-11-23 18:26 ` [Bug target/107846] " david.faust at oracle dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: james.hilliard1 at gmail dot com @ 2022-11-23 17:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107846

            Bug ID: 107846
           Summary: error: result of '8000 << 8' requires 22 bits to
                    represent, but 'short int' only has 16 bits
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: james.hilliard1 at gmail dot com
  Target Milestone: ---

I'm seeing this error which does not occur in llvm for a bpf
test(test_tc_tunnel.c) in bpf-next, I'm not sure if this is an upstream bug in
the test itself or a bug in gcc:

In function '__encap_ipv4':
cc1: error: result of '8000 << 8' requires 22 bits to represent, but 'short
int' only has 16 bits [-Werror=shift-overflow=]
cc1: error: result of '20000 << 8' requires 24 bits to represent, but 'short
int' only has 16 bits [-Werror=shift-overflow=]
progs/test_tc_tunnel.c:228:31: warning: taking address of packed member of
'struct v4hdr' may result in an unaligned pointer value
[-Waddress-of-packed-member]
  228 |         set_ipv4_csum((void *)&h_outer.ip);
      |                               ^~~~~~~~~~~
In function '__encap_ipv6':
cc1: error: result of '8000 << 8' requires 22 bits to represent, but 'short
int' only has 16 bits [-Werror=shift-overflow=]
cc1: error: result of '20000 << 8' requires 24 bits to represent, but 'short
int' only has 16 bits [-Werror=shift-overflow=]

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

end of thread, other threads:[~2023-03-04  9:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 17:45 [Bug target/107846] New: error: result of '8000 << 8' requires 22 bits to represent, but 'short int' only has 16 bits james.hilliard1 at gmail dot com
2022-11-23 18:26 ` [Bug target/107846] " david.faust at oracle dot com
2022-11-23 19:02 ` pinskia at gcc dot gnu.org
2022-11-23 19:09 ` [Bug c/107846] [13 Regression] " pinskia at gcc dot gnu.org
2022-11-23 19:12 ` pinskia at gcc dot gnu.org
2022-11-23 19:20 ` jakub at gcc dot gnu.org
2022-11-29 15:26 ` jakub at gcc dot gnu.org
2022-11-29 18:57 ` james.hilliard1 at gmail dot com
2022-11-29 18:59 ` jakub at gcc dot gnu.org
2022-11-29 19:00 ` pinskia at gcc dot gnu.org
2022-11-29 19:06 ` james.hilliard1 at gmail dot com
2023-03-04  9:15 ` cvs-commit at gcc dot gnu.org
2023-03-04  9:24 ` jakub at gcc dot gnu.org

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).