Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754295AbbK0Ix4 (ORCPT ); Fri, 27 Nov 2015 03:53:56 -0500 Received: from mail-lf0-f48.google.com ([209.85.215.48]:34661 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751599AbbK0Ixx (ORCPT ); Fri, 27 Nov 2015 03:53:53 -0500 From: Rasmus Villemoes To: Ralf Baechle Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: no-op delay loops Organization: D03 Date: Fri, 27 Nov 2015 09:53:50 +0100 Message-ID: <87si3rbz6p.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 792 Lines: 27 Hi, It seems that gcc happily compiles for (i = 0; i < 1000000000; ++i) ; into simply i = 1000000000; (which is then usually eliminated as a dead store). At least at -O2, and when i is not declared volatile. So it would seem that the loops at arch/mips/pci/pci-rt2880.c:235 arch/mips/pmcs-msp71xx/msp_setup.c:80 arch/mips/sni/reset.c:35 actually don't do anything. (In the middle one, i is 'register', but that doesn't change anything.) Is mips compiled with some special flags that would make gcc actually emit code for the above? Rasmus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/