#1957 CSE ignores pointer aliasing problems.

open
nobody
6
2016-01-16
2012-03-01
No

The current CSE implementation assumes an object accessed via a pointer can only be accessed via that pointer (as if the restrict qualifier had been used on all pointers), leaving potentially stale CSE information when the object is modified. For examples, see the disabled test cases test_Struct5() and test_Global1() in support/regression/tests/cse.c

I don't think this bug should have much impact on reasonably written programs, so I'm just leaving this as a lower priority open bug until I have time to implement a non-Draconian solution.

Discussion

  • Philipp Klaus Krause

    I disagree with the lower-than-default priority. Bad code is generated silently for standard-conformant programs. I even suspect that this might be a duplicate of one of the gcc-torture-execute- failures. I'd thus suggest a priority of 6.

    However I think it is justified to not block the next release on this bug.

    Philipp

     
  • Erik Petrich

    Erik Petrich - 2012-03-24
    • priority: 4 --> 6
     
  • Erik Petrich

    Erik Petrich - 2012-03-24

    Yes, there several related gcc-torture-execute failures and I've assigned them the category "pointer aliasing". I've increased the priority.

    Revision #7480 fixes aliasing between pointers and global variables, but is a little over conservative and so regresses a bit on code size. Still in progress is tracking pointer values to deal with aliasing between multiple pointers.

     
  • Philipp Klaus Krause

    How about implementing Draco's approach for now, assuming that any pointer might alias any other pointer? This probably would impact code size somewhat (most likely not as bad as #6761), but it gets some bugs fixed.

    Philipp

     

Log in to post a comment.