[sdcc-devel] [ sdcc-Bugs-1947081 ] Crash in peephole optimizer

Bugs item #1947081, was opened at 2008-04-20 10:43
Message generated for change (Comment added) made by fullmetalcoder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1947081&group_id=599
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: peephole optimizer
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Philipp Krause (spth)
Assigned to: Nobody/Anonymous (nobody)
Summary: Crash in peephole optimizer
Initial Comment:
I observe a crash (signal 11) in the peephole optimizer.
To reproduce:
Replace the content of src/z80/peeph.def by
replace restart {
pop %1
push %2
} by {
}
sdcc crashes when building asincosf from the library.
Philipp
----------------------------------------------------------------------
Comment By: FullMetalCoder (fullmetalcoder)
Date: 2009-07-29 12:19
Message:
Proposed fix :
SDCCpeep.c in static void replaceRule (lineNode ** shead, lineNode *
stail, peepRule * pr) at line 2149 replace
if (lhead)
with
if (lhead && cl)
rationale : the segfault occurs only when the rule insert a new comment
and no code, which leads to lhead being non-NULL and cl still being NULL at
that point, thus IC-reassociation is attempted and the fourth parameter
passed to reassociate_ic is NULL : KABOOOM!
it should be possible to just check for the non-NULLity of cl but you can
hardly be too careful...
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1947081&group_id=599

Thread view

Bugs item #1947081, was opened at 2008-04-20 10:43
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1947081&group_id=599
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: peephole optimizer
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Philipp Krause (spth)
Assigned to: Nobody/Anonymous (nobody)
Summary: Crash in peephole optimizer
Initial Comment:
I observe a crash (signal 11) in the peephole optimizer.
To reproduce:
Replace the content of src/z80/peeph.def by
replace restart {
pop %1
push %2
} by {
}
sdcc crashes when building asincosf from the library.
Philipp
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1947081&group_id=599

Bugs item #1947081, was opened at 2008-04-20 10:43
Message generated for change (Comment added) made by fullmetalcoder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1947081&group_id=599
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: peephole optimizer
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Philipp Krause (spth)
Assigned to: Nobody/Anonymous (nobody)
Summary: Crash in peephole optimizer
Initial Comment:
I observe a crash (signal 11) in the peephole optimizer.
To reproduce:
Replace the content of src/z80/peeph.def by
replace restart {
pop %1
push %2
} by {
}
sdcc crashes when building asincosf from the library.
Philipp
----------------------------------------------------------------------
Comment By: FullMetalCoder (fullmetalcoder)
Date: 2009-07-29 12:19
Message:
Proposed fix :
SDCCpeep.c in static void replaceRule (lineNode ** shead, lineNode *
stail, peepRule * pr) at line 2149 replace
if (lhead)
with
if (lhead && cl)
rationale : the segfault occurs only when the rule insert a new comment
and no code, which leads to lhead being non-NULL and cl still being NULL at
that point, thus IC-reassociation is attempted and the fourth parameter
passed to reassociate_ic is NULL : KABOOOM!
it should be possible to just check for the non-NULLity of cl but you can
hardly be too careful...
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1947081&group_id=599

Bugs item #1947081, was opened at 2008-04-20 10:43
Message generated for change (Comment added) made by spth
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1947081&group_id=599
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: peephole optimizer
>Group: fixed
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Philipp Krause (spth)
>Assigned to: Philipp Krause (spth)
Summary: Crash in peephole optimizer
Initial Comment:
I observe a crash (signal 11) in the peephole optimizer.
To reproduce:
Replace the content of src/z80/peeph.def by
replace restart {
pop %1
push %2
} by {
}
sdcc crashes when building asincosf from the library.
Philipp
----------------------------------------------------------------------
>Comment By: Philipp Krause (spth)
Date: 2009-08-06 00:03
Message:
Fixed in rev #5486.
----------------------------------------------------------------------
Comment By: FullMetalCoder (fullmetalcoder)
Date: 2009-07-29 12:19
Message:
Proposed fix :
SDCCpeep.c in static void replaceRule (lineNode ** shead, lineNode *
stail, peepRule * pr) at line 2149 replace
if (lhead)
with
if (lhead && cl)
rationale : the segfault occurs only when the rule insert a new comment
and no code, which leads to lhead being non-NULL and cl still being NULL at
that point, thus IC-reassociation is attempted and the fourth parameter
passed to reassociate_ic is NULL : KABOOOM!
it should be possible to just check for the non-NULLity of cl but you can
hardly be too careful...
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1947081&group_id=599