public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ralf Gütlein <ralf.guetlein@aranea.de>
To: "Bill Knight" <BillK@rosw.com>, "gcc" <gcc@gcc.gnu.org>,
	"gnuh8" <gnuh8@pcserv.demon.co.uk>
Subject: Re: h8300: less optimal (buggy?) compiler output with last build
Date: Thu, 17 Aug 2000 02:36:00 -0000	[thread overview]
Message-ID: <03f401c0082e$82ec0e80$650b0d0a@Alzenau> (raw)
In-Reply-To: <200008161601.LAA05198@mail.teleteam.net>

----- Original Message -----
From: Bill Knight <BillK@rosw.com>
To: gcc <gcc@gcc.gnu.org>; gnuh8 <gnuh8@pcserv.demon.co.uk>
Sent: Wednesday, August 16, 2000 6:01 PM
Subject: Re: h8300: less optimal (buggy?) compiler output with last build


> The compiler may be trying to "help" because of the implied
> int declaration of Watchdog().  You might try the following
> declaration for Watchdog() and recheck the results:
>
> inline void Watchdog(void)
> {
>   TCW = 0;
> }
>

One more typo in the rendering. My sources were correct, though...

To sum it up:
The compiler generates an unneccessary (and thus erroneous, even dangerous)
read acccess to a previously written location, if all of the following
conditions are true:

1) the object is volatile
2) the object is written to by an inline function
3) this inline function is called

example source (hopefully without typos ;-)

///////////////////////////////////////
extern volatile unsigned char TCW;

extern inline void WD(void)
{
  TCW = 0;
}

void test(void)
{
  WD();
}
///////////////////////////////////////

> >
> >Is this issue present in other ports?

This question has been answered already: yes!

> >Will this be investigated by somebody?
> >Or, could anybody give hints where to look for this issue in the sources?

These questions are still to be answered :-(

Regards,
Ralf

       reply	other threads:[~2000-08-17  2:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200008161601.LAA05198@mail.teleteam.net>
2000-08-17  2:36 ` Ralf Gütlein [this message]
2000-08-18  1:47   ` Ralf Gütlein
2000-08-16  8:21 Kazu Hirata
2000-08-16  9:00 ` Ralf Gütlein
2000-08-16  9:24   ` Alan Lehotsky
2000-08-18  5:45   ` Kai Ruottu
2000-08-21  7:36     ` Jeffrey A Law
  -- strict thread matches above, loose matches on Subject: below --
2000-08-16  7:20 Ralf Gütlein

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='03f401c0082e$82ec0e80$650b0d0a@Alzenau' \
    --to=ralf.guetlein@aranea.de \
    --cc=BillK@rosw.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gnuh8@pcserv.demon.co.uk \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).