Re: [RFH / Patch] PR 20140

2012-01-02 Thread Richard Guenther
On Mon, Jan 2, 2012 at 3:24 AM, Paolo Carlini paolo.carl...@oracle.com wrote: On 01/02/2012 02:49 AM, Jason Merrill wrote: On 01/01/2012 08:10 PM, Paolo Carlini wrote: The analysis is confirmed by the fact that the rather heavy handed patchlet which I'm attaching, which uses copy_node to

Re: [RFH / Patch] PR 20140

2012-01-02 Thread Paolo Carlini
Hi, On Mon, Jan 2, 2012 at 3:24 AM, Paolo Carlinipaolo.carl...@oracle.com wrote: On 01/02/2012 02:49 AM, Jason Merrill wrote: On 01/01/2012 08:10 PM, Paolo Carlini wrote: The analysis is confirmed by the fact that the rather heavy handed patchlet which I'm attaching, which uses copy_node to

Re: [RFH / Patch] PR 20140

2012-01-02 Thread Jason Merrill
On 01/02/2012 08:25 AM, Paolo Carlini wrote: Bad, because currently many circumstances in which we do TREE_TYPE (init) = type are in fact benign: I don't think they are benign. Even when types are equivalent, we need to convert between them, as several things in the back end rely on pointer

Re: [RFH / Patch] PR 20140

2012-01-02 Thread Paolo Carlini
On 01/02/2012 04:06 PM, Jason Merrill wrote: On 01/02/2012 08:25 AM, Paolo Carlini wrote: Bad, because currently many circumstances in which we do TREE_TYPE (init) = type are in fact benign: I don't think they are benign. Even when types are equivalent, we need to convert between them, as

[RFH / Patch] PR 20140

2012-01-01 Thread Paolo Carlini
Hi, I'm trying to do something about this old PR, which I find rather disturbing: I see what's going wrong - and shouldn't be too hard to fix, but I'd like to have help on the appropriate way to actually do it. We have this kind of snippet: templatetypename T void foo() { unsigned char

Re: [RFH / Patch] PR 20140

2012-01-01 Thread Jason Merrill
On 01/01/2012 08:10 PM, Paolo Carlini wrote: The analysis is confirmed by the fact that the rather heavy handed patchlet which I'm attaching, which uses copy_node to avoid the corruption, works. How do we normally handle this kind of situation? In most cases, trees are unshared at

Re: [RFH / Patch] PR 20140

2012-01-01 Thread Paolo Carlini
On 01/02/2012 02:49 AM, Jason Merrill wrote: On 01/01/2012 08:10 PM, Paolo Carlini wrote: The analysis is confirmed by the fact that the rather heavy handed patchlet which I'm attaching, which uses copy_node to avoid the corruption, works. How do we normally handle this kind of situation? In