This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: h8300: less optimal (buggy?) compiler output with last build
- To: "Bill Knight" <BillK at rosw dot com>, "gcc" <gcc at gcc dot gnu dot org>, "gnuh8" <gnuh8 at pcserv dot demon dot co dot uk>
- Subject: Re: h8300: less optimal (buggy?) compiler output with last build
- From: Ralf Gütlein <ralf dot guetlein at aranea dot de>
- Date: Thu, 17 Aug 2000 11:35:29 +0200
- References: <200008161601.LAA05198@mail.teleteam.net>
- Reply-To: Ralf Gütlein <ralf dot guetlein at biotest-mt dot de>
----- 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