g/analyzer/realloc-1.c (test_7): Updated expected wording.
* gcc.dg/analyzer/vla-1.c (test_2): New. Prune output from
-Wfree-nonheap-object.
Signed-off-by: David Malcolm
---
gcc/analyzer/diagnostic-manager.cc| 105 +-
gcc/analyzer/engine.cc
call
get_or_create_cast if type is non-NULL.
gcc/testsuite/ChangeLog:
PR analyzer/104524
* gcc.dg/analyzer/pr104524.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/region-model-manager.cc | 5 +++--
gcc/testsuite/gcc.dg/analyzer/pr104524.c | 9 +
2 files changed
nalyzer/104274
* region-model.cc (region_model::check_for_poison): Ignore
uninitialized uses of empty types.
gcc/testsuite/ChangeLog:
PR analyzer/104274
* gcc.dg/analyzer/torture/empty-struct-1.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/r
decl.
gcc/testsuite/ChangeLog:
PR analyzer/98797
* gcc.dg/analyzer/casts-1.c: Mark xfails as fixed; add further
test coverage for casts of string literals.
Signed-off-by: David Malcolm
---
gcc/analyzer/region-model-manager.cc| 19 +++
gcc/analyzer/regio
): Use __SIZE_TYPE__ rather
than hardcoding long unsigned int.
Signed-off-by: David Malcolm
---
gcc/testsuite/gcc.dg/analyzer/fields.c| 2 +-
gcc/testsuite/gcc.dg/analyzer/gzio-3.c| 2 +-
gcc/testsuite/gcc.dg/analyzer/gzio-3a.c | 2 +-
gcc/testsuite/gcc.dg/analyzer/pr98969.c | 4
* gcc.dg/analyzer/uninit-1.c: Add test coverage for shifts,
comparisons, +, -, *, /, and __builtin_strlen.
* gcc.dg/analyzer/uninit-CWE-457-examples.c: New test.
Signed-off-by: David Malcolm
---
gcc/testsuite/gcc.dg/analyzer/uninit-1.c | 85 +
.../gcc.dg/
New.
(selftest::analyzer_region_model_cc_tests): Call it.
* region.h (bit_range_region::key_t::hash): Fix hashing of m_bits
to avoid using uninitialized data.
gcc/testsuite/ChangeLog:
PR analyzer/104452
* gcc.dg/analyzer/pr104452.c: New test.
Signed-off-by: David Mal
On Fri, 2022-02-04 at 11:35 -0500, Joel Teichroeb via Gcc-patches
wrote:
> In recent versions of glibc fopen has __attribute__((malloc)).
> Since we can not detect wether this attribute is present or not,
> we avoid including stdio.h and instead forward declare what we
> need in each test.
>
>
tion.
(tainted_allocation_size::emit): Likewise.
(region_model::check_dynamic_size_for_taint): Likewise.
gcc/testsuite/ChangeLog:
PR analyzer/104417
* gcc.dg/analyzer/pr104417.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/sm-taint.cc | 9 -
gcc/tests
nate versions of test cases
in which the calls to memcpy are hidden from the optimizer. Add
further test cases.
* gcc.dg/analyzer/taint-size-1.c: Add test coverage for memcpy
with tainted size.
Signed-off-by: David Malcolm
---
gcc/analyzer/region-model-impl-call
.
* gcc.dg/analyzer/realloc-4.c: New test.
* gcc.dg/analyzer/taint-realloc.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/engine.cc| 2 +-
gcc/analyzer/region-model-impl-calls.cc | 33 ++-
gcc/analyzer/sm-taint.cc | 1
c.dg/analyzer/calloc-1.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/region-model-impl-calls.cc | 4 +++-
gcc/testsuite/gcc.dg/analyzer/calloc-1.c | 27
2 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.dg/analyzer/calloc
On Wed, 2022-02-02 at 17:14 +, Qing Zhao wrote:
> Hi, David,
>
> Thank you for fixing this issue!
>
> > On Feb 2, 2022, at 9:06 AM, David Malcolm via Gcc-patches <
> > gcc-patches@gcc.gnu.org> wrote:
> >
> > GCC 12 has gained two features fo
to-var-init-zero.c: Move to...
* gcc.dg/analyzer/torture/uninit-trivial-auto-var-init-zero.c: ...here.
Signed-off-by: David Malcolm
---
gcc/analyzer/region-model.cc | 21 ++-
gcc/analyzer/region-model.h | 2 --
gcc/analyzer/region.cc
fset): Consolidate effectively
identical cases.
Signed-off-by: David Malcolm
---
gcc/analyzer/region.cc | 48 +-
1 file changed, 5 insertions(+), 43 deletions(-)
diff --git a/gcc/analyzer/region.cc b/gcc/analyzer/region.cc
index 9d8fdb22271..77554b86143 10
New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/analyzer.h | 1 +
gcc/analyzer/region-model-manager.cc | 20 +
gcc/analyzer/region-model.cc | 14 +++
gcc/analyzer/region-model.h | 4 +
gcc/analyzer/regio
* gcc.dg/analyzer/uninit-trivial-auto-var-init-pattern.c: New
test.
* gcc.dg/analyzer/uninit-trivial-auto-var-init-uninitialized.c:
New test.
* gcc.dg/analyzer/uninit-trivial-auto-var-init-zero.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/r
gcc.dg/analyzer/uninit-alloca.c: New test.
* gcc.dg/analyzer/uninit-pr94713.c: Add dg-message directive for
expected region creation event.
* gcc.dg/analyzer/uninit-pr94714.c: Likewise.
* gcc.dg/analyzer/zlib-3.c: Likewise.
Signed-off-by: David Malcolm
-
ite/ChangeLog:
PR analyzer/104224
* gcc.dg/analyzer/pr104224.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/region-model.cc | 11 +++
gcc/analyzer/region-model.h | 2 +
gcc/testsuite/gcc.dg/analyzer/pr104224.c | 106 ++
On Sun, 2022-01-23 at 17:34 +0100, Mikael Morin wrote:
> Hello,
>
> Le 21/01/2022 à 00:59, David Malcolm via Gcc-patches a écrit :
> > diff --git a/gcc/analyzer/constraint-manager.cc
> > b/gcc/analyzer/constraint-manager.cc
> > index 568e7150ea7..7c4a85bbb24 10
On Sat, 2022-01-22 at 19:29 -0500, Antoni Boucher wrote:
> Hi.
>
> Le mardi 18 janvier 2022 à 18:49 -0500, David Malcolm a écrit :
> > On Mon, 2022-01-17 at 19:46 -0500, Antoni Boucher via Gcc-patches
> > wrote:
> > > I missed the comment about the new define, so
Dave
>
> Le mardi 18 janvier 2022 à 18:22 -0500, David Malcolm a écrit :
> > On Mon, 2022-01-17 at 21:02 -0500, Antoni Boucher via Gcc-patches
> > wrote:
> > > Hi.
> > > This option will be useful for rustc_codegen_gcc to hide the
> > >
Committed to trunk as r12-6818-ga1fb81bda97014ba14d55c4c2e143d31ffe2e264.
gcc/testsuite/ChangeLog:
PR analyzer/104150
* gcc.dg/analyzer/pr104089.c: Add "dg-add-options float16"
and "dg-require-effective-target float16" directives.
Signed-off-by: Dav
* gcc.dg/analyzer/pr94362-1.c: New test.
* gcc.dg/analyzer/pr94362-2.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/constraint-manager.cc| 172 --
gcc/analyzer/constraint-manager.h | 15 +-
gcc/analyzer/region-model.cc | 5 +-
gc
-pc-linux-gnu.
Pushed to trunk as r12-6781-gf5a9d76be849b4cf20b1b687febc34a937381dc3.
gcc/testsuite/ChangeLog:
PR analyzer/103685
* gcc.dg/analyzer/torture/pr103685.c: New test.
Signed-off-by: David Malcolm
---
.../gcc.dg/analyzer/torture/pr103685.c| 33
On Wed, 2022-01-19 at 14:46 +0100, Richard Biener wrote:
> On Wed, Jan 19, 2022 at 2:45 PM David Malcolm via Gcc-patches
> wrote:
> >
> > This is mostly a mechanical change, apart from:
> > - fix the name of opt_proposer_c to match its filename
> > (opt-sugges
(cp_tree_cc_tests): ...this.
* pt.cc (cp_pt_c_tests): Rename to...
(cp_pt_cc_tests): ...this.
* tree.cc (cp_tree_c_tests): Rename to...
(cp_tree_cc_tests): ...this.
Signed-off-by: David Malcolm
---
gcc/attribs.cc | 2 +-
gcc/bitmap.cc | 2 +-
On Mon, 2022-01-17 at 19:46 -0500, Antoni Boucher via Gcc-patches
wrote:
> I missed the comment about the new define, so here's the updated
> patch.
Thanks for the patch.
>
> Le lundi 17 janvier 2022 à 19:24 -0500, Antoni Boucher via Jit a
> écrit :
> > Hi.
> > This patch add supports for
On Mon, 2022-01-17 at 21:02 -0500, Antoni Boucher via Gcc-patches
wrote:
> Hi.
> This option will be useful for rustc_codegen_gcc to hide the error
> about unsupported 128-bit integer types.
>
> David, if you know of a better way to check if these types are
> supported than creating such a type
On Mon, 2022-01-17 at 19:30 -0500, Antoni Boucher via Gcc-patches
wrote:
> I was missing the define, so I added it.
> Here's the new patch with it.
Thanks for the patch.
> Le lundi 17 janvier 2022 à 17:18 -0500, Antoni Boucher via Jit a
> écrit :
> > Hi.
> > This patch add support for bitcasts
sert that
we have a CONSTANT_CLASS_P.
(region_model_manager::maybe_fold_unaryop): Only fold a constant
when fold_unary's result is a constant or a cast of a constant.
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/pr104089.c: New test.
PR analyzer/104089
Signed-off-by: D
ting to
NULL type when folding access to repeated svalue.
gcc/testsuite/ChangeLog:
PR analyzer/104062
* gcc.dg/analyzer/pr104062.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/region-model-manager.cc | 3 ++-
gcc/testsuite/gcc.dg/analyzer/pr104062.c
On Fri, 2022-01-14 at 23:01 -0500, Jason Merrill wrote:
> On 1/13/22 17:30, David Malcolm wrote:
> > On Thu, 2022-01-13 at 17:08 -0500, Jason Merrill wrote:
> > > When a sequence of diagnostic messages bounces back and forth
> > > repeatedly
On Fri, 2022-01-14 at 17:53 -0500, David Malcolm wrote:
> gcc/analyzer/ChangeLog:
> PR analyzer/104029
> * sm-taint.cc (taint_state_machine::alt_get_inherited_state):
> Remove gcc_unreachable from default case for unary ops.
>
> gcc/testsuite/Chang
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as cc3b67e40140ec79f86e79a96d7fdd169b84faaf.
gcc/analyzer/ChangeLog:
* sm-taint.cc (taint_state_machine::combine_states): Handle combination
of has_ub and has_lb.
gcc/testsuite/ChangeLog:
*
gcc/analyzer/ChangeLog:
PR analyzer/104029
* sm-taint.cc (taint_state_machine::alt_get_inherited_state):
Remove gcc_unreachable from default case for unary ops.
gcc/testsuite/ChangeLog:
PR analyzer/104029
* gcc.dg/analyzer/pr104029.c: New test.
*
On Thu, 2022-01-13 at 14:08 -0500, Jason Merrill wrote:
> On 1/12/22 10:33, David Malcolm wrote:
> > On Tue, 2022-01-11 at 23:36 -0500, Jason Merrill wrote:
> > > On 1/10/22 16:36, David Malcolm via Gcc-patches wrote:
> > > > On Thu, 2022-01-06 at 09:08 -0500, David M
On Thu, 2022-01-13 at 17:08 -0500, Jason Merrill wrote:
> When a sequence of diagnostic messages bounces back and forth
> repeatedly
> between two includes, as with
>
> #include
> std::map m ("123", "456");
>
> The output is quite a bit longer than necessary because we dump the
> include
>
On Tue, 2022-01-11 at 23:36 -0500, Jason Merrill wrote:
> On 1/10/22 16:36, David Malcolm via Gcc-patches wrote:
> > On Thu, 2022-01-06 at 09:08 -0500, David Malcolm wrote:
> > > On Sat, 2021-11-13 at 15:37 -0500, David Malcolm wrote:
> > > > This patch adds
PR analyzer/103940
* gcc.dg/analyzer/taint-size-access-attr-1.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/engine.cc| 17 ++-
gcc/analyzer/sm-taint.cc | 116 --
gcc/analyzer/sm.h |
PR analyzer/102692 reports a false positive at -O2 from
-Wanalyzer-null-dereference on:
if (!p || q || !p->next)
At the gimple level, -O2 has converted the first || into bitwise or
controlling a jump:
_4 = _2 | _3;
if (_4 != 0)
and a recursive call has been converted to iteration. The
On Thu, 2022-01-06 at 09:08 -0500, David Malcolm wrote:
> On Sat, 2021-11-13 at 15:37 -0500, David Malcolm wrote:
> > This patch adds a new __attribute__ ((tainted)) to the C/C++
> > frontends.
>
> Ping for GCC C/C++ mantainers for review of the C/C++ FE parts of th
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as 11a2ff8d981110e1562caf7d98e41c1ff2e76056.
gcc/analyzer/ChangeLog:
* engine.cc (impl_run_checkers): Pass logger to engine ctor.
* region-model-manager.cc
PR analyzer/103546 seems to involve an issue in how the analyzer
tracks which decls have escaped, so this patch adds a way to directly
test this from DejaGnu.
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r12-6377-g4409152a4acaec5b58a93996088d0df9aaa779b8.
This patch adds a debug function that I've found handy when debugging
a problem with handling the decl yy_buffer_stack" in PR analyzer/103546.
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r12-6376-gc1b7d28a5987e74232b7f054849f8bd8ccc7e7de.
Whilst debugging PR analyzer/103546 (false +ve in flex-generated lexers)
I noticed that the analyzer was considering that writes through symbolic
pointers could be treated as clobbering static globals such as:
static YY_BUFFER_STATE * yy_buffer_stack = NULL;
even for such variables that never
On Thu, 2021-12-09 at 15:54 -0700, Martin Sebor wrote:
> On 11/13/21 1:37 PM, David Malcolm via Gcc-patches wrote:
> > This patch adds a new:
> >
> > __attribute__((untrusted))
> >
> > for use by the C front-end, intended for use by the Linux kernel for
>
On Sat, 2021-11-13 at 15:37 -0500, David Malcolm wrote:
> This patch adds a new __attribute__ ((tainted)) to the C/C++
> frontends.
Ping for GCC C/C++ mantainers for review of the C/C++ FE parts of this
patch (attribute registration, documentation, the name of the
attribute, etc).
(I b
On Thu, 2022-01-06 at 08:53 -0500, David Malcolm wrote:
> On Sun, 2021-12-19 at 22:30 +0100, Marc Nieper-Wißkirchen wrote:
> > This patch fixes a memory leak in the pass manager. In the existing
> > code,
> > the m_name_to_pass_map is allocated in
> > pass_
On Sun, 2021-12-19 at 22:30 +0100, Marc Nieper-Wißkirchen wrote:
> This patch fixes a memory leak in the pass manager. In the existing
> code,
> the m_name_to_pass_map is allocated in
> pass_manager::register_pass_name, but
> never deallocated. This is fixed by adding a deletion in
>
On Sun, 2021-12-12 at 20:39 -0500, Antoni Boucher wrote:
> Yes, this patch works for rustc_codegen_gcc perfectly.
> It even fixes one issue that was in my patch, so that's nice!
Excellent - thanks Antoni.
>
> Le samedi 11 décembre 2021 à 15:35 +, Petter Tomner a écrit :
> > Hi!
> >
> > >
On Mon, 2021-12-13 at 10:53 -0700, Martin Sebor via Gcc-patches wrote:
> On 12/10/21 3:42 PM, Thomas Schwinge wrote:
> > Hi!
> >
> > OK to push the attached "testsuite: Be more informative for ICEs"?
>
> Adding more detail here seems like a useful improvement to me.
>
> Martin
Agreed. I don't
62.c: New test.
Signed-off-by: David Malcolm
---
gcc/jit/jit-playback.c | 1 +
gcc/testsuite/jit.dg/all-non-failing-tests.h | 3 +
gcc/testsuite/jit.dg/test-pr103562.c | 62
3 files changed, 66 insertions(+)
create mode 100644 gcc/testsuite/ji
On Sun, 2021-11-21 at 16:44 -0500, Antoni Boucher wrote:
> Thanks for the review!
> I updated the patch.
>
> See notes below.
Thanks; the updated patch looks good for trunk.
Dave
On Mon, 2021-12-06 at 10:47 +, Petter Tomner via Gcc-patches wrote:
> Hi!
>
> Attached is a patch with changes in line with the review of the prior
> patch.
> The patch adds support for initialization of global variables with
> rvalues as well
> as rvalue constructors for structs, arrays and
On Mon, 2021-12-06 at 13:40 -0600, Segher Boessenkool wrote:
> On Mon, Dec 06, 2021 at 11:12:00AM -0700, Martin Sebor wrote:
> > On 11/13/21 1:37 PM, David Malcolm via Gcc-patches wrote:
> > > Approach 1: Custom Address Spaces
> > > =
&g
On Mon, 2021-12-06 at 11:12 -0700, Martin Sebor wrote:
> On 11/13/21 1:37 PM, David Malcolm via Gcc-patches wrote:
> > [Crossposting between gcc-patches@gcc.gnu.org and
> > linux-toolcha...@vger.kernel.org; sorry about my lack of kernel
> > knowledge, in case of the
New.
(constraint_manager::canonicalize): Call it when determining
redundant ECs.
(selftest::test_purging): New selftest.
(selftest::run_constraint_manager_tests): Likewise.
* constraint-manager.h (equiv_class::contains_non_constant_p):
New decl.
Signed-off-by: D
Successfully regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r12-5757-g38a0ee2649ef236ea2763bb9cfc42dc917c7d3fd.
gcc/testsuite/ChangeLog:
PR analyzer/103526
* gcc.dg/analyzer/pr103526.c: New test.
Signed-off-by: David Malcolm
---
gcc/testsuite/gcc.dg/analyzer/pr103526.c
-off-by: David Malcolm
---
gcc/analyzer/region-model-reachability.cc | 13 +++
gcc/testsuite/gcc.dg/analyzer/leak-3.c| 41 +++
2 files changed, 54 insertions(+)
create mode 100644 gcc/testsuite/gcc.dg/analyzer/leak-3.c
diff --git a/gcc/analyzer/region-model-reachability.c
Successfully regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r12-5642-g955ea7b58e4f1e3cc5083e88575161168c147254.
gcc/testsuite/ChangeLog:
PR analyzer/94579
* gcc.dg/analyzer/pr94579.c: New test.
Signed-off-by: David Malcolm
---
gcc/testsuite/gcc.dg/analyzer/pr94579.c | 11
Successfully regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r12-5640-g03ea0ca1189a39e095188b0425c66446cc84a0a5.
gcc/testsuite/ChangeLog:
PR analyzer/100524
* gcc.dg/analyzer/pragma-2.c: New test.
Signed-off-by: David Malcolm
---
gcc/testsuite/gcc.dg/analyzer/pragma-2.c
Successfully regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r12-5641-g9603bccba62e250d0ff64863a1730a167d571a25.
gcc/testsuite/ChangeLog:
PR analyzer/99269
* gcc.dg/analyzer/pr99269.c: New test.
Signed-off-by: David Malcolm
---
gcc/testsuite/gcc.dg/analyzer/pr99269.c | 16
* gcc.dg/analyzer/pr103217-5.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/store.cc | 14 +-
gcc/testsuite/gcc.dg/analyzer/pr103217-2.c | 52 ++
gcc/testsuite/gcc.dg/analyzer/pr103217-3.c | 52 ++
gcc/testsuite/gcc.dg/
On Sat, 2021-11-20 at 17:34 -0500, Antoni Boucher wrote:
> Hi.
> Here's the updated patch.
> See comments below.
> Thanks for your reviews!
>
> Le jeudi 20 mai 2021 à 16:11 -0400, David Malcolm a écrit :
> > On Tue, 2021-05-18 at 20:43 -0400, Antoni Boucher via Gcc-patche
On Sat, 2021-11-20 at 11:27 -0500, Antoni Boucher wrote:
> Hi.
> Here's the updated patch.
> Thanks for the review!
Thanks for the updated patch...
>
> Le jeudi 20 mai 2021 à 16:24 -0400, David Malcolm a écrit :
> > On Mon, 2021-05-17 at 21:02 -0400, Antoni Boucher via J
On Sat, 2021-11-20 at 11:53 -0500, Antoni Boucher wrote:
> Hi.
> Here's the updated patch.
> See comments below.
> Thanks for the review!
>
> Le samedi 20 novembre 2021 à 11:20 -0500, David Malcolm a écrit :
> > On Sat, 2021-11-20 at 00:58 -0500, Antoni
eudi 20 mai 2021 à 15:29 -0400, David Malcolm a écrit :
> > On Wed, 2021-05-19 at 20:32 -0400, Antoni Boucher via Jit wrote:
> > > Hello.
> > > This patch adds support to set the link section of global
> > > variables.
> > > I used the ABI 18 because I submitt
On Mon, 2021-09-27 at 20:53 -0400, Antoni Boucher wrote:
> I fixed an issue (it would show an error message when
> gcc_jit_type_dyncast_function_ptr_type was called on a type different
> than a function pointer type).
>
> Here's the updated patch.
Sorry about the delay in responding.
The
s and reject the
merger accordingly.
gcc/testsuite/ChangeLog:
PR analyzer/103217
* gcc.dg/analyzer/explode-1.c: Update for improvement to location
of leak warning.
* gcc.dg/analyzer/pr103217.c: New test.
* gcc.dg/analyzer/pr94858-1.c: Add -Wno-analyzer-to
On Thu, 2021-11-18 at 14:08 -0600, Segher Boessenkool wrote:
> On Wed, Nov 17, 2021 at 10:43:58PM +, Joseph Myers wrote:
> > On Wed, 17 Nov 2021, Prathamesh Kulkarni via Gcc-patches wrote:
> > > More generally, would it be a good idea to provide attributes for
> > > mod/ref anaylsis ?
> > > So
On Wed, 2021-11-17 at 22:43 +, Joseph Myers wrote:
> On Wed, 17 Nov 2021, Prathamesh Kulkarni via Gcc-patches wrote:
>
> > More generally, would it be a good idea to provide attributes for
> > mod/ref anaylsis ?
> > So sth like:
> > void foo(void) __attribute__((modifies(errno)));
> > which
On Wed, 2021-11-17 at 14:53 +0530, Prathamesh Kulkarni wrote:
> On Tue, 16 Nov 2021 at 03:42, David Malcolm
> wrote:
> >
> > On Mon, 2021-11-15 at 12:33 +0530, Prathamesh Kulkarni wrote:
> > > On Sun, 14 Nov 2021 at 02:07, David Malcolm via Gcc-patches
> > >
5356-gbef32d4a28595e933f24fef378cf052a30b674a7.
Signed-off-by: David Malcolm
gcc/testsuite/ChangeLog:
PR preprocessor/103026
* c-c++-common/Wbidi-chars-ranges.c: New test.
libcpp/ChangeLog:
PR preprocessor/103026
* lex.c (struct bidi::context): New.
(bidi::vec): Con
e983c9ab3.
libcpp/ChangeLog:
PR preprocessor/103026
* lex.c (maybe_warn_bidi_on_close): Use a rich_location
and call set_escape_on_output (true) on it.
(maybe_warn_bidi_on_char): Likewise.
Signed-off-by: David Malcolm
---
libcpp/lex.c | 29
On Tue, 2021-11-16 at 19:37 -0500, Marek Polacek wrote:
> On Tue, Nov 16, 2021 at 06:00:58PM -0500, David Malcolm wrote:
> > > On Mon, Nov 15, 2021 at 06:15:40PM -0500, David Malcolm wrote:
> > > > > On Mon, Nov 08, 2021 at 04:33:43PM -0500, Marek Polacek wrote:
> &
* gcc.dg/analyzer/strchr-1.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/region-model-impl-calls.cc | 69
gcc/analyzer/region-model-manager.cc | 7 +++
gcc/analyzer/region-model.cc | 52 --
gcc/analyzer/region-model.h
alloca.
* gcc.dg/analyzer/capacity-3.c: Likewise.
Signed-off-by: David Malcolm
---
gcc/testsuite/gcc.dg/analyzer/capacity-1.c | 4 +++-
gcc/testsuite/gcc.dg/analyzer/capacity-3.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/analyzer/capacity-1
> On Mon, Nov 15, 2021 at 06:15:40PM -0500, David Malcolm wrote:
> > > On Mon, Nov 08, 2021 at 04:33:43PM -0500, Marek Polacek wrote:
> > > > Ping, can we conclude on the name? IMHO, -Wbidirectional is just fine,
> > > > but changing the name is a trivial ope
gned-off-by: David Malcolm
---
gcc/analyzer/constraint-manager.cc | 4 ++-
gcc/testsuite/g++.dg/analyzer/pr102662.C | 39
2 files changed, 42 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/g++.dg/analyzer/pr102662.C
diff --git a/gcc/analyzer/constr
> On Mon, Nov 08, 2021 at 04:33:43PM -0500, Marek Polacek wrote:
> > Ping, can we conclude on the name? IMHO, -Wbidirectional is just fine,
> > but changing the name is a trivial operation.
>
> Here's a patch with a better name (suggested by Jonathan W.). Otherwise no
> changes.
Thanks for
On Mon, 2021-11-15 at 15:45 +0100, Peter Zijlstra wrote:
> On Mon, Nov 15, 2021 at 12:33:16PM +0530, Prathamesh Kulkarni wrote:
> > On Sun, 14 Nov 2021 at 02:07, David Malcolm via Gcc-patches
>
> > > +/* Handle "returns_zero_on_failure" and "retur
On Mon, 2021-11-15 at 12:33 +0530, Prathamesh Kulkarni wrote:
> On Sun, 14 Nov 2021 at 02:07, David Malcolm via Gcc-patches
> wrote:
> >
> > This patch adds two new attributes. The followup patch makes use of
> > the attributes in -fanalyzer.
[...
On Sun, 2021-11-14 at 00:20 +0100, Peter Zijlstra wrote:
> On Sat, Nov 13, 2021 at 03:37:24PM -0500, David Malcolm wrote:
>
> > This approach is much less expressive that the custom addres space
> > approach; it would only cover the trust boundary aspect; it
> > wouldn't
&
* gcc.dg/analyzer/infoleak-fixit-1.c: New test.
* gcc.dg/analyzer/torture/infoleak-net-ethtool-ioctl.c: New test.
* gcc.dg/analyzer/torture/infoleak-vfio_iommu_type1.c: New test.
Signed-off-by: David Malcolm
---
gcc/Makefile.in | 3 +-
gcc/a
.
* gcc.dg/analyzer/taint-alloc-3.c: New test.
* gcc.dg/analyzer/taint-alloc-4.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/engine.cc| 317 +-
gcc/c-family/c-attribs.c | 36 ++
gcc/doc/extend.texi
ere involved when complaining about mismatching
address spaces.
gcc/cp/ChangeLog:
* tree.c (c_register_custom_addr_space): New stub.
gcc/testsuite/ChangeLog:
* gcc.dg/custom-address-space-1.c: New test.
* gcc.dg/custom-address-space-2.c: New test.
* gcc.dg/cus
lyzer/taint-CVE-2011-0521-6.c: New test.
* gcc.dg/analyzer/taint-CVE-2011-0521.h: New test.
* gcc.dg/analyzer/taint-antipatterns-1.c: New test.
* gcc.dg/analyzer/taint-read-through-untrusted-ptr-1.c: New test.
Signed-off-by: David Malcolm
---
gcc/analyzer/sm-taint.cc
gcc/analyzer/ChangeLog:
* region.cc (region::untrusted_p): Implement in terms of
__attribute__((untrusted)).
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/test-uaccess.h: Change from custom_address_space
pragma to __attribute__((untrusted)).
Signed-off-by: David
are many examples in the patches, some of which are taken from
historical kernel vulnerabilities, and others from my "antipatterns.ko"
project ( https://github.com/davidmalcolm/antipatterns.ko ).
Thoughts?
Dave
David Malcolm (6 or 8, depending how you count):
1a: RFC: Implement "#pragm
gcc/analyzer/ChangeLog:
(region::untrusted_p): New.
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/test-uaccess.h: New header.
Signed-off-by: David Malcolm
---
gcc/analyzer/region.cc | 13 +
gcc/testsuite/gcc.dg/analyzer/test-uaccess.h | 19
le TYPE_QUAL_UNTRUSTED.
* tree.h (TYPE_QUALS): Likewise.
(TYPE_QUALS_NO_ADDR_SPACE): Likewise.
(TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC): Likewise.
gcc/testsuite/ChangeLog:
* c-c++-common/attr-untrusted-1.c: New test.
Signed-off-by: David Malcolm
---
gcc/c-family/c-attribs.c
i (Common Function Attributes): Document
"returns_zero_on_failure" and "returns_zero_on_success".
gcc/testsuite/ChangeLog:
* c-c++-common/attr-returns-zero-on-1.c: New test.
Signed-off-by: David Malcolm
---
gcc/c-family/c-attribs.c | 37 ++
gcc/d
ew test.
* gcc.dg/analyzer/taint-1.c: Rename to...
* gcc.dg/analyzer/taint-read-index-1.c: ...this. Tweak expected
wording. Mark some events as xfail.
* gcc.dg/analyzer/taint-read-offset-1.c: New test.
* gcc.dg/analyzer/taint-size-1.c: New test
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as 72f1c1c452198ba1df6f70959180b201cedc506e.
gcc/analyzer/ChangeLog:
* engine.cc (exploded_node::on_stmt_pre): Return when handling
"__analyzer_dump_state".
Signed-off-by: David Mal
oyvm.c (toyvm_function_compile):
Increase size of buffer.
* docs/examples/tut04-toyvm/toyvm.cc
(compilation_state::create_function): Likewise.
Signed-off-by: David Malcolm
---
gcc/jit/docs/examples/tut04-toyvm/toyvm.c | 2 +-
gcc/jit/docs/examples/tut04-toyvm/toyvm.cc | 2 +-
2 files chan
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r12-5176-gabdff441a07f55d16e3d0e5ced3123c83d210a0a.
gcc/ChangeLog:
PR other/103129
* diagnostic-show-locus.c (def_policy): Use def_tabstop.
Signed-off-by: David Malcolm
---
gcc/diagnostic-
ns.c: New test.
Signed-off-by: David Malcolm
---
gcc/c-family/c-pragma.c | 33 +---
gcc/testsuite/gcc.dg/bad-pragma-locations.c | 86 +
2 files changed, 107 insertions(+), 12 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/bad-pragma-locations
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as 347682ea4637c57c386908d6e1aa52e4efaace53.
gcc/analyzer/ChangeLog:
* program-state.cc (sm_state_map::dump): Use default_tree_printer
as format decoder.
---
gcc/analyzer/program-state.cc | 1 +
1 file
On Mon, 2021-11-01 at 16:17 -0600, Martin Sebor via Gcc-patches wrote:
> Patch 1 in the series detects a small subset of uses of pointers
> made indeterminate by calls to deallocation functions like free
> or C++ operator delete. To control the conditions the warnings
> are issued under the new
901 - 1000 of 5028 matches
Mail list logo