public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/67850] New: Wrong call_used_regs used in aggregate_value_p
@ 2015-10-05 13:04 hjl.tools at gmail dot com
  2015-10-05 13:35 ` [Bug middle-end/67850] " hjl.tools at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2015-10-05 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67850
           Summary: Wrong call_used_regs used in aggregate_value_p
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: julia.koval at intel dot com
  Target Milestone: ---

aggregate_value_p may be called:

#0  aggregate_value_p (exp=0x7ffff7ff9258, fntype=0x7ffff150b0a8)
    at /export/gnu/import/git/sources/gcc/gcc/function.c:2096
#1  0x0000000000e2d3ae in (anonymous namespace)::pass_nrv::execute (
    this=0x2313730, fun=0x7ffff16091f8)
    at /export/gnu/import/git/sources/gcc/gcc/tree-nrv.c:153
#2  0x0000000000c6c6ce in execute_one_pass (pass=0x2313730)
    at /export/gnu/import/git/sources/gcc/gcc/passes.c:2342
#3  0x0000000000c6c918 in execute_pass_list_1 (pass=0x2313730)
    at /export/gnu/import/git/sources/gcc/gcc/passes.c:2395
#4  0x0000000000c6c989 in execute_pass_list (fn=0x7ffff16091f8, pass=0x2310730)
    at /export/gnu/import/git/sources/gcc/gcc/passes.c:2406
#5  0x00000000008f436c in cgraph_node::expand (this=0x7ffff160c170)
    at /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:1983
#6  0x00000000008f49a6 in expand_all_functions ()
    at /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:2119
#7  0x00000000008f54bf in symbol_table::compile (this=0x7ffff14e90a8)
    at /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:2472
#8  0x00000000008f56e0 in symbol_table::finalize_compilation_unit (
    this=0x7ffff14e90a8)
    at /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:2562
#9  0x0000000000d6a287 in compile_file ()
(gdb) f 1
#1  0x0000000000e2d3ae in (anonymous namespace)::pass_nrv::execute (
    this=0x2313730, fun=0x7ffff16091f8)
    at /export/gnu/import/git/sources/gcc/gcc/tree-nrv.c:153
153       if (!aggregate_value_p (result, current_function_decl))
(gdb) 

But the wrong call_used_regs may be used here:

  regno = REGNO (reg);
  nregs = hard_regno_nregs[regno][TYPE_MODE (type)];
  for (i = 0; i < nregs; i++) 
    if (! call_used_regs[regno + i])
      return 1;

since targetm.expand_to_rtl_hook may be called to switch ABI:

(gdb) bt
#0  ix86_maybe_switch_abi ()
    at /export/gnu/import/git/sources/gcc/gcc/config/i386/i386.c:7445
#1  0x00000000008b0e6f in (anonymous namespace)::pass_expand::execute (
    this=0x2313850, fun=0x7ffff16090a8)
    at /export/gnu/import/git/sources/gcc/gcc/cfgexpand.c:6153
#2  0x0000000000c6c6ce in execute_one_pass (pass=0x2313850)
    at /export/gnu/import/git/sources/gcc/gcc/passes.c:2342
#3  0x0000000000c6c918 in execute_pass_list_1 (pass=0x2313850)
    at /export/gnu/import/git/sources/gcc/gcc/passes.c:2395
#4  0x0000000000c6c989 in execute_pass_list (fn=0x7ffff16090a8, pass=0x2310730)
    at /export/gnu/import/git/sources/gcc/gcc/passes.c:2406
#5  0x00000000008f436c in cgraph_node::expand (this=0x7ffff160c000)
    at /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:1983
#6  0x00000000008f49a6 in expand_all_functions ()
    at /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:2119
#7  0x00000000008f54bf in symbol_table::compile (this=0x7ffff14e90a8)
    at /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:2472
#8  0x00000000008f56e0 in symbol_table::finalize_compilation_unit (
    this=0x7ffff14e90a8)
    at /export/gnu/import/git/sources/gcc/gcc/cgraphunit.c:2562
#9  0x0000000000d6a287 in compile_file ()

to change call_used_regs.


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

end of thread, other threads:[~2015-10-12 12:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-05 13:04 [Bug middle-end/67850] New: Wrong call_used_regs used in aggregate_value_p hjl.tools at gmail dot com
2015-10-05 13:35 ` [Bug middle-end/67850] " hjl.tools at gmail dot com
2015-10-07 10:30 ` [Bug target/67850] " hjl at gcc dot gnu.org
2015-10-12 12:26 ` hjl at gcc dot gnu.org
2015-10-12 12:48 ` hjl.tools at gmail dot com

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