From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14678 invoked by alias); 15 Feb 2011 18:57:18 -0000 Received: (qmail 14669 invoked by uid 22791); 15 Feb 2011 18:57:18 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate2.uk.ibm.com (HELO mtagate2.uk.ibm.com) (194.196.100.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Feb 2011 18:57:13 +0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p1FIvAeT004642 for ; Tue, 15 Feb 2011 18:57:10 GMT Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1FIvG7k1958096 for ; Tue, 15 Feb 2011 18:57:16 GMT Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p1FIvAlk004567 for ; Tue, 15 Feb 2011 11:57:10 -0700 Received: from leonard.localnet (dyn-9-152-224-51.boeblingen.de.ibm.com [9.152.224.51]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p1FIvAxg004556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 15 Feb 2011 11:57:10 -0700 From: Ken Werner To: gdb-patches@sourceware.org Subject: [patch] OpenCL bool size fix Date: Tue, 15 Feb 2011 18:59:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-25-generic-pae; KDE/4.5.1; i686; ; ) MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_FysWNlepuy1ugqR" Message-Id: <201102151957.09249.ken@linux.vnet.ibm.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-02/txt/msg00333.txt.bz2 --Boundary-00=_FysWNlepuy1ugqR Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-length: 131 Hi, The attached patch changes built-in OpenCL bool data type to a size of one byte (instead of four). Ok to apply? Regards Ken --Boundary-00=_FysWNlepuy1ugqR Content-Type: text/x-patch; charset="UTF-8"; name="opencl-bool.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="opencl-bool.patch" Content-length: 1977 gdb/ChangeLog 2011-02-15 Ken Werner * opencl-lang.c (build_opencl_types): Set the size of the built-in bool data type to a size of one byte. gdb/testsuite/ChangeLog 2011-02-15 Ken Werner * gdb.opencl/datatypes.exp: Expect the size of a bool to be one byte. Index: gdb/opencl-lang.c =================================================================== RCS file: /cvs/src/src/gdb/opencl-lang.c,v retrieving revision 1.5 diff -p -u -r1.5 opencl-lang.c --- gdb/opencl-lang.c 2 Feb 2011 13:47:06 -0000 1.5 +++ gdb/opencl-lang.c 15 Feb 2011 18:51:17 -0000 @@ -1172,7 +1172,7 @@ build_opencl_types (struct gdbarch *gdba = arch_float_type (gdbarch, 64, "double", floatformats_ieee_double); BUILD_OCL_VTYPES (double); builtin_opencl_type->builtin_bool - = arch_boolean_type (gdbarch, 32, 1, "bool"); + = arch_boolean_type (gdbarch, 8, 1, "bool"); builtin_opencl_type->builtin_unsigned_char = arch_integer_type (gdbarch, 8, 1, "unsigned char"); builtin_opencl_type->builtin_unsigned_short Index: gdb/testsuite/gdb.opencl/datatypes.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.opencl/datatypes.exp,v retrieving revision 1.4 diff -p -u -r1.4 datatypes.exp --- gdb/testsuite/gdb.opencl/datatypes.exp 31 Jan 2011 19:05:23 -0000 1.4 +++ gdb/testsuite/gdb.opencl/datatypes.exp 15 Feb 2011 18:51:17 -0000 @@ -44,7 +44,7 @@ gdb_test_no_output "set language opencl" # Check OpenCL data types (GDB) gdb_test "whatis bool" "type = bool" -gdb_test "p sizeof(bool)" " = 4" +gdb_test "p sizeof(bool)" " = 1" gdb_test "whatis char" "type = char" gdb_test "p sizeof(char)" " = 1" @@ -229,7 +229,7 @@ set have_cl_khr_fp16 [get_integer_valueo # Check OpenCL data types (DWARF) gdb_test "whatis b" "type = bool" -gdb_test "p sizeof(b)" " = 4" +gdb_test "p sizeof(b)" " = 1" gdb_test "print b" " = 0" gdb_test "whatis c" "type = char" --Boundary-00=_FysWNlepuy1ugqR--