This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[3.3/mainline] Fix uninitialized memory read
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com, mark at codesourcery dot com
- Date: Mon, 28 Jul 2003 20:04:05 +0200
- Subject: [3.3/mainline] Fix uninitialized memory read
Hi,
on hammer branch we get failure on accessing NULL pointer in
get_attr_memory. The testcase does not reproduce on ohter branches but
it is merely a luck. THis patch avoids accessing operand 2 for ishift1
insns.
I am installing it as obvious into mainline. Does this look like good
idea for release branch or it is too late now (due to lack of testcase)?
Honza
Mon Jul 28 20:02:00 CEST 2003 Jan Hubicka <jh@suse.cz>
* i386.md (memory attribute) Avoid accessing uninitialized memory
for ishift1 type instructions.
Index: i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.401.2.36
diff -c -3 -p -r1.401.2.36 i386.md
*** i386.md 24 Jun 2003 22:02:09 -0000 1.401.2.36
--- i386.md 28 Jul 2003 18:00:50 -0000
***************
*** 337,343 ****
(if_then_else (match_operand 1 "constant_call_address_operand" "")
(const_string "none")
(const_string "load"))
! (and (eq_attr "type" "alu1,negnot")
(match_operand 1 "memory_operand" ""))
(const_string "both")
(and (match_operand 0 "memory_operand" "")
--- 337,343 ----
(if_then_else (match_operand 1 "constant_call_address_operand" "")
(const_string "none")
(const_string "load"))
! (and (eq_attr "type" "alu1,negnot,ishift1")
(match_operand 1 "memory_operand" ""))
(const_string "both")
(and (match_operand 0 "memory_operand" "")
***************
*** 348,354 ****
(match_operand 1 "memory_operand" "")
(const_string "load")
(and (eq_attr "type"
! "!alu1,negnot,
imov,imovx,icmp,test,
fmov,fcmp,fsgn,
sse,ssemov,ssecmp,ssecomi,ssecvt,sseicvt,
--- 348,354 ----
(match_operand 1 "memory_operand" "")
(const_string "load")
(and (eq_attr "type"
! "!alu1,negnot,ishift1,
imov,imovx,icmp,test,
fmov,fcmp,fsgn,
sse,ssemov,ssecmp,ssecomi,ssecvt,sseicvt,