From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbdCCJ15 (ORCPT ); Fri, 3 Mar 2017 04:27:57 -0500 Received: from mail-ot0-f193.google.com ([74.125.82.193]:36502 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751340AbdCCJ1y (ORCPT ); Fri, 3 Mar 2017 04:27:54 -0500 MIME-Version: 1.0 In-Reply-To: <20170302230558.bhmo4q62v7tqjl2n@treble> References: <20161011155146.icyl3zewdvmms2h2@treble> <2252957.Vm1BYSSRqP@wuerfel> <20170301144008.3ocnbvry4sbl3cnu@treble> <20170301165355.w2kmdmbql2f2ouzg@treble> <20170302010342.fshczxfiiz3txgac@treble> <20170302230558.bhmo4q62v7tqjl2n@treble> From: Arnd Bergmann Date: Fri, 3 Mar 2017 09:58:54 +0100 X-Google-Sender-Auth: rYF2CbuQqbis08eRdjLxYjjOBV0 Message-ID: Subject: Re: [PATCH] [RFC] x86: avoid -mtune=atom for objtool warnings To: Josh Poimboeuf Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Linux Kernel Mailing List , Denys Vlasenko Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 3, 2017 at 12:05 AM, Josh Poimboeuf wrote: > I assume '-Wdiv-by-zero' is enabled and gcc isn't showing the "division > by zero" warning for either of these? The 'ud2' is guaranteed to > trigger since the function has no branches. Surely at least the missing > warning is a gcc bug. > > The good news is objtool is flushing these out, albeit with a confusing > message. I'm still not sure if it's intentional or not. I've reduced the test case to the simple static inline int return0(void) { return 0; } int provoke_div0_warning(void) { return 1 / return0(); } which does not generate a compile-time warning, but will generate an unconditional runtime warning if built with -fsanitze=integer-divide-by-zero. Arnd