[Patch, RFC] PR90903 - Implement runtime checks for bit manipulation intrinsics

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Patch, RFC] PR90903 - Implement runtime checks for bit manipulation intrinsics

Harald Anlauf-3
Dear all,

the attached draft is my first attempt at implementing runtime checks
for some of the bit manipulation intrinsics.  It is in an early stage,
and I am soliciting feedback and suggestions for possible improvements:

- some intrinsics are using a common function for code generation.
  Is there a way to get the "original" name of the invoking intrinsic?

- is there a way to produce a column information for the SHIFT or POS
  argument?

- for the testsuite, what would be an appropriate coverage, and how
  can one achieve that without writing really many separate "failing"
  testcases?

Thanks,
Harald

patch-pr90903 (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Patch, RFC] PR90903 - Implement runtime checks for bit manipulation intrinsics

Steve Kargl
On Wed, Jun 19, 2019 at 11:32:07PM +0200, Harald Anlauf wrote:
>
> the attached draft is my first attempt at implementing runtime checks
> for some of the bit manipulation intrinsics.  It is in an early stage,
> and I am soliciting feedback and suggestions for possible improvements:
>
> - some intrinsics are using a common function for code generation.
>   Is there a way to get the "original" name of the invoking intrinsic?

If you have an expr, you should be able to do

expr->value.function.isym->name

> - is there a way to produce a column information for the SHIFT or POS
>   argument?

Do you mean the error locus to point at the offending argument?
You might be able to grab that from

expr->value.function.actual->expr
expr->value.function.actual->expr->next

etc.

> - for the testsuite, what would be an appropriate coverage, and how
>   can one achieve that without writing really many separate "failing"
>   testcases?

I haven't written a testcase for a runtime error, so can only
guess here.  I suspect you need a test for each of the possible
errors you are adding.  Whether this is one file per test or
multiple tests in one file, I don't know.

--
steve