[openacc, PR78266, committed] Fix diff_type in expand_oacc_for char iter_type
Tom de Vries
Tom_deVries@mentor.com
Mon Aug 7 17:20:00 GMT 2017
Hi,
this fixes PR78266, an openacc PR.
When compiling a gang loop with an iteration variable of type 'unsigned
char' and 256 gangs:
...
#pragma acc parallel loop num_gangs (256)
for (unsigned char j = 0; j < 5; j++)
..
we run into trouble.
The 'diff_type' in expand_oacc_for is set to 'signed char', and we
generate f.i.:
...
_41 = GOACC_DIM_SIZE (0);
_29 = (signed char) _41;
...
where _41 is 256, so forwprop2 folds _29 to '0'.
The patch fixes this by ensuring that diff_type is chosen big enough in
expand_oacc_for.
Tested libgomp on x86_64 with nvptx accelerator.
Committed.
Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-diff_type-in-expand_oacc_for-char-iter_type.patch
Type: text/x-patch
Size: 3405 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170807/3394f474/attachment.bin>
More information about the Gcc-patches
mailing list