This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: New type-based pool allocator code miscompiled due to aliasing issue?
- From: Jakub Jelinek <jakub at redhat dot com>
- To: pinskia at gmail dot com
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "mliska at suse dot cz" <mliska at suse dot cz>, "law at redhat dot com" <law at redhat dot com>
- Date: Thu, 11 Jun 2015 19:50:36 +0200
- Subject: Re: New type-based pool allocator code miscompiled due to aliasing issue?
- Authentication-results: sourceware.org; auth=none
- References: <20150611165115 dot E278EEDC at oc7340732750 dot ibm dot com> <60B0A9AA-8E0A-4538-8950-46224E08F1EA at gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jun 12, 2015 at 12:58:12AM +0800, pinskia@gmail.com wrote:
> This is just a bug in the older compiler. There was a change to fix in
> placement new operator. I can't find the reference right now but this is
> the same issue as that.
I'm not claiming 4.1 is aliasing bug free, there are various known issues in
it. But, is that the case here?
empty_var = onepart_pool (onepart).allocate ();
empty_var->dv = dv;
empty_var->refcount = 1;
empty_var->n_var_parts = 0;
doesn't really seem to use operator new at all, so I'd say the bug is in
all the spots that call allocate () method of the pool, but don't really
use operator new.
Jakub