From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D6DD3852231; Wed, 23 Nov 2022 17:45:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D6DD3852231 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669225558; bh=Aw1I5AJJIT+u0ZZBbastmZNjsiExieDvTN7Eu+YWGLk=; h=From:To:Subject:Date:From; b=yylFIWzl11sSZZjxgtlIa4yRV+IxhL0XHJHlSizncw/LXDBeQ41h5Qf8rvYgl/X2B hruGRwcbcIJwiE3/SUf+nvJTa5CEoxKHei5Gq0PbJjrVar8byTgC3pKKjGLlk/dNBz lKIFO9+XLOV/1sfMZbizEXvZ5VQsw4XY59r78tNs= From: "james.hilliard1 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107846] New: error: result of '8000 << 8' requires 22 bits to represent, but 'short int' only has 16 bits Date: Wed, 23 Nov 2022 17:45:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: james.hilliard1 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107846 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=3Dshift-overflow=3D] cc1: error: result of '20000 << 8' requires 24 bits to represent, but 'short int' only has 16 bits [-Werror=3Dshift-overflow=3D] 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=3Dshift-overflow=3D] cc1: error: result of '20000 << 8' requires 24 bits to represent, but 'short int' only has 16 bits [-Werror=3Dshift-overflow=3D]=