@@ -100,6 +100,7 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
100100 opts -> x_target_flags &= ~MASK_MPY16_SET ;
101101 opts -> x_target_flags &= ~MASK_CODE_DENSITY ;
102102 opts -> x_target_flags &= ~MASK_SHIFT_ASSIST ;
103+ opts -> x_target_flags &= ~MASK_DIVREM ;
103104 break ;
104105
105106 case PROCESSOR_ARC600 :
@@ -114,6 +115,7 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
114115 opts -> x_target_flags &= ~MASK_CODE_DENSITY ;
115116 opts -> x_target_flags &= ~MASK_SHIFT_ASSIST ;
116117 opts -> x_target_flags &= ~MASK_ATOMIC ;
118+ opts -> x_target_flags &= ~MASK_DIVREM ;
117119 break ;
118120
119121 case PROCESSOR_ARCv2HS :
@@ -136,6 +138,8 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
136138 opts -> x_target_flags |= MASK_SWAP_SET ; /* Default: on. */
137139 if ( !(opts_set -> x_target_flags & MASK_ATOMIC ))
138140 opts -> x_target_flags |= MASK_ATOMIC ; /* Default: on. */
141+ if ( !(opts_set -> x_target_flags & MASK_DIVREM ))
142+ opts -> x_target_flags |= MASK_DIVREM ; /* Default: on. */
139143 break ;
140144
141145 case PROCESSOR_ARCv2EM :
@@ -158,6 +162,8 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
158162 opts -> x_target_flags &= ~MASK_SWAP_SET ; /* Default: off. */
159163 if ( !(opts_set -> x_target_flags & MASK_ATOMIC ))
160164 opts -> x_target_flags &= ~MASK_ATOMIC ; /* Default: off */
165+ if ( !(opts_set -> x_target_flags & MASK_DIVREM ))
166+ opts -> x_target_flags &= ~MASK_DIVREM ; /* Default: off. */
161167 break ;
162168
163169 case PROCESSOR_ARC601 :
@@ -172,6 +178,7 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
172178 opts -> x_target_flags &= ~MASK_CODE_DENSITY ;
173179 opts -> x_target_flags &= ~MASK_SHIFT_ASSIST ;
174180 opts -> x_target_flags &= ~MASK_ATOMIC ;
181+ opts -> x_target_flags &= ~MASK_DIVREM ;
175182 break ;
176183
177184 default :
@@ -227,7 +234,7 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
227234# define TARGET_DEFAULT_TARGET_FLAGS \
228235 (MASK_BARREL_SHIFTER | MASK_VOLATILE_CACHE_SET | DEFAULT_NO_SDATA \
229236 | MASK_MPY_SET | MASK_MPY16_SET | MASK_SHIFT_ASSIST | MASK_CODE_DENSITY \
230- | MASK_NORM_SET | MASK_SWAP_SET | MASK_ATOMIC)
237+ | MASK_NORM_SET | MASK_SWAP_SET | MASK_ATOMIC | MASK_DIVREM )
231238#elif TARGET_CPU_DEFAULT == TARGET_CPU_EM
232239/* Default for EM: no barrel shifter*/
233240# define TARGET_DEFAULT_TARGET_FLAGS \
0 commit comments