Hi,
Could a gatekeeper please help review the fix for bug964(
https://bugs.open64.net/show_bug.cgi?id=964)?
A cut-down case:
struct cpuinfo_x86 {
unsigned char x86;
} __attribute__((__aligned__((1 << (6)))));
typedef struct pgprot { unsigned long pgprot; } pgprot_t;
typedef unsigned long pteval_t;
struct vm_area_struct {
pgprot_t vm_page_prot;
} *vma;
extern struct cpuinfo_x86 boot_cpu_data;
void f (void) {
pgprot_t pprot = vma->vm_page_prot;
if (((pprot).pgprot) == ((((boot_cpu_data.x86 > 3) ? (((pgprot_t) {
(((pprot).pgprot) | ((((pteval_t)(1)) << 4))) } )) : (pprot))).pgprot))
vma->vm_page_prot = ((boot_cpu_data.x86 > 3) ? (((pgprot_t) {
(((vma->vm_page_prot).pgprot) | ((((pteval_t)(1)) << 4))) } )) :
(vma->vm_page_prot));
}
opencc failed as:
### Assertion failure at line 404 of
/fc/proj/ctires/open64/o64guru/src/Thu/trunk/osprey/be/com/wn_verifier.cxx:
### Compiler Error in file
bug940<https://bugs.open64.net/show_bug.cgi?id=940>.c
during VHO Processing phase:
### WN_verifier Error (TY_is_not_NULL): whirl node OPC_MSTID has a TY ==
NULL
opencc INTERNAL ERROR
Analysis:
The .B file dump PU f as:
U4U1LDID 0 <1,52,boot_cpu_data> T<57,cpuinfo_x86,64> <field_id:1>
U4CVTL 8
U4INTCONST 3 (0x3)
I4U4GT
BLOCK {line: 1/16}
U8U8LDID 0 <2,1,pprot> T<53,pgprot,8> <field_id:1>
U8INTCONST 16 (0x10)
U8BIOR
U8STID 0 <2,2,.init> T<9,.predef_U8,8> {line: 1/16}
END_BLOCK
MMLDID 0 <2,2,.init> T<53,pgprot,8>
MCOMMA
MMLDID 0 <2,1,pprot> T<53,pgprot,8>
MCSELECT
MSTID 0 <2,3,_temp_.mcselect_store0> T<### ERROR: null ptr> {line: 1/16}
The type of MSTID is unexpected NULL type (ty_idx 0). The type infer chain
here, should be: MSTID--> MCSELECT --> MCOMMA --> MMLDID 0 <2,2,.init>
T<53,pgprot,8>,
we lost the last infer.
Suggested patch:
osprey/wgen/wgen_expr.cxx -- 378b4b1..050e611 100644
--- a/osprey/wgen/wgen_expr.cxx
+++ b/osprey/wgen/wgen_expr.cxx
@@ -7167,6 +7167,17 @@ WGEN_Expand_Expr (gs_t exp,
if (WN_field_id (WN_kid1 (wn)))
temp_ty_idx = get_field_type (temp_ty_idx,
WN_field_id (WN_kid1 (wn)));
+
+ // open64.net bug964. Don't miss the case of
+ // COMMA/RCOMMA as the CSELECT kid1, then the
+ // type of the CSELECT expression should be that
+ // of COMMA's kid0.
+ if (!temp_ty_idx &&
+ (WN_operator(WN_kid1(wn)) == OPR_COMMA ||
+ WN_operator(WN_kid1(wn)) == OPR_RCOMMA))
+ temp_ty_idx = (WN_operator(WN_kid1(wn)) == OPR_COMMA)?
+ WN_ty(WN_kid1(WN_kid1(wn))):
+ WN_ty(WN_kid0(WN_kid1(wn)));
// Store into temp symbol
ST * temp = Gen_Temp_Symbol (temp_ty_idx, ".mcselect_store");
wn = WN_Stid (MTYPE_M, 0, temp, temp_ty_idx, wn);
Could a gatekeeper please help a review? Thanks in Advance.
Regards
Gang
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel