public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jamborm at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/41767] assertion in tree-sra.c
Date: Tue, 27 Oct 2009 13:59:00 -0000	[thread overview]
Message-ID: <20091027135939.10911.qmail@sourceware.org> (raw)
In-Reply-To: <bug-41767-12026@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from jamborm at gcc dot gnu dot org  2009-10-27 13:59 -------
The problem here is that build_ref_for_offset_1() cannot find a field
corresponding to a replacement within its own aggregate.  The field is
identified by its offset (zero) and type.  Unfortunately,
types_compatible_p() claims that the type of the replacement (taken
from the expression where it occurs) and the field at the offset are
not compatible.  I have added some dumps to the beginning of the
function and got:

----------------------------------------------------------------------
picked field value

Determining compatibility of types:

Expected type (type of the scalar replacement):
 <pointer_type 0xb7726514
    type <union_type 0xb772612c tree_node SI
        size <integer_cst 0xb7687498 constant 32>
        unit size <integer_cst 0xb7687284 constant 4>
        align 32 symtab 0 alias set -1 canonical type 0xb772612c
        fields <field_decl 0xb76eee60 common type <record_type 0xb7720b54
tree_common>
            SI file b.h line 8 col 20 size <integer_cst 0xb7687498 32> unit
size <integer_cst 0xb7687284 4>
            align 32 offset_align 128
            offset <integer_cst 0xb76872a0 constant 0>
            bit offset <integer_cst 0xb7687700 constant 0> context <union_type
0xb772612c tree_node> chain <field_decl 0xb76eef18 constructor>>
        pointer_to_this <pointer_type 0xb7726514>>
    unsigned SI size <integer_cst 0xb7687498 32> unit size <integer_cst
0xb7687284 4>
    align 32 symtab 0 alias set 4 canonical type 0xb7726514>


Record field type:
 <pointer_type 0xb7720e10
    type <union_type 0xb7720af0 tree_node SI
        size <integer_cst 0xb7687498 constant 32>
        unit size <integer_cst 0xb7687284 constant 4>
        align 32 symtab 0 alias set -1 canonical type 0xb7720af0
        fields <field_decl 0xb76eebdc common type <record_type 0xb7720b54
tree_common>
            SI file b.h line 8 col 20 size <integer_cst 0xb7687498 32> unit
size <integer_cst 0xb7687284 4>
            align 32 offset_align 128
            offset <integer_cst 0xb76872a0 constant 0>
            bit offset <integer_cst 0xb7687700 constant 0> context <union_type
0xb7720af0 tree_node> chain <field_decl 0xb76eec94 constructor>>
        pointer_to_this <pointer_type 0xb7720e10>>
    unsigned SI size <integer_cst 0xb7687498 32> unit size <integer_cst
0xb7687284 4>
    align 32 symtab 0 alias set 3 canonical type 0xb7720e10>


NOT compatible.

----------------------------------------------------------------------

I could workaround this and check whether all replacements can be
located within their aggregates before creating them but that does not
sound right.  Instead I think that the bug is either somewhere in type
merging or in types_compatible_p().


-- 


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


  parent reply	other threads:[~2009-10-27 13:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20 17:54 [Bug lto/41767] New: " espindola at gcc dot gnu dot org
2009-10-20 17:54 ` [Bug lto/41767] " espindola at gcc dot gnu dot org
2009-10-20 17:55 ` espindola at gcc dot gnu dot org
2009-10-20 17:55 ` espindola at gcc dot gnu dot org
2009-10-20 17:55 ` espindola at gcc dot gnu dot org
2009-10-21 12:18 ` rguenth at gcc dot gnu dot org
2009-10-27 13:59 ` jamborm at gcc dot gnu dot org [this message]
2009-10-27 14:17 ` rguenth at gcc dot gnu dot org
2009-10-27 14:23 ` rguenth at gcc dot gnu dot org
2009-10-27 18:39 ` jamborm at gcc dot gnu dot org
2009-10-28 10:25 ` rguenth at gcc dot gnu dot org
     [not found] <bug-41767-4@http.gcc.gnu.org/bugzilla/>
2021-02-26  8:32 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091027135939.10911.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).