[Bug tree-optimization/108444] New: ICE: invalid address operand in mem_ref when LTO building 523.xalancbmk_r

jamborm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 18 12:33:50 GMT 2023


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

            Bug ID: 108444
           Summary: ICE: invalid address operand in mem_ref when LTO
                    building 523.xalancbmk_r
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jamborm at gcc dot gnu.org
                CC: rguenth at gcc dot gnu.org
            Blocks: 26163
  Target Milestone: ---
              Host: x86_64-linux
            Target: x86_64-linux

When building 523.xalancbmk_r with -flto -Ofast -march=x86_64_v3 (or
native on a zen3 machine) with enabled checking I get an ICE:

  DFAContentModel.cpp: In member function 'checkUniqueParticleAttribution':
  DFAContentModel.cpp:1116:6: error: invalid address operand in 'mem_ref'
   1116 | void DFAContentModel::checkUniqueParticleAttribution (SchemaGrammar* 
  const pGrammar,
        |      ^
  MEM[(const XMLCh *)&fgATTVAL_TWOPOUNDANY];

  # VUSE <.MEM_244>
  _174 = MEM[(const XMLCh *)&fgATTVAL_TWOPOUNDANY];
  DFAContentModel.cpp:1116:6: error: invalid address operand in 'mem_ref'
  MEM[(const XMLCh *)&fgATTVAL_TWOPOUNDOTHER];

  # VUSE <.MEM_246>
  _175 = MEM[(const XMLCh *)&fgATTVAL_TWOPOUNDOTHER];
  DFAContentModel.cpp:1116:6: error: invalid address operand in 'mem_ref'
  MEM[(const XMLCh *)&fgATTVAL_TWOPOUNDANY];

  # VUSE <.MEM_262>
  _180 = MEM[(const XMLCh *)&fgATTVAL_TWOPOUNDANY];
  DFAContentModel.cpp:1116:6: error: invalid address operand in 'mem_ref'
  MEM[(const XMLCh *)&fgATTVAL_TWOPOUNDOTHER];

  # VUSE <.MEM_264>
  _181 = MEM[(const XMLCh *)&fgATTVAL_TWOPOUNDOTHER];
  during GIMPLE pass: fixup_cfg
  DFAContentModel.cpp:1116:6: internal compiler error: verify_gimple failed
  0xde8ceb verify_gimple_in_cfg(function*, bool, bool)
          /home/mjambor/gcc/mine/src/gcc/tree-cfg.cc:5647
  0xcbc1e0 execute_function_todo
          /home/mjambor/gcc/mine/src/gcc/passes.cc:2091
  0xcbc71e execute_todo
          /home/mjambor/gcc/mine/src/gcc/passes.cc:2145
  Please submit a full bug report, with preprocessed source (by using
-freport-bug).
  Please include the complete backtrace with any bug report.


I have bisected the issue to r13-4743-gda85bfc75024a9 which is:

commit da85bfc75024a92b97e60e4436863dd5789786ec
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Dec 16 13:01:40 2022 +0100

    middle-end/108086 - avoid unshare_expr when remapping SSA names

    r0-89280-g129a37fc319db8 added unsharing to remap_ssa_name but
    that wasn't in the version of the patch posted.  That has some
    non-trivial cost through mostly_copy_tree_r and copy_tree_r but
    more importantly it doesn't seem to be necessary.  I've successfully
    bootstrapped and tested with an assert we only get
    tree_node_can_be_shared trees here.

    Bootstrapped and tested on x86_64-unknown-linux-gnu with all
    languages.

            PR middle-end/108086
            * tree-inline.cc (remap_ssa_name): Do not unshare the
            result from the decl_map.

I have not attempted reducing the problem to a small testcase, at
least not yet.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26163
[Bug 26163] [meta-bug] missed optimization in SPEC (2k17, 2k and 2k6 and 95)


More information about the Gcc-bugs mailing list