public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix PR48622 (lto ICE, lto bootstrap)
@ 2011-04-17  7:31 Michael Matz
  2011-04-17 10:55 ` Jan Hubicka
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Matz @ 2011-04-17  7:31 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jan Hubicka

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);
+}
+

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix PR48622 (lto ICE, lto bootstrap)
  2011-04-17  7:31 Fix PR48622 (lto ICE, lto bootstrap) Michael Matz
@ 2011-04-17 10:55 ` Jan Hubicka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Hubicka @ 2011-04-17 10:55 UTC (permalink / raw)
  To: Michael Matz, gcc-patches

> 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).

Oops, thanks!  I wonder why this did not wreck the LTO benchmark results though ;)

Honza

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-17 10:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-17  7:31 Fix PR48622 (lto ICE, lto bootstrap) Michael Matz
2011-04-17 10:55 ` Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).