[Bug middle-end/53959] [4.8 Regression] 189.lucas in SPEC CPU 2000 miscompiled by LTO

2012-07-19 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53959

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2012-07-19 13:59:45 
UTC ---
Fixed.


[Bug middle-end/53959] [4.8 Regression] 189.lucas in SPEC CPU 2000 miscompiled by LTO

2012-07-16 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53959

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-07-16
   Target Milestone|--- |4.8.0
 Ever Confirmed|0   |1

--- Comment #2 from Richard Guenther rguenth at gcc dot gnu.org 2012-07-16 
09:46:29 UTC ---
Probably a dup.


[Bug middle-end/53959] [4.8 Regression] 189.lucas in SPEC CPU 2000 miscompiled by LTO

2012-07-16 Thread hjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53959

--- Comment #3 from hjl at gcc dot gnu.org hjl at gcc dot gnu.org 2012-07-16 
12:35:16 UTC ---
Author: hjl
Date: Mon Jul 16 12:35:10 2012
New Revision: 189528

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=189528
Log:
Restore type attribute comparison

PR middle-end/53959
PR bootstrap/53963
* gimple.c (gimple_types_compatible_p_1): Restore type attribute
comparison.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple.c


[Bug middle-end/53959] [4.8 Regression] 189.lucas in SPEC CPU 2000 miscompiled by LTO

2012-07-14 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53959

--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-07-14 20:31:49 
UTC ---
Created attachment 27791
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=27791
A testcase

With this patch:

diff --git a/gcc/gimple.c b/gcc/gimple.c
index b419591..988a0aa 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3391,6 +3391,7 @@ gimple_types_compatible_p_1 (tree t1, tree t2,
type_pair_t p,
  struct obstack *sccstate_obstack)
 {
   struct sccs *state;
+  bool foo = true; 

   gcc_assert (p-same_p[GTC_MERGE] == -2);

@@ -3422,6 +3423,10 @@ gimple_types_compatible_p_1 (tree t1, tree t2,
type_pair_t p,
 goto different_types;
 }

+  /* If their attributes are not the same they can't be the same type.  */
+  if (!attribute_list_equal (TYPE_ATTRIBUTES (t1), TYPE_ATTRIBUTES (t2)))
+foo = false;
+
   /* Do type-specific comparisons.  */
   switch (TREE_CODE (t1))
 {
@@ -3660,6 +3665,9 @@ different_types:

   /* Common exit path for types that are compatible.  */
 same_types:
+  if (!foo)
+gcc_unreachable ();
+
   gcc_assert (state-u.same_p == 1);

 pop:

I got

[hjl@gnu-32 gcc]$ ./lto1 -quiet -dumpbase lucas_distrib_spec.o -mtune=generic
-march=x86-64 -mtune=generic -march=x86-64 -auxbase lucas_distrib_spec -O2
-version -ffast-math -fwhole-program -fuse-linker-plugin
-fltrans-output-list=/tmp/cc4kxuMN.ltrans.out -fwpa -fresolution=foo.res @foo
GNU GIMPLE (GCC) version 4.8.0 20120713 (experimental)
(x86_64-unknown-linux-gnu)
compiled by GNU C version 4.7.1 20120629 (Red Hat 4.7.1-1), GMP version
5.0.2, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU GIMPLE (GCC) version 4.8.0 20120713 (experimental)
(x86_64-unknown-linux-gnu)
compiled by GNU C version 4.7.1 20120629 (Red Hat 4.7.1-1), GMP version
5.0.2, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
lto1: internal compiler error: in gimple_types_compatible_p_1, at gimple.c:3669
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
[hjl@gnu-32 gcc]$