Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull recent NVIDIA changes #124

Merged
21 commits merged into from
Jan 28, 2018
Merged

Pull recent NVIDIA changes #124

21 commits merged into from
Jan 28, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jan 28, 2018

No description provided.

tskeith and others added 21 commits January 23, 2018 14:45
with the LLVM from github:flang-compiler/llvm. This permits the
use of the Fortran debug extensions included in that version.
A bind(c) function was having its return type, despite a prototype, being
trampled over because of alternate return handling.
… it is not

passed in uplevel or display struct.
to pass the rank of the object to f90_init_from_desc so
that it can distinguish between the initialization of an
array and the initialization of an array element for which
the entire array's descriptor has been supplied.
…lined

function - no need because we can directly generate the address. Normally local
DINIT or SAVE variable gets put in static memory(.STATICS/.BSS). There are
certain local variables that don't get put in static memory - normally it is
done by back end  If that is so, then PARREF flag needs to be set by front end
so that we can generate the correct address ILI when inside outlined function.
Therefore for all local variables, always PARREF flag. mk_address() should
always be called to get address of variable.
Pull 2018-01-23T17-18 Recent NVIDIA Changes
Use the same binding name as we would without the bind(C), so include the
module name in it. This is done by delaying processing of an explicit empty
bind name until routine process_bind to allow that case to be treated
differently from the implicit empty name case.

Also rearrange the code in routine semant1 to reduce the arbitrary
differences in the cases that process the two main bind attribute
reductions.  The processing for the unnamed variant is a subset of
the processing for the named variant, which is now more apparent
in the code.
Upstream code in routine ref_pd_subr in file semfunc.c changes
a call to the IDATE intrinsic into a user routine call if the
number or type of call arguments are invalid for the intrinsic.
The assert in routine rewrite_func_ast that is triggered due
to a missing definition of nargs is therefore unnecessary,
since the code is only reached when the call arguments have
already been validated.  Deleting the code with the asserts
leaves code for IDATE that is similar to nearby cases for other
intrinsics.
In the Infinity/NaN case, preserve the bottom 32 bits rather than
zeroing them out.
- For a symbol with POINTERG set, get the data type using DDTG(DTYPEG(sptr)).
  This gets the base type of the pointer (double, say), instead of trying to build
  an empty array type, which comes out like '[0 x [0 x double]]'
- When printing out the data value for a pointer, print out 'null'
  if it's a zero value
- Handle data initialization of a pointer in add_init_const_op
Pull 2018-01-24T16-58 Recent NVIDIA Changes
We were passing a constant value to a function argument where we were expecting
a descriptor, which leads to a seg fault. The constant is created in the front
end "transform_call", where we are missing a case here, when there is no member
descriptor, use SDSC instead.
This bug occurs when we have a contiguous pointer to an array section that
is passed to an assumed-shape formal like in this example:
	integer, pointer, contiguous :: p(:,:)
	integer, pointer :: matrix(:,:,:)
	allocate(matrix(...))
	p => matrix(:,:,n)
	call sub(p)

The section descriptor that we create and pass in to the procedure has an
lbase value that represents the distance from the start of the array to the
start of the section that the pointer represents.

When we pass in the address of the first element that p points to, that
distance is included in the pointer. So combined with the lbase offset in
the descriptor we end up indexing too far into the array (or past the end).

To fix this we need to either adjust the descriptor or pass in the address
of the array instead of the first element of the section. This fix does the
latter.
Pull 2018-01-25T12-01 Recent NVIDIA Changes
@ghost ghost merged commit 9158963 into isuruf:windows Jan 28, 2018
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants