#2028 Rematerialization loses upper part

closed-fixed
hc08 port (43)
6
2013-05-25
2012-05-31
No

The hc08 port allows rematerilization of things other than addresses of global variables: In ralloc.c, line 2885 it tests using IS_VALOP. However, when the value is to be rematerialized, only the lower two bytes are rematerialized correctly, upper bytes are set to zero, which results in broken code when rematerializing e.g. a long.
I noticed this in the lospre branch, revision #7835, as it causes the regression test gen/hc08/addsub/addsub_storage_none_type_long_attr_volatile to fail there, but the bug is there in trunk as well, it just isn't triggered by any of our current regression tests.

Philipp

Discussion

  • Erik Petrich

    Erik Petrich - 2012-06-05

    I think this code that allows rematerialization of a value needs to be removed. While it would be fairly easy to fix it so that the upper bytes were not truncated, the rematerialization code also assumes that the value is of integral type. So if it attempted to rematerialize a float, all of the bytes would likely be incorrect.

    It also seems redundant in that CSE should replace variables that have been assigned a literal value with that literal value in the cases that it is safe to do so.

     
  • Erik Petrich

    Erik Petrich - 2012-06-09

    As of revision #7878, value operands are no longer marked as rematerializable.

     
  • Erik Petrich

    Erik Petrich - 2012-06-09
    • milestone: --> fixed
    • assigned_to: nobody --> epetrich
    • status: open --> closed-fixed
     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks