public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: EGCS Optimization bug on HPUX
@ 1999-04-28 11:21 korbb
  1999-04-30 23:15 ` korbb
  0 siblings, 1 reply; 2+ messages in thread
From: korbb @ 1999-04-28 11:21 UTC (permalink / raw)
  To: egcs-bugs, egcs; +Cc: ddsinc09

Reply-To: ddsinc09@ix.netcom.com


Has this issue ever been addressed or looked at?
I haven't seen followup since
John David Anglin <dave@hiauly1.hia.nrc.ca>
a week ago.  Thanks.


> The following code fragment appears in AutoGen's evalExpr_SHSTR
> routine in src/agExpr.c:
> 
>      *(pz++) = '"';
>      for (;;) {
>          switch (*(pz++) = *(pzDta++)) {
>          case NUL:
>              goto loopDone2;
> 
>          case '"':
>          case '\\':
>              pz[-1]  = '\\';
>              *(pz++) = pzDta[-1];
>          }
>      } loopDone2:;
>      pz[-1] = '"';
>      *pz    = NUL;
> 
> AutoGen is available from:
> 
>    ftp://sourceware.cygnus.com/pub/egcs/infrastructure/autogen.tar.gz
> 
> Under optimization levels 2 and above, the value for "pzDta" is
> apparently stored in both a register and in memory _AND_ they are
> not kept in sync.  Here is an example from autogen/tests/evalstr.test:

I believe the above observation is essentially correct.  However, it
is the synchronization between two registers rather than register and
memory.  At -O2 and above, additional registers are used to hold pz-1
and pzDta-1.  These registers are not properly kept in sync with the
registers used for pz and pzDta.

I created this test program:

#define NUL 0
void loop (char * pz, char * pzDta)
{
    for (;;) {
        switch (*(pz++) = *(pzDta++)) {
        case NUL:
            goto loopDone2;

        case '"':
        case '\\':
            pz[-1]  = '\\';
            *(pz++) = pzDta[-1];
        }
    } loopDone2:;
}

Here is the assembler code at -O1:

[[omitted]]

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

* Re: EGCS Optimization bug on HPUX
  1999-04-28 11:21 EGCS Optimization bug on HPUX korbb
@ 1999-04-30 23:15 ` korbb
  0 siblings, 0 replies; 2+ messages in thread
From: korbb @ 1999-04-30 23:15 UTC (permalink / raw)
  To: egcs-bugs, egcs; +Cc: ddsinc09

Reply-To: ddsinc09@ix.netcom.com


Has this issue ever been addressed or looked at?
I haven't seen followup since
John David Anglin <dave@hiauly1.hia.nrc.ca>
a week ago.  Thanks.


> The following code fragment appears in AutoGen's evalExpr_SHSTR
> routine in src/agExpr.c:
> 
>      *(pz++) = '"';
>      for (;;) {
>          switch (*(pz++) = *(pzDta++)) {
>          case NUL:
>              goto loopDone2;
> 
>          case '"':
>          case '\\':
>              pz[-1]  = '\\';
>              *(pz++) = pzDta[-1];
>          }
>      } loopDone2:;
>      pz[-1] = '"';
>      *pz    = NUL;
> 
> AutoGen is available from:
> 
>    ftp://sourceware.cygnus.com/pub/egcs/infrastructure/autogen.tar.gz
> 
> Under optimization levels 2 and above, the value for "pzDta" is
> apparently stored in both a register and in memory _AND_ they are
> not kept in sync.  Here is an example from autogen/tests/evalstr.test:

I believe the above observation is essentially correct.  However, it
is the synchronization between two registers rather than register and
memory.  At -O2 and above, additional registers are used to hold pz-1
and pzDta-1.  These registers are not properly kept in sync with the
registers used for pz and pzDta.

I created this test program:

#define NUL 0
void loop (char * pz, char * pzDta)
{
    for (;;) {
        switch (*(pz++) = *(pzDta++)) {
        case NUL:
            goto loopDone2;

        case '"':
        case '\\':
            pz[-1]  = '\\';
            *(pz++) = pzDta[-1];
        }
    } loopDone2:;
}

Here is the assembler code at -O1:

[[omitted]]

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

end of thread, other threads:[~1999-04-30 23:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-28 11:21 EGCS Optimization bug on HPUX korbb
1999-04-30 23:15 ` korbb

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