Message ID | 512195FE6C78B243B073F23FF584A7336F77FEB8@penmbx01 |
---|---|
State | New |
Headers | show |
On 04/07/14 01:10, K_s, Vishnu wrote: > Added comment to avr.c on why disabling -fdelete-null-pointer-checks. Patch > Attached in the mail. > > Previously approved patch can be found here - > http://gcc.gnu.org/ml/gcc-patches/2014-03/msg01697.html. > > I don't have commit access to the source, please commit both the patches > If they are OK. > > Regards > Vishnu KS > > 2014-03-31 Vishnu K S <Vishnu.k_s@atmel.com> > > * gcc/config/avr/avr.c: Add comment on why disabling > -fdelete-null-pointer-checks Thanks. Installed. jeff
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 8ca7de0..c400bff 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -290,6 +290,12 @@ avr_to_int_mode (rtx x) static void avr_option_override (void) { + /* Disable -fdelete-null-pointer-checks option for AVR target. + For this option compiler assumes that dereferencing of a null pointer + would halt the program. For AVR this assumption is not true and + programs can safely dereference null pointers. Changes made by this + option may not work properly for AVR. So disable this option. */ + flag_delete_null_pointer_checks = 0; /* caller-save.c looks for call-clobbered hard registers that are assigned