This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: middle-end/10472: [3.4 regression] ICE in instantiate_virtual_regs_lossage

 > From: Roger Sayle <>
 > Hi Kaveh,
 > > Would someone please assist me in debugging this?
 > The first thing that strikes me as dangerous is the use of "chainon"
 > in expand_builtin_stpcpy.  The use of chainon is modifying the tree
 > "arglist" that's passed in as a parameter.  This argument list may
 > be shared if the call was duplicated, and worse still if the call
 > to expand_builtin_memcpy returns NULL, GCC will end up passing the
 > wrong number of arguments in an explicit function call to the
 > stpcpy library function.

I *think* that expand_builtin_memcpy will never return NULL here given
the validation we've already done before calling it from
expand_builtin_stpcpy.  However for other reasons, it's better to be
safe and copy the arglist.  I've submitted a patch to that effect, but
it doesn't help with the PR.

Since builtin mempcpy produces the same symptoms and doesn't modify
the arglist, I'm still convinced this bug is something in the x86
backend that interacts wierdly with these builtins.

Kaveh R. Ghazi

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]