[proposed fix for PR49847 java breakage on m68k with gcc-4.6 ] From: Andreas Schwab Subject: Fix flag_trapping_math in java frontend List-Id: List-Archive: The java frontend wants that floating point operations are assumed to never trap, thus clears flag_trapping_math in java_init_options_struct. But this is no longer effective after revision 165823, because set_fast_math_flags is now always called during option processing, overriding anything what the frontend did to flag_trapping_math. This is an amendment to revision 169930 which introduced frontend_set_flag_trapping_math, but didn't set it in java_init_options_struct. While this was found during examination of PR49847, this doesn't fix it, but only makes the bug dormant again in 4.6. Tested on powerpc-linux, ok for trunk and 4.6 branch? Andreas. 2012-01-22 Andreas Schwab * lang.c (java_init_options_struct): Set frontend_set_flag_trapping_math. --- gcc-4.6.2/gcc/java/lang.c.~1~ 2010-12-15 10:59:24.000000000 +0100 +++ gcc-4.6.2/gcc/java/lang.c 2012-01-22 16:47:20.000000000 +0100 @@ -550,6 +550,7 @@ java_init_options_struct (struct gcc_opt /* In Java floating point operations never trap. */ opts->x_flag_trapping_math = 0; + opts->frontend_set_flag_trapping_math = true; /* In Java arithmetic overflow always wraps around. */ opts->x_flag_wrapv = 1;