Bug 54952 - Program crash on M32C when stack frame is more then 128 bytes
Summary: Program crash on M32C when stack frame is more then 128 bytes
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-17 14:54 UTC by Michele Galante
Modified: 2012-12-09 10:54 UTC (History)
1 user (show)

See Also:
Host: Windows XP
Target: m32c-elf
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Test case (288 bytes, application/octet-stream)
2012-10-17 14:54 UTC, Michele Galante
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michele Galante 2012-10-17 14:54:02 UTC
Created attachment 28461 [details]
Test case

m32c-elf-gcc (GCC) 4.7.2 hosted on Windows XP.

If I compile and run the attached program with:

  m32c-elf-gcc -msim -mcpu=m32c -O1 -DDATASIZE=126 stack.c
  m32c-elf-run a.out

it works well. But if I increase DATASIZE to 127:

  m32c-elf-gcc -msim -mcpu=m32c -O1 -DDATASIZE=127 stack.c
  m32c-elf-run a.out

the program crashes.
Comment 1 DJ Delorie 2012-10-18 06:03:14 UTC
FYI this looks like an assembler bug, not a gcc bug...  The "add.l #128,sp" opcode is being assembled as "add.l #-128,sp" instead.
Comment 2 Michele Galante 2012-10-18 07:44:28 UTC
(In reply to comment #1)
> FYI this looks like an assembler bug, not a gcc bug...  The "add.l #128,sp"
> opcode is being assembled as "add.l #-128,sp" instead.

Thank you very much.

I just submitted the bug to the binutils Bugzilla (bug 14739).
Comment 3 Steven Bosscher 2012-12-09 10:54:29 UTC
Not a GCC bug -> INVALID