public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: h8300: less optimal (buggy?) compiler output with last build
@ 2000-08-16  8:21 Kazu Hirata
  2000-08-16  9:00 ` Ralf Gütlein
  0 siblings, 1 reply; 8+ messages in thread
From: Kazu Hirata @ 2000-08-16  8:21 UTC (permalink / raw)
  To: 'Ralf Gütlein', gcc, gnuh8

Hi Ralf,

> extern unsigned char volatile TCW;
> 
> inline Watchdog()
> {
>   TCW = 0;
> }
> 
> void testcase_1(void)
> {
>   TCW = 0;
> }
> 
> void testcase_2(void)
> {
>   Watchdog();
> }
> 
> The h8 assembler source (compiled with -Os -fomit-frame-pointer):
> 
> testcase_1: sub   r2l, r2l
>             mov.b r2l, TCW
>             rts
> 
> testcase_2: sub   r2l, r2l
>             mov.b r2l, TCW
>             mov.b TCW, r2l  ; <-- ????
>             rts

This sounds serious.  I am using the latest gcc from the cvs, but this
problem did not happen.  Does your version actually output TCW, not @_TCW?
Have you applied any patches that are not in the cvs?

Kazu Hirata

^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <200008161601.LAA05198@mail.teleteam.net>]
* h8300: less optimal (buggy?) compiler output with last build
@ 2000-08-16  7:20 Ralf Gütlein
  0 siblings, 0 replies; 8+ messages in thread
From: Ralf Gütlein @ 2000-08-16  7:20 UTC (permalink / raw)
  To: gcc, gnuh8, Kazu Hirata

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1443 bytes --]

After installing the latest build of the h8 toolchain,
I realized that the compiler output (assembler source)
is worse than before (I used to use a snapshot from
December 99). One concrete example (cc the use of inline
functions):

extern unsigned char volatile TCW;

inline Watchdog()
{
  TCW = 0;
}

void testcase_1(void)
{
  TCW = 0;
}

void testcase_2(void)
{
  Watchdog();
}

The h8 assembler source (compiled with -Os -fomit-frame-pointer):

testcase_1: sub   r2l, r2l
            mov.b r2l, TCW
            rts

testcase_2: sub   r2l, r2l
            mov.b r2l, TCW
            mov.b TCW, r2l  ; <-- ????
            rts

As you can see, in the "inline" test case there is an erroneous read
of the previously written address.
This could be fatal (in case of an embedded system), when the
hardware doesn't "like" read access to a write-only position. So there
is good reason to treat this as a BUG.

As I mentioned before, this problem didn't occure in earlier versions
(e.g. Dec-99).

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

Regards,
Ralf

           .....
           ô ô )
-----oOOo--(_)---oOOo------

Ralf Guetlein
Biotest Medizintechnik GmbH
Industriestrasse 19
D-63755 Alzenau
Germany
---------------------------
Tel. +49 6023 9487-42
Fax. +49 6023 9487-33
ralf.guetlein@biotest-mt.de
---------------------------


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

end of thread, other threads:[~2000-08-21  7:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-16  8:21 h8300: less optimal (buggy?) compiler output with last build 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
     [not found] <200008161601.LAA05198@mail.teleteam.net>
2000-08-17  2:36 ` Ralf Gütlein
2000-08-18  1:47   ` Ralf Gütlein
  -- strict thread matches above, loose matches on Subject: below --
2000-08-16  7:20 Ralf Gütlein

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).