[google]: test case fixes (issue4553055)

David Li davidxl@google.com
Sun May 22 16:09:00 GMT 2011


Due to the inliner change (in google/main), a couple of test cases under
gcc.dg/matrix starts to fail (ICE in matrix reorg). The problem can be
reproduced in gcc46 with increases inline limit (but not in trunk -- the
problem is either fixed or inline behavior is still different). The following
workaround will be checked in to google/main. Along with the patch is a change
in LIPO. When forming the name for local labels in function, to avoid conflict,
both module id and funcdef_no is used. The new change increase one bit to 
allow more functions (256k funcs per module), and a total of 16k modules -- we saw
cases where funcdef_no is greater than 128k in a module leading to overflow and
conflict.

2011-05-21  David Li  <davidxl@google.com>

	* testsuite/gcc.dg/matrix/transpose-1.c: Do not inline mem_init.
	* testsuite/gcc.dg/matrix/transpose-2.c: Ditto.
	* testsuite/gcc.dg/matrix/transpose-3.c: Ditto.
	* testsuite/gcc.dg/matrix/transpose-4.c: Ditto.
	* testsuite/gcc.dg/matrix/transpose-5.c: Ditto.
	* testsuite/gcc.dg/matrix/transpose-6.c: Ditto.

Index: function.h
===================================================================
--- function.h	(revision 174024)
+++ function.h	(working copy)
@@ -673,7 +673,7 @@ struct GTY(()) function {
   GEN_FUNC_GLOBAL_ID (FUNC_DECL_MODULE_ID (func), FUNC_DECL_FUNC_ID (func))
 /* 32 bit wide unique id used for asm label (limit: 30k modules,
    128k funcs per module.  */
-#define FUNC_LABEL_ID(func) ((FUNC_DECL_MODULE_ID (func) << 17) +\
+#define FUNC_LABEL_ID(func) ((FUNC_DECL_MODULE_ID (func) << 18) +\
                              (func)->funcdef_no)
 
 /* Add the decl D to the local_decls list of FUN.  */
Index: testsuite/gcc.dg/matrix/transpose-1.c
===================================================================
--- testsuite/gcc.dg/matrix/transpose-1.c	(revision 174024)
+++ testsuite/gcc.dg/matrix/transpose-1.c	(working copy)
@@ -52,7 +52,7 @@ main (int argc, char **argv)
 /*--------------------------------------------------------------------------*/
 /* Dynamic memory allocations and initializations                           */
 
-void
+__attribute__((noinline)) void
 mem_init (void)
 {
 
@@ -95,4 +95,3 @@ mem_init (void)
 /* { dg-final-use { scan-ipa-dump-times "Flattened 3 dimensions" 1 "matrix-reorg"  } } */
 /* { dg-final-use { scan-ipa-dump-times "Transposed" 3 "matrix-reorg"  } } */
 /* { dg-final-use { cleanup-ipa-dump "matrix-reorg" } } */
-
Index: testsuite/gcc.dg/matrix/transpose-2.c
===================================================================
--- testsuite/gcc.dg/matrix/transpose-2.c	(revision 174024)
+++ testsuite/gcc.dg/matrix/transpose-2.c	(working copy)
@@ -50,7 +50,7 @@ main (int argc, char **argv)
 /*--------------------------------------------------------------------------*/
 /* Dynamic memory allocations and initializations                           */
 
-void
+__attribute__((noinline)) void
 mem_init (void)
 {
 
Index: testsuite/gcc.dg/matrix/transpose-3.c
===================================================================
--- testsuite/gcc.dg/matrix/transpose-3.c	(revision 174024)
+++ testsuite/gcc.dg/matrix/transpose-3.c	(working copy)
@@ -54,7 +54,7 @@ main (int argc, char **argv)
 /*--------------------------------------------------------------------------*/
 /* Dynamic memory allocations and initializations                           */
 
-void
+__attribute__((noinline)) void
 mem_init (void)
 {
 
Index: testsuite/gcc.dg/matrix/transpose-4.c
===================================================================
--- testsuite/gcc.dg/matrix/transpose-4.c	(revision 174024)
+++ testsuite/gcc.dg/matrix/transpose-4.c	(working copy)
@@ -52,7 +52,7 @@ main (int argc, char **argv)
 /*--------------------------------------------------------------------------*/
 /* Dynamic memory allocations and initializations                           */
 
-void
+__attribute__((noinline)) void
 mem_init (void)
 {
 
Index: testsuite/gcc.dg/matrix/transpose-5.c
===================================================================
--- testsuite/gcc.dg/matrix/transpose-5.c	(revision 174024)
+++ testsuite/gcc.dg/matrix/transpose-5.c	(working copy)
@@ -49,7 +49,7 @@ main (int argc, char **argv)
 /*--------------------------------------------------------------------------*/
 /* Dynamic memory allocations and initializations                           */
 
-void
+__attribute__((noinline)) void
 mem_init (void)
 {
 
Index: testsuite/gcc.dg/matrix/transpose-6.c
===================================================================
--- testsuite/gcc.dg/matrix/transpose-6.c	(revision 174024)
+++ testsuite/gcc.dg/matrix/transpose-6.c	(working copy)
@@ -49,7 +49,7 @@ main (int argc, char **argv)
 /*--------------------------------------------------------------------------*/
 /* Dynamic memory allocations and initializations                           */
 
-void
+__attribute__((noinline)) void
 mem_init (void)
 {
 

--
This patch is available for review at http://codereview.appspot.com/4553055



More information about the Gcc-patches mailing list