diff options
author | Jeffrey A Law <law@cygnus.com> | 1997-10-23 01:29:14 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1997-10-22 19:29:14 -0600 |
commit | 56bf1fd97aba55f54aa2ccc73768fc6160210d6e (patch) | |
tree | babd25bf79e9fcc763c8463bebd28400d95b08da | |
parent | 1181d2d55377707551ac43b20ca7ebb4e253dddc (diff) | |
download | gcc-56bf1fd97aba55f54aa2ccc73768fc6160210d6e.zip gcc-56bf1fd97aba55f54aa2ccc73768fc6160210d6e.tar.gz gcc-56bf1fd97aba55f54aa2ccc73768fc6160210d6e.tar.bz2 |
toplev.c (flag_exceptions): Default value is 2.
* toplev.c (flag_exceptions): Default value is 2.
(compile_file): If flag_exceptions still has the value 2, then
set it to 0.
* lex.c (lang_init): Enable flag_exceptions by default if no
command line switch was specified.
Gross hacks to allow front-ends to override -fexceptions.
From-SVN: r16152
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/ChangeLog.egcs | 5 | ||||
-rw-r--r-- | gcc/cp/lex.c | 4 | ||||
-rw-r--r-- | gcc/toplev.c | 24 |
4 files changed, 36 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 01dc831..d104b6f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ Wed Oct 22 00:34:12 1997 Jeffrey A Law (law@cygnus.com) + * toplev.c (flag_exceptions): Default value is 2. + (compile_file): If flag_exceptions still has the value 2, then + set it to 0. + * rs6000.c (struct machine_function): Add pic_offset_table_rtx. (rs6000_save_machine_status): Save pic_offset_table_rtx. (rs6000_restore_machine_status: Restore pic_offset_table_rtx. diff --git a/gcc/cp/ChangeLog.egcs b/gcc/cp/ChangeLog.egcs index ddefd5c..3185f28 100644 --- a/gcc/cp/ChangeLog.egcs +++ b/gcc/cp/ChangeLog.egcs @@ -1,3 +1,8 @@ +Wed Oct 22 18:56:31 1997 Jeffrey A Law (law@cygnus.com) + + * lex.c (lang_init): Enable flag_exceptions by default if no + command line switch was specified. + Wed Sep 10 16:39:26 1997 Jim Wilson <wilson@cygnus.com> * Make-lang.in (LN, LN_S): New macros, use where appropriate. diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 863fe4c..3d17fa3 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -387,6 +387,10 @@ lang_init () put_back (check_newline ()); if (flag_gnu_xref) GNU_xref_begin (input_filename); init_repo (input_filename); + + /* See comments in toplev.c before the call to lang_init. */ + if (flag_exceptions == 2) + flag_exceptions = 1; } void diff --git a/gcc/toplev.c b/gcc/toplev.c index 41e2c5b..9fabc8f 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -551,7 +551,7 @@ int flag_pic; /* Nonzero means generate extra code for exception handling and enable exception handling. */ -int flag_exceptions = 1; +int flag_exceptions = 2; /* Nonzero means don't place uninitialized global data in common storage by default. */ @@ -2361,10 +2361,32 @@ compile_file (name) input_file_stack->next = 0; input_file_stack->name = input_filename; + /* Gross. Gross. lang_init is (I think) the first callback into + the language front end, and is thus the first opportunity to + have the selected language override the default value for any + -f option. + + So the default value for flag_exceptions is 2 (uninitialized). + If we encounter -fno-exceptions or -fexceptions, then flag_exceptions + will be set to zero or one respectively. + + flag_exceptions can also be set by lang_init to something other + than the default "uninitialized" value of 2. + + After lang_init, if the value is still 2, then we default to + -fno-exceptions (value will be reset to zero). + + When our EH mechanism is low enough overhead that we can enable + it by default for languages other than C++, then all this braindamage + will go away. */ + /* Perform language-specific initialization. This may set main_input_filename. */ lang_init (); + if (flag_exceptions == 2) + flag_exceptions = 0; + /* If the input doesn't start with a #line, use the input name as the official input file name. */ if (main_input_filename == 0) |