From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24067 invoked by alias); 2 Jul 2008 22:34:32 -0000 Received: (qmail 23825 invoked by uid 48); 2 Jul 2008 22:33:45 -0000 Date: Wed, 02 Jul 2008 22:34:00 -0000 Subject: [Bug c/36706] New: [Regression] linux-kernel 2.6.24 doesn't boot for arm X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "chris dot steel dot lnx at googlemail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-07/txt/msg00138.txt.bz2 I've built linux-2.6.24 for arm using gcc-4.3.1 and while it builds fine, the resulting binary doesn't boot on qemu. If I build the same kernel with gcc-4.2.4 it boots correctly. The problem seems to be that the prefetch function (linux-2.6.24/include/asm-arm/processor.h) causes a crash if it is called with a NULL pointer argument. But only if it's compiled with gcc-4.3.x. This patch fixes the problem, but the extra code may cost more than you gain by having prefetch in the first place diff -urN linux-2.6.24-clean/include/asm-arm/processor.h linux-2.6.24/include/asm-arm/processor.h --- linux-2.6.24-clean/include/asm-arm/processor.h 2008-01-24 22:58:37.000000000 +0000 +++ linux-2.6.24/include/asm-arm/processor.h 2008-07-02 22:44:26.052525328 +0100 @@ -105,11 +105,14 @@ #define ARCH_HAS_PREFETCH static inline void prefetch(const void *ptr) { - __asm__ __volatile__( - "pld\t%0" - : - : "o" (*(char *)ptr) - : "cc"); + if (ptr) + { + __asm__ __volatile__( + "pld\t%0" + : + : "o" (*(char *)ptr) + : "cc"); + } } #define ARCH_HAS_PREFETCHW -- Summary: [Regression] linux-kernel 2.6.24 doesn't boot for arm Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: chris dot steel dot lnx at googlemail dot com GCC build triplet: x86_64-cross-linux-gnu GCC host triplet: x86_64-cross-linux-gnu GCC target triplet: arm-unknown-linux-gnueabi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36706