Author: yug
Date: 2011-11-08 04:31:37 -0500 (Tue, 08 Nov 2011)
New Revision: 3790
Modified:
trunk/osprey/driver/phases.c
trunk/osprey/driver/special_options.c
trunk/osprey/ipa/inline/inline_driver.cxx
trunk/osprey/ipa/main/analyze/ipa_cg.cxx
Log:
Fix bug838. besides that, the patch also enhances the gnu compatibility:
(1). enables -O0 -inline now
(2). does not delete non-callable static functions under O0
(3). bug838-1 to bug838-6 at the open64.net regression test suite prove that.
Code Review: Fred Chow, Ake Sandgren and Suneel Jain
Modified: trunk/osprey/driver/phases.c
===================================================================
--- trunk/osprey/driver/phases.c 2011-11-07 01:46:45 UTC (rev 3789)
+++ trunk/osprey/driver/phases.c 2011-11-08 09:31:37 UTC (rev 3790)
@@ -3228,6 +3228,16 @@
} else {
args = init_string_list();
add_file_args_first (args, phase_order[i]); // bug 6874
+ if (phase_order[i] == P_inline &&
+ run_inline == TRUE &&
+ olevel == 0 &&
+ !(option_was_seen(O_INLINE_) ||
+ option_was_seen(O_INLINE) ||
+ option_was_seen(O_inline) ||
+ option_was_seen(O_finline) ||
+ option_was_seen(O_finline_functions))) {
+ prepend_option_seen
(add_string_option(O_INLINE_, "none"));
+ }
copy_phase_options (args, phase_order[i]);
if (!cmd_line_updated &&
Modified: trunk/osprey/driver/special_options.c
===================================================================
--- trunk/osprey/driver/special_options.c 2011-11-07 01:46:45 UTC (rev
3789)
+++ trunk/osprey/driver/special_options.c 2011-11-08 09:31:37 UTC (rev
3790)
@@ -365,8 +365,9 @@
* -g to change the generated code so we leave it off always.
* See bugs 1917 and 7595.
*/
- if (olevel == 0 && inline_t == UNDEFINED)
- inline_t = FALSE;
+ /*
+ open64.net bug838, to get gnu compatibility, we open inline for O0.
+ */
/* In the SGI world, -g3 says to emit crippled debug info for use
* with optimized code. In the GNU/Pathscale world, -g3 says to emit
Modified: trunk/osprey/ipa/inline/inline_driver.cxx
===================================================================
--- trunk/osprey/ipa/inline/inline_driver.cxx 2011-11-07 01:46:45 UTC (rev
3789)
+++ trunk/osprey/ipa/inline/inline_driver.cxx 2011-11-08 09:31:37 UTC (rev
3790)
@@ -196,6 +196,10 @@
Opt_Level = 2;
INLINE_Enable_Split_Common = FALSE;
break;
+ case '0': /* setup O0 for lw_inline for gcc compatible*/
+ Opt_Level = 0;
+ INLINE_Enable_Split_Common = FALSE;
+ break;
default:
Opt_Level = 1;
INLINE_Enable_Split_Common = FALSE;
Modified: trunk/osprey/ipa/main/analyze/ipa_cg.cxx
===================================================================
--- trunk/osprey/ipa/main/analyze/ipa_cg.cxx 2011-11-07 01:46:45 UTC (rev
3789)
+++ trunk/osprey/ipa/main/analyze/ipa_cg.cxx 2011-11-08 09:31:37 UTC (rev
3790)
@@ -1848,6 +1848,14 @@
node->Set_Undeletable();
action = MARK_USED;
visited[v] = VISITED_AND_KEEP;
+#if defined(_LIGHTWEIGHT_INLINER)
+ /* O0 does not delete functions with no inline attrib */
+ } else if (Opt_Level == 0 && ! node->Has_Inline_Attrib()) {
+ node->Clear_Deletable();
+ node->Set_Undeletable();
+ action = MARK_USED;
+ visited[v] = VISITED_AND_KEEP;
+#endif
} else if (visited[v] == 0)
visited[v] = VISITED_BUT_UNDECIDED;
break;
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Open64-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel