Hi,

   Could a gatekeeper please help review the fix for bug903(
https://bugs.open64.net/show_bug.cgi?id=903)?

bug910 is a duplication of this bug, since it is a little complex on the
source code, I will not show full source code, only IR snippet.

bug assertion:

Signal: Segmentation fault in CFLOW (third pass) phase.
Error: Signal Segmentation fault in phase CFLOW (third pass) -- processing
aborted
This is a ebo related bug, special to x86 target. r3314 introduced test8
and test16 ops to x86 target and the EBO process, changes some of the
higher bit test to test8 and test 16

in bug903,
BB16:
[  45, 0] TN33(%rflags) :- cmp32 TN181 TN182 ;
[  45, 0] TN184 :- setge TN33(%rflags) ;
[  45, 0] TN183 :- movzbl TN184 ;
[  45, 0] TN186 :- ldc64 (sym:.data+32) ;
[  45, 0] TN187 :- ldc32 (0x0) ;
[  45, 0] TN189 :- movzlq TN187 ;
[  45, 0] TN190 :- shli64 TN189 (0x2) ;
[  45, 0] TN191 :- add64 TN186 TN190 ;
[  45, 0] TN185 :- ld32 TN191 (0x0) ; WN id:58 g_4+0x0
[  45, 0] TN192 :- and32 TN183 TN185 ;
[  45, 0] TN33(%rflags) :- test32 TN192 TN192 ;
[  45, 0] :- je TN33(%rflags) (lab:.Lt_1_2818) ;
is ebo optimised to
[  45, 0] TN33(%rflags) :- cmp32 TN181 TN182 ;
[  45, 0] TN184 :- setge TN33(%rflags) ;
[   0, 0] GTN187 :- zero32 ;
[  45, 0] TN189 :- movzlq GTN187 ;
[  45, 0] TN33(%rflags) :- testxxx8 TN184 TN189 (0x4) (sym:.data+32) ;
[  45, 0] :- jne TN33(%rflags) (lab:.Lt_1_2562) ;
however, the introduced testxxx8 does not have change_rflags propertie,
this lead the:

cgtarget.cxx
1983  for( OP* op = OP_prev(br); op != NULL; op = OP_prev(op) ){
1984    if( TOP_is_change_rflags( OP_code(op) ) ){
1985      cmp_op = op;
1986      break;
1987    }
1988  }
unable to find the right cmp_op(testxxx8), which then either segment
fault(bug903) or assert(bug910).

Suggested patch, add change_rflags propertie for testxxx:
--- a/osprey/common/targ_info/isa/x8664/isa_properties.cxx
+++ b/osprey/common/targ_info/isa/x8664/isa_properties.cxx
@@ -577,15 +577,19 @@ int main()
                     TOP_test8,
                     TOP_testx8,
                     TOP_testxx8,
+                   TOP_testxxx8,
                     TOP_test16,
                     TOP_testx16,
                     TOP_testxx16,
+                   TOP_testxxx16,
                     TOP_test32,
                     TOP_testx32,
                     TOP_testxx32,
+                   TOP_testxxx32,
                     TOP_test64,
                     TOP_testx64,
                     TOP_testxx64,
+                   TOP_testxxx64,
                     TOP_testi8,
                     TOP_testi16,
                     TOP_testi32,
Thanks
Regards
Gang
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to