This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/83111] [sh] stack smashing detected in gen_udivsi3
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Nov 2017 16:47:31 +0000
- Subject: [Bug target/83111] [sh] stack smashing detected in gen_udivsi3
- Auto-submitted: auto-generated
- References: <bug-83111-4@http.gcc.gnu.org/bugzilla/>
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)".