public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/42020]  New: field not merged causes cc1 to be miscompiled
@ 2009-11-12 17:05 espindola at gcc dot gnu dot org
  2009-11-12 17:05 ` [Bug lto/42020] " espindola at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: espindola at gcc dot gnu dot org @ 2009-11-12 17:05 UTC (permalink / raw)
  To: gcc-bugs

Reducing a cc1 miscompilation when using lto I noticed that the problem was
nonoverlapping_component_refs_p returning true because we had two different
field_decls for the succs field in basic_block.

Rich asked me to put an assert that the field is being merged and reduce more
using that assert.

To reproduce the issue:

*) patch gcc to add the assert
*) cc1 -quiet -O2 -flto cfgrtl.i -o cfgrtl.s
*) as cfgrtl.s -o cfgrtl.o
*) lto1 -quiet  -O2  cfgrtl.o -o foo.s


-- 
           Summary: field not merged causes cc1 to be miscompiled
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: espindola at gcc dot gnu dot org
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42020


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

* [Bug lto/42020] field not merged causes cc1 to be miscompiled
  2009-11-12 17:05 [Bug lto/42020] New: field not merged causes cc1 to be miscompiled espindola at gcc dot gnu dot org
@ 2009-11-12 17:05 ` espindola at gcc dot gnu dot org
  2009-11-12 17:06 ` espindola at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: espindola at gcc dot gnu dot org @ 2009-11-12 17:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from espindola at gcc dot gnu dot org  2009-11-12 17:05 -------
Created an attachment (id=19005)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19005&action=view)
testcase


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42020


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

* [Bug lto/42020] field not merged causes cc1 to be miscompiled
  2009-11-12 17:05 [Bug lto/42020] New: field not merged causes cc1 to be miscompiled espindola at gcc dot gnu dot org
  2009-11-12 17:05 ` [Bug lto/42020] " espindola at gcc dot gnu dot org
@ 2009-11-12 17:06 ` espindola at gcc dot gnu dot org
  2009-11-12 17:52 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: espindola at gcc dot gnu dot org @ 2009-11-12 17:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from espindola at gcc dot gnu dot org  2009-11-12 17:05 -------
Created an attachment (id=19006)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19006&action=view)
testcase


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42020


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

* [Bug lto/42020] field not merged causes cc1 to be miscompiled
  2009-11-12 17:05 [Bug lto/42020] New: field not merged causes cc1 to be miscompiled espindola at gcc dot gnu dot org
  2009-11-12 17:05 ` [Bug lto/42020] " espindola at gcc dot gnu dot org
  2009-11-12 17:06 ` espindola at gcc dot gnu dot org
@ 2009-11-12 17:52 ` rguenth at gcc dot gnu dot org
  2009-11-18 10:56 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-12 17:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2009-11-12 17:52 -------
I will have a looksee.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-11-12 17:52:25
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42020


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

* [Bug lto/42020] field not merged causes cc1 to be miscompiled
  2009-11-12 17:05 [Bug lto/42020] New: field not merged causes cc1 to be miscompiled espindola at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-11-12 17:52 ` rguenth at gcc dot gnu dot org
@ 2009-11-18 10:56 ` rguenth at gcc dot gnu dot org
  2009-11-18 16:19 ` espindola at gcc dot gnu dot org
  2009-12-11 15:45 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-18 10:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-11-18 10:55 -------
Hm, the assert doesn't trigger if I add a tem != field check.  In fact I do not
understand the assert you added at all ;)  We do find the correct field, if
that ends up still being the wrong one then DECL_CONTEXT is already wrong
which means we end up not unifying types as we should.

In fact for the testcase both FIELD_DECLs of the two COMPONENT_REFs for
new_bb->succs and bb->succs are the same.

So - did you just not properly reduce the testcase?  The assert to be put
in I suggested would have been

Index: gcc/lto-streamer-in.c
===================================================================
--- gcc/lto-streamer-in.c       (revision 154283)
+++ gcc/lto-streamer-in.c       (working copy)
@@ -1091,8 +1091,8 @@ input_gimple_stmt (struct lto_input_bloc
                  /* In case of type mismatches across units we can fail
                     to unify some types and thus not find a proper
                     field-decl here.  Just do nothing in this case.  */
-                 if (tem != NULL_TREE)
-                   TREE_OPERAND (op, 1) = tem;
+                 gcc_assert (tem != NULL_TREE);
+                 TREE_OPERAND (op, 1) = tem;
                }

              op = TREE_OPERAND (op, 0);

which I probably should re-add under ENABLE_CHECKING at least (I think it
failed somewhere in SPEC though).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42020


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

* [Bug lto/42020] field not merged causes cc1 to be miscompiled
  2009-11-12 17:05 [Bug lto/42020] New: field not merged causes cc1 to be miscompiled espindola at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-11-18 10:56 ` rguenth at gcc dot gnu dot org
@ 2009-11-18 16:19 ` espindola at gcc dot gnu dot org
  2009-12-11 15:45 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: espindola at gcc dot gnu dot org @ 2009-11-18 16:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from espindola at gcc dot gnu dot org  2009-11-18 16:18 -------
(In reply to comment #4)
> Hm, the assert doesn't trigger if I add a tem != field check.  In fact I do not
> understand the assert you added at all ;)

I completely misunderstood the assert you asked for. The testcase was over
reduced because of it.

I am trying a new bootstrap. Lets see what happens.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42020


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

* [Bug lto/42020] field not merged causes cc1 to be miscompiled
  2009-11-12 17:05 [Bug lto/42020] New: field not merged causes cc1 to be miscompiled espindola at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-11-18 16:19 ` espindola at gcc dot gnu dot org
@ 2009-12-11 15:45 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-12-11 15:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2009-12-11 15:44 -------
Nothing new.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |WORKSFORME


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42020


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

end of thread, other threads:[~2009-12-11 15:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-12 17:05 [Bug lto/42020] New: field not merged causes cc1 to be miscompiled espindola at gcc dot gnu dot org
2009-11-12 17:05 ` [Bug lto/42020] " espindola at gcc dot gnu dot org
2009-11-12 17:06 ` espindola at gcc dot gnu dot org
2009-11-12 17:52 ` rguenth at gcc dot gnu dot org
2009-11-18 10:56 ` rguenth at gcc dot gnu dot org
2009-11-18 16:19 ` espindola at gcc dot gnu dot org
2009-12-11 15:45 ` rguenth at gcc dot gnu dot org

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