public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/63828] New: g++.dg/ipa/devirt-47.C fails for x32
@ 2014-11-12  1:08 hjl.tools at gmail dot com
  2014-11-12  1:10 ` [Bug tree-optimization/63828] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2014-11-12  1:08 UTC (permalink / raw)
  To: gcc-bugs

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?


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

end of thread, other threads:[~2014-11-13 17:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-12  1:08 [Bug tree-optimization/63828] New: g++.dg/ipa/devirt-47.C fails for x32 hjl.tools at gmail dot com
2014-11-12  1:10 ` [Bug tree-optimization/63828] " pinskia at gcc dot gnu.org
2014-11-12  1:12 ` [Bug tree-optimization/63828] [5 Regression] " pinskia at gcc dot gnu.org
2014-11-12  1:17 ` hubicka at gcc dot gnu.org
2014-11-12  1:20 ` pinskia at gcc dot gnu.org
2014-11-12 17:26 ` hjl.tools at gmail dot com
2014-11-13 13:08 ` hjl at gcc dot gnu.org
2014-11-13 17:04 ` 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).