RFC: bug in combine
Dale Johannesen
dalej@apple.com
Thu Aug 25 18:14:00 GMT 2005
The following demonstrates a bug in combine
(x86 -mtune=pentiumpro -O2):
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: small.c
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20050825/3f248d7b/attachment.c>
-------------- next part --------------
The test of f->b comes out as
testl $1048512, 73(%eax)
This is wrong, because 4 bytes starting at 73 goes outside the original
object and can
cause a page fault. The change from referencing a word at offset 72 to
offset 73
happens in make_extraction in combine, and I propose to fix it thus:
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffsa.txt
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20050825/3f248d7b/attachment.txt>
-------------- next part --------------
Still testing, but I'm a bit concerned this is overkill. Are there
targets/situations where
this transformation is useful or even necessary? Comments?
More information about the Gcc
mailing list