> Hi,

Hi Honggyu,
Thanks for helping out. I've got a couple of pointers for the testcase
inline.

> 
> I have wrote a testcase that reproduces argument overwriting bug during
> arm code generation.
> 
> I wrote this testcase with the help of Mikael Pettersson.
> If some format is not proper to run in gcc testsuite framework, please
correct
> me.
> 
> Please refer to the following bugzilla link for details:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65358
> 
> Honggyu
> ---
>  gcc/testsuite/ChangeLog                |    5 +++++
>  gcc/testsuite/gcc.target/arm/pr65358.c |   34
> ++++++++++++++++++++++++++++++++
>  2 files changed, 39 insertions(+)
>  create mode 100644 gcc/testsuite/gcc.target/arm/pr65358.c
> 
> diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index
> 5302dbd..9acd12a 100644
> --- a/gcc/testsuite/ChangeLog
> +++ b/gcc/testsuite/ChangeLog
> @@ -1,3 +1,8 @@
> +2015-03-13  Honggyu Kim  <hong.gyu....@lge.com>
> +
> +     PR target/65235
> +     * gcc.target/arm/pr65358.c: New test for sibcall argument passing
> bug.

Just 'New test.' for the entry should be enough, but it's not a big deal.

> +
>  2015-03-12  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>
> 
>       PR rtl-optimization/65235
> diff --git a/gcc/testsuite/gcc.target/arm/pr65358.c
> b/gcc/testsuite/gcc.target/arm/pr65358.c
> new file mode 100644
> index 0000000..d663dcf
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/arm/pr65358.c
> @@ -0,0 +1,34 @@
> +/* PR target/65358 */
> +/* { dg-do compile { target arm*-*-* } } */

No need for the target selector. The fact that it's in gcc.target/arm
already
means it will only be run for the arm targets.
Also, the bug is exposed at runtime, so this should be a dg-do run test.

Cheers,
Kyrill

> +/* { dg-options "-O2" } */
> +
> +struct pack
> +{
> +  int fine;
> +  int victim;
> +  int killer;
> +};
> +
> +int __attribute__ ((__noinline__, __noclone__)) bar (int a, int b,
> +struct pack p) {
> +  if (a != 20 || b != 30)
> +    __builtin_abort ();
> +  if (p.fine != 40 || p.victim != 50 || p.killer != 60)
> +    __builtin_abort ();
> +  return 0;
> +}
> +
> +int __attribute__ ((__noinline__, __noclone__)) foo (int arg1, int
> +arg2, int arg3, struct pack p) {
> +  return bar (arg2, arg3, p);
> +}
> +
> +int main (void)
> +{
> +  struct pack p = { 40, 50, 60 };
> +
> +  (void) foo (10, 20, 30, p);
> +  return 0;
> +}
> --
> 1.7.9.5
> 




Reply via email to