================ @@ -242,10 +242,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, clang::driver::options::OPT_fno_loop_versioning, false)) opts.LoopVersioning = 1; - opts.AliasAnalysis = - args.hasFlag(clang::driver::options::OPT_falias_analysis, - clang::driver::options::OPT_fno_alias_analysis, - /*default=*/false); + bool aliasAnalysis = false; + bool noAliasAnalysis = false; + if (auto *arg = + args.getLastArg(clang::driver::options::OPT_falias_analysis, + clang::driver::options::OPT_fno_alias_analysis)) { + if (arg->getOption().matches(clang::driver::options::OPT_falias_analysis)) + aliasAnalysis = true; + else + noAliasAnalysis = true; + } + opts.AliasAnalysis = 0; + if (opts.OptimizationLevel > 0) { + if (!noAliasAnalysis) + opts.AliasAnalysis = 1; + } else { + if (aliasAnalysis) + opts.AliasAnalysis = 1; + } ---------------- banach-space wrote:
It won't if you implement this logic: https://github.com/llvm/llvm-project/pull/73111#discussion_r1403215158 https://github.com/llvm/llvm-project/pull/73111 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits