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]

Fix PR48622 (lto ICE, lto bootstrap)


Hi,

since r172430 lto bootstrap is broken, as well as the attached testcase 
(pr48622) and cpu2006 compilation (pr48645).  The inline summary writer 
used a different order for size and time than the reader expected.

I've committed the below patch as obvious (r172603) after verifying that 
lto bootstrap passes the place of the ICE (and that the testcase is 
fixed).


Ciao,
Michael.

	PR tree-optimization/48622
	PR lto/48645
	* ipa-inline-analysis.c (inline_read_summary): Read size/time
	in same order as they're written.

testsuite/
	* gcc.dg/lto/pr48622_0.c: New test.

Index: ipa-inline-analysis.c
===================================================================
--- ipa-inline-analysis.c	(Revision 172602)
+++ ipa-inline-analysis.c	(Arbeitskopie)
@@ -612,10 +612,10 @@ inline_read_summary (void)
 
 	      info->estimated_stack_size
 	        = info->estimated_self_stack_size = lto_input_uleb128 (ib);
-	      info->time = info->self_time = lto_input_uleb128 (ib);
-	      info->time_inlining_benefit = lto_input_uleb128 (ib);
 	      info->size = info->self_size = lto_input_uleb128 (ib);
 	      info->size_inlining_benefit = lto_input_uleb128 (ib);
+	      info->time = info->self_time = lto_input_uleb128 (ib);
+	      info->time_inlining_benefit = lto_input_uleb128 (ib);
 	      info->estimated_growth = INT_MIN;
 
 	      bp = lto_input_bitpack (ib);
Index: testsuite/gcc.dg/lto/pr48622_0.c
===================================================================
--- testsuite/gcc.dg/lto/pr48622_0.c	(Revision 0)
+++ testsuite/gcc.dg/lto/pr48622_0.c	(Revision 0)
@@ -0,0 +1,93 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O -flto -finline-small-functions -fno-early-inlining}} } */
+
+void abort(void);
+void exit(int);
+
+typedef unsigned int u8 __attribute__ ((mode (QI)));
+
+u8
+ashift_qi_0 (u8 n)
+{
+}
+
+u8
+ashift_qi_2 (u8 n)
+{
+}
+
+u8
+ashift_qi_3 (u8 n)
+{
+}
+
+u8
+ashift_qi_4 (u8 n)
+{
+}
+
+u8
+ashift_qi_5 (u8 n)
+{
+}
+
+u8
+ashift_qi_6 (u8 n)
+{
+}
+
+u8
+ashift_qi_7 (u8 n)
+{
+}
+
+u8
+lshiftrt_qi_0 (u8 n)
+{
+}
+
+u8
+lshiftrt_qi_4 (u8 n)
+{
+}
+
+u8
+lshiftrt_qi_5 (u8 n)
+{
+}
+
+u8
+lshiftrt_qi_7 (u8 n)
+{
+}
+
+int
+main ()
+{
+  if (ashift_qi_0 (0xff) != (u8) ((u8) 0xff << 0))
+    abort ();
+  if (ashift_qi_1 (0xff) != (u8) ((u8) 0xff << 1))
+    abort ();
+  if (ashift_qi_2 (0xff) != (u8) ((u8) 0xff << 2))
+    abort ();
+  if (ashift_qi_3 (0xff) != (u8) ((u8) 0xff << 3))
+    abort ();
+  if (ashift_qi_4 (0xff) != (u8) ((u8) 0xff << 4))
+    abort ();
+  if (ashift_qi_5 (0xff) != (u8) ((u8) 0xff << 5))
+    abort ();
+  if (ashift_qi_6 (0xff) != (u8) ((u8) 0xff << 6))
+    abort ();
+  if (ashift_qi_7 (0xff) != (u8) ((u8) 0xff << 7))
+    abort ();
+  if (lshiftrt_qi_0 (0xff) != (u8) ((u8) 0xff >> 0))
+    abort ();
+  if (lshiftrt_qi_4 (0xff) != (u8) ((u8) 0xff >> 4))
+    abort ();
+  if (lshiftrt_qi_5 (0xff) != (u8) ((u8) 0xff >> 5))
+    abort ();
+  if (lshiftrt_qi_7 (0xff) != (u8) ((u8) 0xff >> 7))
+    abort ();
+  exit (0);
+}
+


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