------- Comment #3 from dodji at gcc dot gnu dot org  2008-08-12 14:42 -------
Created an attachment (id=16058)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16058&action=view)
primary candidate fix

This minimal patch fixes the problem for me and regtests on x86_64.

I have some questions though and would like to have you guys comments, if
possible.

My understanding is that the parameter of the new operator being size_t, its
type should represented in GENERIC using an integer that is not signed.

The issue here is that the type of the parameter of the new operator has the
same time as 'sizetype', which has its flag TYPE_IS_SIZETYPE set.

When TYPE_IS_SIZETYPE is set on an integer, some type checking machinery
consider that integer to be signed. So the the representation of that integer
is sign extended.

So a quick fix was to make sure the type of the parameter of the new operator
has the same time as 'size_type_node', instead of 'sizetype'.

Maybe there is a better way of solving this.

Also, maybe I should modify the other uses of 'sizetype' in the build_new_1()
function and replace them with "size_type_node' instead. But that's maybe out
of the strict scope of this bug. I am not sure.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36741

Reply via email to