From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754064AbdCBOtJ (ORCPT ); Thu, 2 Mar 2017 09:49:09 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34437 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbdCBOsL (ORCPT ); Thu, 2 Mar 2017 09:48:11 -0500 Date: Thu, 2 Mar 2017 15:46:39 +0100 From: Ingo Molnar To: Josh Poimboeuf Cc: Arnd Bergmann , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Linux Kernel Mailing List , Denys Vlasenko Subject: Re: [PATCH] [RFC] x86: avoid -mtune=atom for objtool warnings Message-ID: <20170302144639.GA8969@gmail.com> References: <20170301144008.3ocnbvry4sbl3cnu@treble> <20170301165355.w2kmdmbql2f2ouzg@treble> <20170302010342.fshczxfiiz3txgac@treble> <20170302063139.GA594@gmail.com> <20170302124926.47vfba4q6igkirzj@treble> <20170302134629.GA13468@gmail.com> <20170302140830.6cryk3uepqnrrqef@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170302140830.6cryk3uepqnrrqef@treble> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Josh Poimboeuf wrote: > > > > Well, technically an invalid opcode is shorter code than generating an > > > > (integer) division by zero exception, right? > > > > > > What does that matter if it's the wrong behavior? > > > > Well, both terminate the program, and it's obvious if you look at it with a > > debugger what happened, right? > > If it were obvious, we wouldn't be having this discussion :-) Touche ;-) > The only thing obvious to me was that gcc mysteriously removed a bunch of code > and replaced it with a 'ud2' instruction in the middle of the function for no > apparent reason. I don't know what their motivation was, but if it's not a bug, if it was done intentionally, then I'd guess it's roughly the argument I made: in simple testcases it can be argued to be a code size improvement, plus it's probably allowed by the letter of the compiler standards (program termination behavior is notoriously platform dependent and thus vaguely specified) - but for real-life code I very much agree that it's a step backward in generated code quality... Thanks, Ingo