From 816d256114858d01c99503c10e3be86ecdb15173 Mon Sep 17 00:00:00 2001 From: CarrieMY Date: Mon, 4 Oct 2021 21:03:38 +0800 Subject: Fix -E -fno-code undesirable interactions #20439 --- compiler/GHC/Driver/Pipeline.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/GHC/Driver/Pipeline.hs') diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs index 8362af9423..202043665c 100644 --- a/compiler/GHC/Driver/Pipeline.hs +++ b/compiler/GHC/Driver/Pipeline.hs @@ -530,11 +530,13 @@ compileFile hsc_env stop_phase (src, _mb_phase) = do dflags = hsc_dflags hsc_env mb_o_file = outputFile dflags ghc_link = ghcLink dflags -- Set by -c or -no-link - + notStopPreprocess | StopPreprocess <- stop_phase = False + | _ <- stop_phase = True -- When linking, the -o argument refers to the linker's output. -- otherwise, we use it as the name for the pipeline's output. output - | NoBackend <- backend dflags = NoOutputFile + | NoBackend <- backend dflags, notStopPreprocess = NoOutputFile + -- avoid -E -fno-code undesirable interactions. see #20439 | NoStop <- stop_phase, not (isNoLink ghc_link) = Persistent -- -o foo applies to linker | isJust mb_o_file = SpecificFile -- cgit v1.2.1