Skip to content

Commit

Permalink
Use SC_PRIVATE for temp in OMP parallel region.
Browse files Browse the repository at this point in the history
In get_array_temp() we always make the storage class of arrays temps be SC_LOCAL.
If it is in an OMP parallel region, sem.sc is SC_PRIVATE and we should
not change it.
  • Loading branch information
tskeith committed Jan 9, 2018
1 parent 43d644e commit 0bf39c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/flang1/flang1exe/semutil2.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1994-2017, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 1994-2018, NVIDIA CORPORATION. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -7366,7 +7366,7 @@ get_arr_temp(DTYPE dtype, LOGICAL nodesc, LOGICAL alloc_deferred)
* o the size is not constant.
*
* If an allocatable temp is needed, its storage class is always
* SC_LOCAL.
* SC_LOCAL or SC_PRIVATE.
*/
needalloc = 0;
if (ADD_DEFER(dtype)) {
Expand All @@ -7388,7 +7388,7 @@ get_arr_temp(DTYPE dtype, LOGICAL nodesc, LOGICAL alloc_deferred)
}
}
}
if (needalloc)
if (needalloc && sc != SC_PRIVATE)
sc = SC_LOCAL;

do {
Expand Down

0 comments on commit 0bf39c8

Please sign in to comment.