Skip to content

Commit 2e60a20

Browse files
committed
Make user range rounding preference override -O0
Range rounding is disabled for -O0 but now a user preference for range rounding can override this.
1 parent 8883f2d commit 2e60a20

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5454,7 +5454,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
54545454
bool DisableRangeRounding = false;
54555455
if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {
54565456
if (A->getOption().matches(options::OPT_O0))
5457-
DisableRangeRounding = true;
5457+
// If the user has set some range rounding preference then let that
5458+
// override not range rounding at -O0
5459+
if (!Args.getLastArg(options::OPT_fsycl_range_rounding_EQ))
5460+
DisableRangeRounding = true;
54585461
}
54595462
if (DisableRangeRounding || HasFPGA)
54605463
CmdArgs.push_back("-fsycl-range-rounding=disable");

0 commit comments

Comments
 (0)