#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:
Blocking:

Description

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 (!!!)

Release:
unknown

Attachments (1)

ptPatch (1.6 KB) - added by Eric Norum on Dec 3, 2006 at 1:31:13 PM.
ptPatch

Download all attachments as: .zip

Change History (3)

comment:1 Changed on Mar 7, 2006 at 9:16:43 PM 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 Dec 3, 2006 at 1:31:13 PM by Eric Norum

Attachment: ptPatch added

ptPatch

comment:2 Changed on Oct 10, 2017 at 6:36:54 AM by Sebastian Huber

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