------- Comment #3 from krebbel at gcc dot gnu dot org  2010-04-07 15:56 -------
Created an attachment (id=20328)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20328&action=view)
Reduced testcase

The check for valid sibcalls in the S/390 back-end relies on the decl to be
available in the DECL parameter:

  /* The 31 bit PLT code uses register 12 (GOT pointer - caller saved)
     which would have to be restored before the sibcall.  */
  if (!TARGET_64BIT && flag_pic && decl && !targetm.binds_local_p (decl))
    return false;

The type cast of the function pointer in the testcase introduces a temporary
variable on 4.5 which is not linked with the function decl anymore:

  x_1 = (void (*<T244>) (float) (*<T248>) (void *)) d;
  D.1966_3 = x_1 (p_2(D)); [tail call]
  return D.1966_3;

With 4.4:

  D.1224 = (void (*<T242>) (float) (*<T246>) (void *)) d (p); [tail call]
  return D.1224;

So we probably have to always reject sibcalls if the fndecl is not reachable.


-- 

krebbel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #20300|0                           |1
        is obsolete|                            |
         AssignedTo|unassigned at gcc dot gnu   |krebbel at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED


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

Reply via email to