public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/40914]  New: ipa_analyze_call_uses fails to handle ptrmemfunc_vbit_in_delta
@ 2009-07-30 13:28 rearnsha at gcc dot gnu dot org
  2009-07-31  9:38 ` [Bug tree-optimization/40914] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2009-07-30 13:28 UTC (permalink / raw)
  To: gcc-bugs

The code in ipa_analyze_call_uses tries to wade through the gimple to identify
uses of pointers to member functions that are invariant after inlining (due to
parameter passing).  However, the code only looks for the vbit test on the
pointer part of the pmf not on the delta.  On targets such as ARM all bits in
the pointer are meaningful and the vbit is stored in the delta and the code
scrubbing fails to match.

Testcase is g++.dg/ipa/iinline-1.C 

On arm the relevant gimple looks like:

  f$__pfn_4 = f.__pfn;
  f$__delta_24 = f.__delta;
  __comp_ctor  (&S, &"muhehehe"[0]);
  D.1787_3 = f$__delta_24 & 1;
  if (D.1787_3 != 0)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:
  D.1789_6 = f$__delta_24 >> 1;
  D.1790_7 = (unsigned int) D.1789_6;
  D.1791_8 = &S + D.1790_7;
  D.1792_9 = (int (*__vtbl_ptr_type) (void) * *) D.1791_8;
  D.1793_10 = *D.1792_9;
  D.1795_12 = (unsigned int) f$__pfn_4;
  D.1796_13 = D.1793_10 + D.1795_12;
  D.1797_14 = *D.1796_13;
  iftmp.0_15 = (String:: *) D.1797_14;
<bb 4>:
  # iftmp.0_1 = PHI <iftmp.0_15(3), f$__pfn_4(2)>
  D.1789_18 = f$__delta_24 >> 1;
  D.1790_19 = (unsigned int) D.1789_18;
  D.1798_20 = &S + D.1790_19;
  D.1784_21 = iftmp.0_1 (D.1798_20, 4);


-- 
           Summary: ipa_analyze_call_uses fails to handle
                    ptrmemfunc_vbit_in_delta
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rearnsha at gcc dot gnu dot org
GCC target triplet: arm-eabi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40914


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

end of thread, other threads:[~2009-07-31 21:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-30 13:28 [Bug tree-optimization/40914] New: ipa_analyze_call_uses fails to handle ptrmemfunc_vbit_in_delta rearnsha at gcc dot gnu dot org
2009-07-31  9:38 ` [Bug tree-optimization/40914] " rguenth at gcc dot gnu dot org
2009-07-31 10:52 ` rearnsha at gcc dot gnu dot org
2009-07-31 21:56 ` rearnsha at gcc dot gnu dot org
2009-07-31 21:57 ` rearnsha at gcc dot gnu dot 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).