[Bug target/83111] [sh] stack smashing detected in gen_udivsi3
vries at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 22 16:47:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83111
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |sh
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Looking at insn-emit.c, we see:
...
/* src/gcc/config/sh/sh.md:2273 */
rtx
gen_udivsi3 (rtx operand0,
rtx operand1,
rtx operand2)
{
rtx_insn *_val = 0;
start_sequence ();
{
rtx operands[3];
operands[0] = operand0;
operands[1] = operand1;
operands[2] = operand2;
#define FAIL return (end_sequence (), _val)
#define DONE return (_val = get_insns (),end_sequence (), _val)
// #line 2278 "src/gcc/config/sh/sh.md"
{
rtx last;
operands[3] = gen_reg_rtx (Pmode);
...
In other words, we declare an array with size 3: "rtx operands[3]", and then
write the 4th element: "operands[3] = gen_reg_rtx (Pmode)".
More information about the Gcc-bugs
mailing list