[Bug tree-optimization/63828] New: g++.dg/ipa/devirt-47.C fails for x32

hjl.tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Nov 12 01:08:00 GMT 2014


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

            Bug ID: 63828
           Summary: g++.dg/ipa/devirt-47.C fails for x32
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: hubicka at ucw dot cz

On x32, g++.dg/ipa/devirt-47.C fails:

FAIL: g++.dg/ipa/devirt-47.C  -std=gnu++11  scan-ipa-dump-times inline
"Discovered a virtual call to a known target[^\\\\n]*C::_ZTh" 1
FAIL: g++.dg/ipa/devirt-47.C  -std=gnu++14  scan-ipa-dump-times inline
"Discovered a virtual call to a known target[^\\\\n]*C::_ZTh" 1
FAIL: g++.dg/ipa/devirt-47.C  -std=gnu++98  scan-ipa-dump-times inline
"Discovered a virtual call to a known target[^\\\\n]*C::_ZTh" 1
FAIL: g++.dg/guality/pr55665.C   -O2  line 23 p == 40

The problem is in possible_placement_new

bool
possible_placement_new (tree type, tree expected_type,
                        HOST_WIDE_INT cur_offset)
{
  return ((TREE_CODE (type) != RECORD_TYPE
           || !TYPE_BINFO (type)
           || cur_offset >= BITS_PER_WORD
           || !polymorphic_type_binfo_p (TYPE_BINFO (type)))
          && (!TYPE_SIZE (type)
              || !tree_fits_shwi_p (TYPE_SIZE (type))
              || (cur_offset
                  + (expected_type ? tree_to_uhwi (TYPE_SIZE (expected_type))
                     : GET_MODE_BITSIZE (Pmode))
                  <= tree_to_uhwi (TYPE_SIZE (type)))));
}

When cur_offset is 32, cur_offset >= BITS_PER_WORD is false since
BITS_PER_WORD is 64 for x32.  We got

ipa-prop: Discovered a virtual call to a speculative target (void test(A*)/5 ->
virtual int C::_ZThn4_N1C3fooEv()/4), for stmt _6 = OBJ_TYPE_REF(_4;a_2(D)->0)
(a_2(D));

instead of "known target".  What is the significance of BITS_PER_WORD here?



More information about the Gcc-bugs mailing list