This is the mail archive of the gcc-patches@gcc.gnu.org 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


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 it might help if you either build the new arglist yourself
for the call to expand_builtin_memcpy, or avoid the intrinsic
falling back to a stpcpy library call, by using build_function_call_expr
as is done in expand_builtin_strcpy [the only other use of chainon
in builtins.c]


I hope this helps.  I'm not sure if it'll fix the PR regression,
but it certainly is a potential bug.

Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


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