From 866a2ad35b75cbc60260c00b82bec2243877355f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 21 Dec 2023 21:04:44 -0500 Subject: 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. --- sim/ppc/igen.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c index 8aa19c7..9f64244 100644 --- a/sim/ppc/igen.c +++ b/sim/ppc/igen.c @@ -439,15 +439,22 @@ main(int argc, { case '=': 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; case '\0': - code |= generate_with_icache; + if (enable_p) + code |= generate_with_icache; + else + code &= ~generate_with_icache; break; default: error ("Expecting -Ggen-icache or -Ggen-icache=\n"); } } + break; } case 'I': { -- cgit v1.1