public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/66190] New: [5/6 Regression] ICE: tree code ‘call_expr’ is not supported in LTO streams with -fsanitize=null
@ 2015-05-18  8:49 marxin at gcc dot gnu.org
  2015-05-18 12:45 ` [Bug sanitizer/66190] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2015-05-18  8:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66190

            Bug ID: 66190
           Summary: [5/6 Regression] ICE: tree code ‘call_expr’ is not
                    supported in LTO streams with -fsanitize=null
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

$ cat test.ii
class A {
public:
  void m_fn1(int);
};
class GrAAHairLinePathRenderer {
  ~GrAAHairLinePathRenderer();
  A onStencilPath_drawState;
  virtual void m_fn2() {
    static int a;
    static int &b(a);
    onStencilPath_drawState.m_fn1(b);
  }
};
GrAAHairLinePathRenderer::~GrAAHairLinePathRenderer() {}

$ g++ test.ii -flto -c -fsanitize=null


test.ii:14:56: internal compiler error: tree code ‘call_expr’ is not supported
in LTO streams
 GrAAHairLinePathRenderer::~GrAAHairLinePathRenderer() {}
                                                        ^
0x678d8e lto_write_tree
        ../../gcc/lto-streamer-out.c:415
0x678d8e lto_output_tree_1
        ../../gcc/lto-streamer-out.c:464
0x678d8e DFS::DFS(output_block*, tree_node*, bool, bool, bool)
        ../../gcc/lto-streamer-out.c:654
0xe378ce lto_output_tree(output_block*, tree_node*, bool, bool)
        ../../gcc/lto-streamer-out.c:1609
0xdbf5f5 write_global_stream
        ../../gcc/lto-streamer-out.c:2397
0xdbf5f5 lto_output_decl_state_streams(output_block*, lto_out_decl_state*)
        ../../gcc/lto-streamer-out.c:2444
0xdbf5f5 produce_asm_for_decls()
        ../../gcc/lto-streamer-out.c:2814
0xdb4004 write_lto() [clone .lto_priv.4579]
        ../../gcc/passes.c:2410
0xe22b49 ipa_write_summaries_1
        ../../gcc/passes.c:2471
0xe22b49 ipa_write_summaries()
        ../../gcc/passes.c:2531
0xd41543 ipa_passes
        ../../gcc/cgraphunit.c:2216
0xd41543 symbol_table::compile()
        ../../gcc/cgraphunit.c:2312
0xd50e1d symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.c:2461
0xdd9dc0 cp_write_global_declarations()
        ../../gcc/cp/decl2.c:4755


Breakpoint 1, lto_write_tree (ob=0x1a41670, expr=0x7ffff6c41948, ref_p=false)
at ../../gcc/lto-streamer-out.c:415
415                         get_tree_code_name (TREE_CODE (expr)));
(gdb) p debug_tree(expr)
 <call_expr 0x7ffff6c41948
    type <void_type 0x7ffff6c5d000 void VOID
        align 8 symtab 0 alias set -1 canonical type 0x7ffff6c5d000
        pointer_to_this <pointer_type 0x7ffff6c5d150>>
    side-effects tree_0 tree_3
    arg 0 <addr_expr 0x7ffff6dc4540
        type <pointer_type 0x7ffff6c5d7e0 type <integer_type 0x7ffff6c3b690
int>
            public unsigned DI
            size <integer_cst 0x7ffff6c37e58 constant 64>
            unit size <integer_cst 0x7ffff6c37e70 constant 8>
            align 64 symtab 0 alias set -1 canonical type 0x7ffff6c5d7e0>
        constant
        arg 0 <var_decl 0x7ffff6c44cf0 a type <integer_type 0x7ffff6c3b690 int>
            addressable used public static weak decl_5 decl_6 SI file test.ii
line 9 col 16
            size <integer_cst 0x7ffff6c590a8 constant 32>
            unit size <integer_cst 0x7ffff6c590c0 constant 4>
            align 32 context <function_decl 0x7ffff6dd7870 m_fn2> chain
<var_decl 0x7ffff6c44d80 b>>>
    arg 1 <integer_cst 0x7ffff6dd6588 type <pointer_type 0x7ffff6c5d7e0>
constant 2>
    arg 2 <integer_cst 0x7ffff6c59288 type <integer_type 0x7ffff6c5d348>
constant 0>>
$1 = void


Thanks,
Martin
>From gcc-bugs-return-486510-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon May 18 08:51:28 2015
Return-Path: <gcc-bugs-return-486510-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 31571 invoked by alias); 18 May 2015 08:51:28 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 31530 invoked by uid 48); 18 May 2015 08:51:23 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/66110] uint8_t memory access not optimized
Date: Mon, 18 May 2015 08:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 5.1.0
X-Bugzilla-Keywords: alias, missed-optimization
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-66110-4-KAVjQtWsng@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66110-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66110-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-05/txt/msg01350.txt.bz2
Content-length: 1602

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf110

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jsm28 at gcc dot gnu.org

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Kevin OConnor from comment #8)
> Thanks!  I can confirm the latest trunk performs the desired optimization.
>
> However, this test case still isn't fully optimized:
>
> void f2(struct s1 *ps1, uint8_t *pi8)
> {
>     ps1->f1 = 3;
>     *pi8 = 8;
>     ps1->f1 += 2;
> }
>
> That is, an "uint8_t*" still aliases with every other type. The "struct"
> optimization is more important for my usage, but it is unfortunate that
> uint8_t*/int8_t* are pessimized.  (In particular, there does not appear to
> be any way to declare a pointer to an 8 bit integer that doesn't alias every
> other type.)
>
> I can open a separate bugzilla entry on the above.

Well, so it ultimiatively boils down to GCC defining

#define __UINT8_TYPE__ unsigned char

and that being a character type.  I'm not sure whether the C or C++ standards
mandate that uint8_t be a 'character type' as far as type-based aliasing goes
but I would expect that user-code may rely on that property.  So yes, there
would be no 1-byte type that doesn't get alias-set zero.  Well - you could
use

struct byte { uint8_t b; };

and make sure to use aggregate assignments everywhere, only ever extracting
the actual value from temporary aggregates...


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

end of thread, other threads:[~2015-06-04  8:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18  8:49 [Bug sanitizer/66190] New: [5/6 Regression] ICE: tree code ‘call_expr’ is not supported in LTO streams with -fsanitize=null marxin at gcc dot gnu.org
2015-05-18 12:45 ` [Bug sanitizer/66190] " rguenth at gcc dot gnu.org
2015-05-18 13:02 ` mpolacek at gcc dot gnu.org
2015-05-18 13:06 ` mpolacek at gcc dot gnu.org
2015-05-18 13:40 ` mpolacek at gcc dot gnu.org
2015-05-18 16:55 ` mpolacek at gcc dot gnu.org
2015-05-19 13:34 ` marxin at gcc dot gnu.org
2015-05-19 14:18 ` jakub at gcc dot gnu.org
2015-05-21 11:04 ` mpolacek at gcc dot gnu.org
2015-06-03 16:55 ` mpolacek at gcc dot gnu.org
2015-06-03 17:00 ` mpolacek at gcc dot gnu.org
2015-06-04  8:39 ` mpolacek at gcc dot gnu.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).