public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] possible ELDK4 gcc compiler bug
Date: Thu, 7 Dec 2006 17:55:27 +0100	[thread overview]
Message-ID: <200612071755.27873.matthias.fuchs@esd-electronics.com> (raw)
In-Reply-To: <DCEAAC0833DD314AB0B58112AD99B93B0189E054@ismail.innsys.innovsys.com>

On Thursday 07 December 2006 17:42, Rune Torgersen wrote:
> > -----Original Message-----
> > From:  Matthias Fuchs
> > *)FPGA_BA;
> > Making 'fpga' static solves the problem. But why?
> > 
> 
> Making it volatile will solve it.
I tried that - of course. But it didn't solve the problem.

> 
> The reason is that the ctrl member is not used anywhere else (except for
> some printf's) sothe compiler just strores the value in a register an
> optimizes away the access to the datastructure (and your hardware). 
> By making it volatile, you force the compiler to never optimize away the
> accesses.
> 
> BTW. your original code would probably have worked with -O0
> optimizattion level.
Yes, it does.

Matthias

-- 
-----------------------------------------------------------------------
Dipl.-Ing. Matthias Fuchs             esd electronic system design gmbh
http://www.esd-electronics.com                    Vahrenwalder Str. 207
phone: +49-511-37298-0, fax: -68                30165 Hannover, Germany
-----------------------------------------------------------------------

  reply	other threads:[~2006-12-07 16:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-07 16:21 [U-Boot-Users] possible ELDK4 gcc compiler bug Matthias Fuchs
2006-12-07 16:28 ` Matthias Fuchs
2006-12-07 16:38   ` Pantelis Antoniou
2006-12-07 17:12     ` Matthias Fuchs
2006-12-07 17:25       ` Timur Tabi
2006-12-07 17:33         ` Pantelis Antoniou
2006-12-07 16:42   ` Rune Torgersen
2006-12-07 16:55     ` Matthias Fuchs [this message]
2006-12-07 16:29 ` Pantelis Antoniou
2006-12-07 16:42 ` Tolunay Orkun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200612071755.27873.matthias.fuchs@esd-electronics.com \
    --to=matthias.fuchs@esd-electronics.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox