From owner-svn-src-all@freebsd.org Fri Jan 19 18:35:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33BA9EC0D31; Fri, 19 Jan 2018 18:35:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0239F6DCF6; Fri, 19 Jan 2018 18:35:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f171.google.com with SMTP id f34so3119315ioi.13; Fri, 19 Jan 2018 10:35:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=RIbR47JCXbrLqEc4cf9WTfW54vnQa4FncQ7XoKvlr9M=; b=r6cqV/ez4ndZeh9nK9kKeDxK/a7ibTbfFd+lk3l6NLag3Zbuqyc/+GFsxm0Bbxq8zi elPKh3t9+TJSUlNC0lmqlutf8xB0aG6SI0ipRdaHENN01bD8qEarmdsawAwVpyQ+4Xjt nTgSzVGkxtqXxQ8EJMpqL6KbsGEsIr1re08TKvGfMFofh0VyzB2PCrzOrQI4PPra9nWb zCzISRIOeKUkogSlWyfZT5/Gocghf8dTz6Xrb27itnXqbJDTMz21RNkVeWyKbDBQ7N12 fHPkpz19KXV2Cq+o4SEYUd6UanynbyRtLN0odmllWPWXARPnOPsIIuqqirzHECNpoHgK iomA== X-Gm-Message-State: AKwxytfopVW+b2Ke+0O4od3lKKo/J0yzI1UJ5EvIiZj6sxXNKxHmZss0 Q50Dh/Ql1BpSkq6DGvW8KlN2XLlr X-Google-Smtp-Source: ACJfBouzkC7WrlZSq8tkE4gO1+kk0UlpOT6gdxgCm88zu/1jIwWoNKyn1K27JlvJMAzI1qoS7dbkKA== X-Received: by 10.107.131.207 with SMTP id n76mr26162478ioi.268.1516386621931; Fri, 19 Jan 2018 10:30:21 -0800 (PST) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com. [209.85.214.53]) by smtp.gmail.com with ESMTPSA id i127sm1048990ita.42.2018.01.19.10.30.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 10:30:21 -0800 (PST) Received: by mail-it0-f53.google.com with SMTP id c16so3156074itc.5; Fri, 19 Jan 2018 10:30:21 -0800 (PST) X-Received: by 10.36.114.193 with SMTP id x184mr31824898itc.71.1516386621287; Fri, 19 Jan 2018 10:30:21 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.95.152 with HTTP; Fri, 19 Jan 2018 10:30:20 -0800 (PST) In-Reply-To: <201801191737.w0JHbM90073097@pdx.rh.CN85.dnsmgr.net> References: <201801191737.w0JHbM90073097@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Fri, 19 Jan 2018 10:30:20 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328159 - head/sys/modules To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 18:35:58 -0000 On Fri, Jan 19, 2018 at 9:37 AM, Rodney W. Grimes wrote: > If you think in assembler it is easy to understand why this is UB, > most (all) architectures Right Logic or Arithmetic Shift only accept an > operand that is a size that can hold log2(wordsize). This is a logical right shift by a constant larger than the width of the left operand. As a result, it would a constant zero in any emitted machine code. It is a bug in the C standard and a concession to naive, non-optimizing compilers that this is considered UB.