This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix out-of-bound array accesses in testcases


So, a patch of mine runs into the following testsuite issues.  Fixed
with the following patch, tested on x86_64-unknown-linux-gnu and
committed.

Richard.

2012-04-18  Richard Guenther  <rguenther@suse.de>

	* gcc.target/x86_64/abi/test_passing_unions.c: Avoid undefined
	array access.
	* gcc.target/x86_64/abi/test_passing_structs.c: Likewise.
	* gcc.target/i386/avx256-unaligned-load-4.c: Fix array sizes.

Index: gcc/testsuite/gcc.target/x86_64/abi/test_passing_unions.c
===================================================================
*** gcc/testsuite/gcc.target/x86_64/abi/test_passing_unions.c	(revision 186528)
--- gcc/testsuite/gcc.target/x86_64/abi/test_passing_unions.c	(working copy)
*************** main (void)
*** 206,212 ****
    for (i = 0; i < 8; i++)
      {
        u4[i].x = (__m128){32+i, 0, i, 0};
!       fregs.xmm0._m128[i] = u4[i].x;
      }
    num_fregs = 8;
    clear_float_hardware_registers;
--- 206,212 ----
    for (i = 0; i < 8; i++)
      {
        u4[i].x = (__m128){32+i, 0, i, 0};
!       (&fregs.xmm0)[i]._m128[0] = u4[i].x;
      }
    num_fregs = 8;
    clear_float_hardware_registers;
Index: gcc/testsuite/gcc.target/x86_64/abi/test_passing_structs.c
===================================================================
*** gcc/testsuite/gcc.target/x86_64/abi/test_passing_structs.c	(revision 186528)
--- gcc/testsuite/gcc.target/x86_64/abi/test_passing_structs.c	(working copy)
*************** main (void)
*** 216,222 ****
    for (i = 0; i < 8; i++)
      {
        m128s[i].x = (__m128){32+i, 0, i, 0};
!       fregs.xmm0._m128[i] = m128s[i].x;
      }
    num_fregs = 8;
    clear_float_hardware_registers;
--- 216,222 ----
    for (i = 0; i < 8; i++)
      {
        m128s[i].x = (__m128){32+i, 0, i, 0};
!       (&fregs.xmm0)[i]._m128[0] = m128s[i].x;
      }
    num_fregs = 8;
    clear_float_hardware_registers;
Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c
===================================================================
*** gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c	(revision 186528)
--- gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c	(working copy)
***************
*** 3,9 ****
  
  #define N 1024
  
! float a[N], b[N+3];
  
  void
  avx_test (void)
--- 3,9 ----
  
  #define N 1024
  
! float a[N+3], b[N];
  
  void
  avx_test (void)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]