Re: Fix POINTER_PLUS_EXPR oversight

2012-03-03 Thread Richard Guenther
On Fri, Mar 2, 2012 at 6:59 PM, Mike Stump mikest...@comcast.net wrote: On Mar 2, 2012, at 1:33 AM, Richard Guenther wrote: Interestingly, the C++ frontend also has a pointer_diff function, but doesn't seem to attempt to optimize. Is there a reason for this? Frontends should not optimize when

Re: Fix POINTER_PLUS_EXPR oversight

2012-03-02 Thread Richard Guenther
On Thu, Mar 1, 2012 at 9:23 PM, Bernd Schmidt bernds_...@t-online.de wrote: In pointer_diff we still expect pointer addition to use PLUS_EXPR. I discovered this while working on a new port with somewhat unusual pointer types. Interestingly, the C++ frontend also has a pointer_diff function,

Re: Fix POINTER_PLUS_EXPR oversight

2012-03-02 Thread Mike Stump
On Mar 2, 2012, at 1:33 AM, Richard Guenther wrote: Interestingly, the C++ frontend also has a pointer_diff function, but doesn't seem to attempt to optimize. Is there a reason for this? Frontends should not optimize when they are not required to. Actually, the frontends should optimize as

Fix POINTER_PLUS_EXPR oversight

2012-03-01 Thread Bernd Schmidt
In pointer_diff we still expect pointer addition to use PLUS_EXPR. I discovered this while working on a new port with somewhat unusual pointer types. Interestingly, the C++ frontend also has a pointer_diff function, but doesn't seem to attempt to optimize. Is there a reason for this?

Re: Fix POINTER_PLUS_EXPR oversight

2012-03-01 Thread Joseph S. Myers
On Thu, 1 Mar 2012, Bernd Schmidt wrote: In pointer_diff we still expect pointer addition to use PLUS_EXPR. I discovered this while working on a new port with somewhat unusual pointer types. Interestingly, the C++ frontend also has a pointer_diff function, but doesn't seem to attempt to