confused on xfail in pr41353-1.c by guality.exp

陈龙 18116491546@163.com
Fri Jul 12 08:42:00 GMT 2019


Hi,

 

The pr41353-1.c  case had confused me a long time. I have been looking for the answer with any ways I can but no satisfied consequence for me . So appreciate the support very much.  Details as below:

 

Environment:

 

windows7, MinGW, gcc7.3.0 test suite, DejaGNU1.6

 

Relative code(/gcc/testsuite/gcc.dg/guality/pr41353.c):

 

__attribute__((noinline)) int

f2 (int i, int j)

{

  j += i;

  /* { dg-final { gdb-test 28 "i" "37" } } */

  /* { dg-final { gdb-test 28 "j" "28 + 37" { xfail *-*-* } } } */

  int i1 = 2 * i; /* { dg-final { gdb-test 28 "i1" "2 * 37" } } */

  int i2 = 3 * i; /* { dg-final { gdb-test 28 "i2" "3 * 37" } } */

  return j;

}

 

int (*volatile fnp1) (void) = f1;

int (*volatile fnp2) (int, int) = f2;

int (*volatile fnp3) (int) = f3;

 

int

main (int argc, char *argv[])

{

  asm volatile ("" : : "r" (&fnp1) : "memory");

  asm volatile ("" : : "r" (&fnp2) : "memory");

  asm volatile ("" : : "r" (&fnp3) : "memory");

  fnp1 ();

  fnp2 (37, 28);

  fnp3 (12);

  return 0;

}

 

LOG:

Closing the remote shell exp8

doing kill, pid is 10568

pid is 10568

Shell closed.

replacement dg-process-target: `{ xfail *-*-* }'

dg-process-target-1: `{xfail *-*-*}'

Checking "*-*-*" against "i686-w64-mingw32"

Spawning: gdb -nx -nw -quiet -batch -x pr41353-1.gdb ./pr41353-1.exe

spawning command gdb -nx -nw -quiet -batch -x pr41353-1.gdb ./pr41353-1.exe

spawn gdb -nx -nw -quiet -batch -x pr41353-1.gdb ./pr41353-1.exe

Breakpoint 1 at 0x4015d8: file ././gcc.dg/guality/pr41353-1.c, line 28.

[New Thread 7492.0x25c8]

 

Breakpoint 1, f2 (i=37, j=65) at ././gcc.dg/guality/pr41353-1.c:29

29           }

$1 = 65

$2 = 65

A debugging session is active.

 

                Inferior 1 [process 7492] will be killed.

 

Quit anyway? (y or n) [answered Y; input not from terminal]

XPASS: ./gcc.dg/guality/pr41353-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  line 28 j == 28 + 37

 

 

 

I don‘t understand why the gdb-test 28 "j" "28 + 37" should be failed. I get some explanation from “https://gcc.gnu.org/ml/gcc-patches/2009-09/msg01162.html”, some information was picked up here:

 

the current guality infrastructure isn't useful, because the guality checks involve a function call which invalidates any memory and registers in which arguments are passed, so values can't be expected to be available in many cases.

 

It looks like a bug in version before, the information record in 17-Sep,2009, and the gcc version is 4.5 , so I’m not sure it is right for the case now. Or the bug is fixed but the case don’t modify Synchronously? just an assumption.

 

 

Best regards,

      CL 


More information about the Gcc-testresults mailing list