This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] integer overflow checking builtins in constant expressions


+	{
+	  tree type = TREE_TYPE (TREE_TYPE (t));
+	  tree vflow = arith_overflowed_p (opcode, type, arg0, arg1)
+	               ? integer_one_node : integer_zero_node;

This looks incorrect, the return type is TREE_TYPE (t), some complex integer
type, therefore vflow needs to be
       tree vflow = build_int_cst (TREE_TYPE (TREE_TYPE (t)),
				  arith_overflowed_p (opcode, type, arg0, arg1)
				  ? 1 : 0);
no?

I guess it didn't think it mattered since the complex type specifies
the types of the two members.  I don't mind changing it if it does
but I'd like to have a test case to go with it.  Maybe Jason can
help with that.

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]