Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ken Werner <ken@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Subject: [patch] OpenCL bool size fix
Date: Tue, 15 Feb 2011 18:59:00 -0000	[thread overview]
Message-ID: <201102151957.09249.ken@linux.vnet.ibm.com> (raw)

[-- Attachment #1: Type: Text/Plain, Size: 131 bytes --]

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

[-- Attachment #2: opencl-bool.patch --]
[-- Type: text/x-patch, Size: 1977 bytes --]

gdb/ChangeLog

2011-02-15  Ken Werner  <ken.werner@de.ibm.com>

	* 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  <ken.werner@de.ibm.com>

	* 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"

             reply	other threads:[~2011-02-15 18:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 18:59 Ken Werner [this message]
2011-02-15 20:01 ` Ulrich Weigand
2011-02-15 20:44   ` Ken Werner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102151957.09249.ken@linux.vnet.ibm.com \
    --to=ken@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox