[PATCH] Fix c/69643, named address space wrong-code

2016-02-02 Thread Richard Henderson
In gimple_fold_indirect_ref, we STRIP_NOPS, find the ADDR_EXPR, and fold everything away. I can't imagine it ever being correct to drop an address space change between pointers, so I've modified tree_nop_conversion_p. Anything else seems to require more checks every places we use STRIP_NOPS.

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-02 Thread Richard Biener
On February 3, 2016 7:03:54 AM GMT+01:00, Richard Henderson wrote: >In gimple_fold_indirect_ref, we STRIP_NOPS, find the ADDR_EXPR, and >fold >everything away. > >I can't imagine it ever being correct to drop an address space change >between >pointers, so I've modified tree_nop_conversion_p. A

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-02 Thread Richard Henderson
On 02/03/2016 06:05 PM, Richard Biener wrote: I wasn't aware that STRIP_NOPS strips ADDR_SPACE_CONVERT_EXPR. Isn't this maybe failing to use that (unable to look at the attachment from my phone). The test case does fail to use ADDR_SPACE_CONVERT_EXPR. Perhaps it's because of the intermediate

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-03 Thread Richard Biener
On February 3, 2016 8:11:01 AM GMT+01:00, Richard Henderson wrote: >On 02/03/2016 06:05 PM, Richard Biener wrote: > I wasn't aware that STRIP_NOPS strips ADDR_SPACE_CONVERT_EXPR. >> >> Isn't this maybe failing to use that (unable to look at the >attachment from my phone). > >The test case does f

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-03 Thread Richard Henderson
On 02/04/2016 12:46 AM, Richard Biener wrote: On February 3, 2016 8:11:01 AM GMT+01:00, Richard Henderson wrote: On 02/03/2016 06:05 PM, Richard Biener wrote: I wasn't aware that STRIP_NOPS strips ADDR_SPACE_CONVERT_EXPR. Isn't this maybe failing to use that (unable to look at the attachm

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-03 Thread Richard Henderson
On 02/04/2016 07:30 AM, Richard Henderson wrote: On 02/04/2016 12:46 AM, Richard Biener wrote: As for a patch I'd repeatedly pondered on not stripping int <-> pointer conversions at all, similar to what STRIP_SIGN_NOPS does. Don't remember actually trying this or the fallout though. I'll run

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-04 Thread Richard Biener
On Wed, Feb 3, 2016 at 10:44 PM, Richard Henderson wrote: > On 02/04/2016 07:30 AM, Richard Henderson wrote: >> >> On 02/04/2016 12:46 AM, Richard Biener wrote: >>> >>> As for a patch I'd repeatedly pondered on not stripping int <-> pointer >>> conversions at all, similar to what STRIP_SIGN_NOPS d

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-04 Thread Richard Henderson
On 02/04/2016 10:07 PM, Richard Biener wrote: On Wed, Feb 3, 2016 at 10:44 PM, Richard Henderson wrote: On 02/04/2016 07:30 AM, Richard Henderson wrote: On 02/04/2016 12:46 AM, Richard Biener wrote: As for a patch I'd repeatedly pondered on not stripping int <-> pointer conversions at all,

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-04 Thread Richard Biener
On February 4, 2016 10:04:47 PM GMT+01:00, Richard Henderson wrote: >On 02/04/2016 10:07 PM, Richard Biener wrote: >> On Wed, Feb 3, 2016 at 10:44 PM, Richard Henderson >wrote: >>> On 02/04/2016 07:30 AM, Richard Henderson wrote: On 02/04/2016 12:46 AM, Richard Biener wrote: >

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-04 Thread Richard Henderson
On 02/05/2016 08:59 AM, Richard Biener wrote: This version fails to fall through to the next code block when (1) Both types are pointers, (2) Both types have the same address space, which will do the wrong thing when (3) The pointers have different modes. Recall that several ports allow

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-05 Thread Richard Biener
On Thu, Feb 4, 2016 at 11:35 PM, Richard Henderson wrote: > On 02/05/2016 08:59 AM, Richard Biener wrote: >>> >>> This version fails to fall through to the next code block when >>>(1) Both types are pointers, >>>(2) Both types have the same address space, >>> which will do the wrong thing

Re: [PATCH] Fix c/69643, named address space wrong-code

2016-02-05 Thread Tom Tromey
> "rth" == Richard Henderson writes: rth> The user-friendly way to do this would probably be some sort of pragma rth> that allows user-defined address spaces, and user-defined conversion rth> between them. But that's certainly not going to happen in the rth> near-term. Related is https://gcc