Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] OpenCL bool size fix
@ 2011-02-15 18:59 Ken Werner
  2011-02-15 20:01 ` Ulrich Weigand
  0 siblings, 1 reply; 3+ messages in thread
From: Ken Werner @ 2011-02-15 18:59 UTC (permalink / raw)
  To: gdb-patches

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] OpenCL bool size fix
  2011-02-15 18:59 [patch] OpenCL bool size fix Ken Werner
@ 2011-02-15 20:01 ` Ulrich Weigand
  2011-02-15 20:44   ` Ken Werner
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weigand @ 2011-02-15 20:01 UTC (permalink / raw)
  To: Ken Werner; +Cc: gdb-patches

Ken Werner wrote:

> 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.

This is OK.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] OpenCL bool size fix
  2011-02-15 20:01 ` Ulrich Weigand
@ 2011-02-15 20:44   ` Ken Werner
  0 siblings, 0 replies; 3+ messages in thread
From: Ken Werner @ 2011-02-15 20:44 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

On Tuesday, February 15, 2011 8:58:19 pm Ulrich Weigand wrote:
> Ken Werner wrote:
> > 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.
> 
> This is OK.

Thanks, patch applied:
http://sourceware.org/ml/gdb-cvs/2011-02/msg00099.html

Regards
Ken


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-15 20:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-15 18:59 [patch] OpenCL bool size fix Ken Werner
2011-02-15 20:01 ` Ulrich Weigand
2011-02-15 20:44   ` Ken Werner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox