]> git.ipfire.org Git - people/ms/gcc.git/commit
Do not pass NULL to memset in ssa_global_cache.
authorAldy Hernandez <aldyh@redhat.com>
Sun, 14 Nov 2021 10:27:32 +0000 (11:27 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Sun, 14 Nov 2021 13:13:55 +0000 (14:13 +0100)
commita7ef5da3a9c348c35abb72d6f64f209f5661cfa4
tree4758eb567477b1b2ad3e0d5685367d9fccb0b344
parent5a6100a25536ff75c40f1b4c44442cdbedc0426b
Do not pass NULL to memset in ssa_global_cache.

The code computing ranges in PHIs in the path solver reuses the
temporary ssa_global_cache by calling its clear method.  Calling it on
an empty cache causes us to call memset with NULL.

Tested on x86-64 Linux.

gcc/ChangeLog:

PR tree-optimization/103229
* gimple-range-cache.cc (ssa_global_cache::clear): Do not pass
null value to memset.

gcc/testsuite/ChangeLog:

* gcc.dg/pr103229.c: New test.
gcc/gimple-range-cache.cc
gcc/testsuite/gcc.dg/pr103229.c [new file with mode: 0644]