#59 Solution for Bug 1457608

closed-rejected
nobody
None
5
2006-04-04
2006-03-24
Hubert Sack
No

If the source or destination is volatile peephole 177.c
isn't applied.
I added a second (or) condition for 177.c
Because a or-clause isn't possible, it must be a
complete "replace ... by ..." block
The source is attached as textfile produced by the diff
utility

Discussion

  • Hubert Sack

    Hubert Sack - 2006-03-24

    result of running diff

     
  • Hubert Sack

    Hubert Sack - 2006-03-24

    Simplified patch

     
  • Hubert Sack

    Hubert Sack - 2006-03-24

    Logged In: YES
    user_id=1160854

    The same can be obtained much easier!
    The is no need to add a function to check for "operandsEqual"

     
  • Maarten Brock

    Maarten Brock - 2006-04-04

    Logged In: YES
    user_id=888171

    Hubert,

    Thanks for trying to help. Unfortunately this is not a
    valid fix. Consider the following:

    sfr SBUF; // all sfr's are volatile !

    void foo(void)
    {
    // reading SBUF has the hardware side effect of freeing
    // the buffer
    SBUF;
    // assuming the buffer is several bytes big this might
    // skip some bytes in it
    SBUF;
    }

    The generated code would look like:

    mov a,_SBUF
    mov a,_SBUF

    Removing the volatile check in the peephole rule destroys
    the intended functionality and violates the C standard.

    This must be fixed in src/mcs51/gen.c. But once again
    thanks for thinking with us.

    Greets,
    Maarten

     
  • Maarten Brock

    Maarten Brock - 2006-04-04
    • status: open --> closed-rejected
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks