sim: ppc: igen: fix -G handling

We weren't using the enable_p flag to see whether the option should
be enabled or disabled, and we weren't breaking out when done parsing.
This commit is contained in:
Mike Frysinger 2023-12-21 21:04:44 -05:00
parent 3744b73e3b
commit 866a2ad35b

View File

@ -439,15 +439,22 @@ main(int argc,
{ {
case '=': case '=':
icache_size = atoi (argp + strlen ("gen-icache") + 1); icache_size = atoi (argp + strlen ("gen-icache") + 1);
code |= generate_with_icache; if (enable_p)
code |= generate_with_icache;
else
code &= ~generate_with_icache;
break; break;
case '\0': case '\0':
code |= generate_with_icache; if (enable_p)
code |= generate_with_icache;
else
code &= ~generate_with_icache;
break; break;
default: default:
error ("Expecting -Ggen-icache or -Ggen-icache=<N>\n"); error ("Expecting -Ggen-icache or -Ggen-icache=<N>\n");
} }
} }
break;
} }
case 'I': case 'I':
{ {