------- Comment #4 from rguenther at suse dot de 2010-04-08 08:11 ------- Subject: Re: [4.5/4.6 Regression] ICE in s390_emit_call, at config/s390/s390.c:9484
On Wed, 7 Apr 2010, krebbel at gcc dot gnu dot org wrote: > ------- 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) > --> (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. The extra cast happens if the function signatures are not compatible (by means of useless_type_conversion_p). I can't deciper the function type from (void (*<T244>) (float) (*<T248>) (void *)) right now, but it's early in the morning ;) Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43635