Notice: We have migrated to GitLab launching 2024-05-01 see here:

#748 closed defect (fixed)

gcc-3.4.x optimization breaks m68kpretaskinghook.c

Reported by: Eric Norum Owned by: Joel Sherrill
Priority: normal Milestone: 2
Component: arch/m68k Version: unknown
Severity: major Keywords:
Cc: bugs@… Blocked By:


m68kpretaskinghook.c gets the value of _HeapSize from the link editor:

unsigned long heapSize = (unsigned long)&_HeapSize;

then later on does:

if (heapSize == 0)

heapSize = ramSpace;

else if (heapSize > ramSpace)

The problem is that the compiler "knows" that no object can have an address of 0 and hence optimizes away the "if (heapSize == 0)" branch (!!!)


Attachments (1)

ptPatch (1.6 KB) - added by Eric Norum on 12/03/06 at 13:31:13.

Download all attachments as: .zip

Change History (3)

comment:1 Changed on 03/07/06 at 21:16:43 by Joel Sherrill

Status: assignedclosed

State-Changed-From-To: open->closed
State-Changed-Why: An alternative patch was applied. I recall discussion
without a conclusion. if this patch is better, revert the
one I applied and use this one. I trust the opinion of
others on this.

Changed on 12/03/06 at 13:31:13 by Eric Norum

Attachment: ptPatch added


comment:2 Changed on 10/10/17 at 06:36:54 by Sebastian Huber

Component: patch - do not usearch/m68k
Note: See TracTickets for help on using tickets.