On Sat, Jul 20, 2013 at 10:19:55AM +0200, Marek Polacek wrote: > On Sat, Jul 20, 2013 at 02:04:24AM -0400, Jason Merrill wrote: > > On 07/19/2013 03:01 PM, Marek Polacek wrote: > > >On Fri, Jul 19, 2013 at 08:50:42PM +0200, Jakub Jelinek wrote: > > >>uintptr_type_node is a C/C++/ObjC/ObjC++ FE tree. So, if you use it just > > >>in c-family/c-ubsan.c, that is just fine, but you can't use it in ubsan.c. > > > > Any reason not to move it into the middle-end? > > I don't know, but it seems iffy to pluck out one particular type of > those supplemented when adding the support of stdint.h types. > We'd have to move all of them into the middle-end (from > c_common_nodes_and_builtins). I'm not sure if it's worth it.
The way uintptr_type_node is constructed relies on C/C++ FE to transform the string "unsigned long int" etc. defined in the target headers to a type, but you can't do that in the middle-end. So, the middle-end can only use some other type, say build_nonstandard_integer_type (POINTER_SIZE, 1); which often will be the same type as uintptr_type_node, but perhaps not on all targets. It could be worth to create such a type in tree.c and stick it into global trees and then just use, but right now all the uses are just in asan.c and ubsan.c. Jakub