Hello,
Could a gatekeeper review the patch for bug 672?
The global scope inline assemly code is handled as fake function whose function
name contains the assemble code string, the body of the fake function is empty.
The fake function is not constructed with proper attributes, especialy the
language kind and function type are not correct, which caused assertion in
pre-opt. The fix for now is to set the attributes to avoid the assertion:
language kind to be the same as compiler language kind, function type to be
void
return type function.
Thanks,
-Xiaohua
------------------------
Index: osprey/wgen/wgen_decl.cxx
===================================================================
--- osprey/wgen/wgen_decl.cxx (revision 1312)
+++ osprey/wgen/wgen_decl.cxx (working copy)
@@ -1021,6 +1021,7 @@
New_INITO (ST_st_idx (etable), exc_ptr_iv));
}
+extern TY_IDX Type_For_Function_Returning_Void (void);
// Generate WHIRL representing an asm at file scope (between functions).
@@ -1029,13 +1030,14 @@
WGEN_Assemble_Asm(char *asm_string)
{
ST *asm_st = New_ST(GLOBAL_SYMTAB);
+ TY_IDX ty_idx = Type_For_Function_Returning_Void();
ST_Init(asm_st,
Str_To_Index (Save_Str (asm_string),
Global_Strtab),
CLASS_NAME,
SCLASS_UNKNOWN,
EXPORT_LOCAL,
- (TY_IDX) 0);
+ ty_idx);
Set_ST_asm_function_st(*asm_st);
@@ -1124,11 +1126,15 @@
PU_IDX pu_idx;
PU &pu = New_PU(pu_idx);
- PU_Init(pu, (TY_IDX) 0, CURRENT_SYMTAB);
+ PU_Init(pu, ty_idx, CURRENT_SYMTAB);
Set_PU_no_inline(pu);
Set_PU_no_delete(pu);
Set_ST_pu(*asm_st, pu_idx);
+ if (lang_cplus)
+ Set_PU_cxx_lang (Pu_Table [ST_pu (asm_st)]);
+ else Set_PU_c_lang (Pu_Table [ST_pu (asm_st)]);
+
Write_PU_Info (pu_info);
// What does the following line do?
Index: osprey/wgen/wgen_stmt.cxx
===================================================================
--- osprey/wgen/wgen_stmt.cxx (revision 1312)
+++ osprey/wgen/wgen_stmt.cxx (working copy)
@@ -293,7 +293,7 @@
static INT32 scope_number;
-static TY_IDX
+TY_IDX
Type_For_Function_Returning_Void (void)
{
static TY_IDX result = 0;
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel