Bug Summary

File:build/source/polly/lib/External/isl/isl_pw_add_disjoint_templ.c
Warning:line 60, column 2
Value stored to 'ctx' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name isl_polynomial.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/build/source/build-llvm/tools/clang/stage2-bins -fdebug-prefix-map=/build/source/build-llvm/tools/clang/stage2-bins=../../../../ -fdebug-prefix-map=/build/source/= -ffunction-sections -fdata-sections -fcoverage-compilation-dir=/build/source/build-llvm/tools/clang/stage2-bins -resource-dir /usr/lib/llvm-19/lib/clang/19 -I tools/polly/lib/External -I /build/source/polly/lib/External -I /build/source/polly/lib/External/isl -I /build/source/polly/lib/External/isl/include -I /build/source/polly/lib/External/isl/imath -I tools/polly/lib/External/isl -I tools/polly/include -I /build/source/polly/lib/External/pet/include -I tools/polly/lib/External/isl/include -I /build/source/polly/include -I include -I /build/source/llvm/include -D _DEBUG -D _GLIBCXX_ASSERTIONS -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -D _FORTIFY_SOURCE=2 -D NDEBUG -U NDEBUG -internal-isystem /usr/lib/llvm-19/lib/clang/19/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fmacro-prefix-map=/build/source/build-llvm/tools/clang/stage2-bins=../../../../ -fmacro-prefix-map=/build/source/= -fcoverage-prefix-map=/build/source/build-llvm/tools/clang/stage2-bins=../../../../ -fcoverage-prefix-map=/build/source/= -O2 -Wno-unused-command-line-argument -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -Wno-comment -std=gnu99 -fconst-strings -ferror-limit 19 -stack-protector 2 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -vectorize-loops -vectorize-slp -analyzer-output=html -analyzer-config stable-report-filename=true -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/scan-build-2024-04-02-020108-72015-1 -x c /build/source/polly/lib/External/isl/isl_polynomial.c
1/*
2 * Copyright 2010 INRIA Saclay
3 * Copyright 2011 Sven Verdoolaege
4 *
5 * Use of this software is governed by the MIT license
6 *
7 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
8 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
9 * 91893 Orsay, France
10 */
11
12#include <isl_pw_macro.h>
13
14/* Make sure "pw" has room for at least "n" more pieces.
15 *
16 * If there is only one reference to pw, we extend it in place.
17 * Otherwise, we create a new PW and copy the pieces.
18 */
19static __isl_give PWisl_pw_qpolynomial *FN(PW,grow)isl_pw_qpolynomial_grow(__isl_take PWisl_pw_qpolynomial *pw, int n)
20{
21 int i;
22 isl_ctx *ctx;
23 PWisl_pw_qpolynomial *res;
24
25 if (!pw)
26 return NULL((void*)0);
27 if (pw->n + n <= pw->size)
28 return pw;
29 ctx = FN(PW,get_ctx)isl_pw_qpolynomial_get_ctx(pw);
30 n += pw->n;
31 if (pw->ref == 1) {
32 res = isl_realloc(ctx, pw, struct PW,((struct isl_pw_qpolynomial *)isl_realloc_or_die(ctx, pw, sizeof
(struct isl_pw_qpolynomial) + (n - 1) * sizeof(struct isl_pw_qpolynomial_piece
)))
33 sizeof(struct PW) + (n - 1) * sizeof(S(PW,piece)))((struct isl_pw_qpolynomial *)isl_realloc_or_die(ctx, pw, sizeof
(struct isl_pw_qpolynomial) + (n - 1) * sizeof(struct isl_pw_qpolynomial_piece
)))
;
34 if (!res)
35 return FN(PW,free)isl_pw_qpolynomial_free(pw);
36 res->size = n;
37 return res;
38 }
39 res = FN(PW,alloc_size)isl_pw_qpolynomial_alloc_size(isl_space_copy(pw->dim) OPT_TYPE_ARG(pw->), n);
40 if (!res)
41 return FN(PW,free)isl_pw_qpolynomial_free(pw);
42 for (i = 0; i < pw->n; ++i)
43 res = FN(PW,add_piece)isl_pw_qpolynomial_add_piece(res, isl_set_copy(pw->p[i].set),
44 FN(EL,copy)isl_pw_qpolynomial_copy(pw->p[i].FIELDqp));
45 FN(PW,free)isl_pw_qpolynomial_free(pw);
46 return res;
47}
48
49__isl_give PWisl_pw_qpolynomial *FN(PW,add_disjoint)isl_pw_qpolynomial_add_disjoint(__isl_take PWisl_pw_qpolynomial *pw1, __isl_take PWisl_pw_qpolynomial *pw2)
50{
51 int i;
52 isl_ctx *ctx;
53
54 if (FN(PW,align_params_bin)isl_pw_qpolynomial_align_params_bin(&pw1, &pw2) < 0)
55 goto error;
56
57 if (pw1->size < pw1->n + pw2->n && pw1->n < pw2->n)
58 return FN(PW,add_disjoint)isl_pw_qpolynomial_add_disjoint(pw2, pw1);
59
60 ctx = isl_space_get_ctx(pw1->dim);
Value stored to 'ctx' is never read
61 if (!OPT_EQUAL_TYPES(pw1->, pw2->)1)
62 isl_die(ctx, isl_error_invalid,do { isl_handle_error(ctx, isl_error_invalid, "fold types don't match"
, "polly/lib/External/isl/isl_pw_add_disjoint_templ.c", 63); goto
error; } while (0)
63 "fold types don't match", goto error)do { isl_handle_error(ctx, isl_error_invalid, "fold types don't match"
, "polly/lib/External/isl/isl_pw_add_disjoint_templ.c", 63); goto
error; } while (0)
;
64 if (FN(PW,check_equal_space)isl_pw_qpolynomial_check_equal_space(pw1, pw2) < 0)
65 goto error;
66
67 if (FN(PW,IS_ZERO)isl_pw_qpolynomial_is_zero(pw1)) {
68 FN(PW,free)isl_pw_qpolynomial_free(pw1);
69 return pw2;
70 }
71
72 if (FN(PW,IS_ZERO)isl_pw_qpolynomial_is_zero(pw2)) {
73 FN(PW,free)isl_pw_qpolynomial_free(pw2);
74 return pw1;
75 }
76
77 pw1 = FN(PW,grow)isl_pw_qpolynomial_grow(pw1, pw2->n);
78 if (!pw1)
79 goto error;
80
81 for (i = 0; i < pw2->n; ++i)
82 pw1 = FN(PW,add_piece)isl_pw_qpolynomial_add_piece(pw1,
83 isl_set_copy(pw2->p[i].set),
84 FN(EL,copy)isl_pw_qpolynomial_copy(pw2->p[i].FIELDqp));
85
86 FN(PW,free)isl_pw_qpolynomial_free(pw2);
87
88 return pw1;
89error:
90 FN(PW,free)isl_pw_qpolynomial_free(pw1);
91 FN(PW,free)isl_pw_qpolynomial_free(pw2);
92 return NULL((void*)0);
93}