public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36706]  New: [Regression] linux-kernel 2.6.24 doesn't boot for arm
@ 2008-07-02 22:34 chris dot steel dot lnx at googlemail dot com
  2008-07-02 22:37 ` [Bug c/36706] " chris dot steel dot lnx at googlemail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: chris dot steel dot lnx at googlemail dot com @ 2008-07-02 22:34 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/36706] [Regression] linux-kernel 2.6.24 doesn't boot for arm
  2008-07-02 22:34 [Bug c/36706] New: [Regression] linux-kernel 2.6.24 doesn't boot for arm chris dot steel dot lnx at googlemail dot com
@ 2008-07-02 22:37 ` chris dot steel dot lnx at googlemail dot com
  2008-07-02 22:44 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: chris dot steel dot lnx at googlemail dot com @ 2008-07-02 22:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from chris dot steel dot lnx at googlemail dot com  2008-07-02 22:36 -------
Created an attachment (id=15845)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15845&action=view)
kernel config to reproduce the problem


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36706


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/36706] [Regression] linux-kernel 2.6.24 doesn't boot for arm
  2008-07-02 22:34 [Bug c/36706] New: [Regression] linux-kernel 2.6.24 doesn't boot for arm chris dot steel dot lnx at googlemail dot com
  2008-07-02 22:37 ` [Bug c/36706] " chris dot steel dot lnx at googlemail dot com
@ 2008-07-02 22:44 ` pinskia at gcc dot gnu dot org
  2008-07-02 22:47 ` [Bug inline-asm/36706] " pinskia at gcc dot gnu dot org
  2008-07-02 22:48 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-07-02 22:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-07-02 22:44 -------
The use of "o" is most likely wrong here and most likely not a GCC issue as you
are saying you access the memory when in reality you don't.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36706


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug inline-asm/36706] [Regression] linux-kernel 2.6.24 doesn't boot for arm
  2008-07-02 22:34 [Bug c/36706] New: [Regression] linux-kernel 2.6.24 doesn't boot for arm chris dot steel dot lnx at googlemail dot com
  2008-07-02 22:37 ` [Bug c/36706] " chris dot steel dot lnx at googlemail dot com
  2008-07-02 22:44 ` pinskia at gcc dot gnu dot org
@ 2008-07-02 22:47 ` pinskia at gcc dot gnu dot org
  2008-07-02 22:48 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-07-02 22:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-07-02 22:46 -------
Yes o is wrong here.  THis is not a GCC bug.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36706


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug inline-asm/36706] [Regression] linux-kernel 2.6.24 doesn't boot for arm
  2008-07-02 22:34 [Bug c/36706] New: [Regression] linux-kernel 2.6.24 doesn't boot for arm chris dot steel dot lnx at googlemail dot com
                   ` (2 preceding siblings ...)
  2008-07-02 22:47 ` [Bug inline-asm/36706] " pinskia at gcc dot gnu dot org
@ 2008-07-02 22:48 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-07-02 22:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2008-07-02 22:47 -------
"o" means any offsetable memory operand so GCC thinks you are accessing memory
that will always be valid.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36706


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-07-02 22:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-02 22:34 [Bug c/36706] New: [Regression] linux-kernel 2.6.24 doesn't boot for arm chris dot steel dot lnx at googlemail dot com
2008-07-02 22:37 ` [Bug c/36706] " chris dot steel dot lnx at googlemail dot com
2008-07-02 22:44 ` pinskia at gcc dot gnu dot org
2008-07-02 22:47 ` [Bug inline-asm/36706] " pinskia at gcc dot gnu dot org
2008-07-02 22:48 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).